veleta-templates 0.0.21 → 0.0.23

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.
@@ -139,11 +139,11 @@ const DefaultTemplate = class {
139
139
  if (!menuData) {
140
140
  return index.h("div", { class: "menu-loading" }, "Loading...");
141
141
  }
142
- const { business, sections, templateData } = menuData;
142
+ const { sections, templateData, menu } = menuData;
143
143
  const theme = templateData === null || templateData === void 0 ? void 0 : templateData.theme;
144
144
  const primaryColor = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#18181b';
145
145
  const sortedSections = [...(sections || [])].sort((a, b) => a.order - b.order);
146
- return (index.h("div", { class: "menu-wrapper" }, index.h("header", { class: "menu-header" }, (business === null || business === void 0 ? void 0 : business.name) && index.h("h1", { class: "business-name" }, business.name), (business === null || business === void 0 ? void 0 : business.description) && (index.h("p", { class: "business-description" }, business.description))), index.h("veleta-menu-tabs", { sections: sortedSections.map((s) => ({ id: s.id, title: s.title })), activeSectionId: this.activeSectionId || ((_a = sortedSections[0]) === null || _a === void 0 ? void 0 : _a.id), onTabClick: (ev) => this.handleTabClick(ev.detail) }), index.h("main", { class: "menu-content" }, sortedSections.map((section) => {
146
+ return (index.h("div", { class: "menu-wrapper" }, index.h("header", { class: "menu-header" }, (menu === null || menu === void 0 ? void 0 : menu.name) && index.h("h1", { class: "business-name" }, menu.name), (menu === null || menu === void 0 ? void 0 : menu.description) && (index.h("p", { class: "business-description" }, menu.description))), index.h("veleta-menu-tabs", { sections: sortedSections.map((s) => ({ id: s.id, title: s.title })), activeSectionId: this.activeSectionId || ((_a = sortedSections[0]) === null || _a === void 0 ? void 0 : _a.id), onTabClick: (ev) => this.handleTabClick(ev.detail) }), index.h("main", { class: "menu-content" }, sortedSections.map((section) => {
147
147
  var _a;
148
148
  return (index.h("section", { key: section.id, id: `section-${section.id}`, class: "menu-section" }, index.h("h2", { class: "section-title", style: { borderColor: primaryColor } }, section.title), section.description && (index.h("p", { class: "section-description" }, section.description)), index.h("div", { class: "dishes-list" }, (_a = section.dishes) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.order - b.order).map((dish) => (index.h("div", { key: dish.id, class: `dish-item ${this.expandedDishes[dish.id] ? 'expanded' : ''}`, onClick: () => this.toggleDish(dish.id) }, index.h("div", { class: "dish-header" }, index.h("span", { class: "dish-name" }, dish.name), index.h("span", { class: "dish-price" }, formatPrice(dish.price))), dish.description && (index.h("div", { class: "dish-details" }, index.h("p", { class: "dish-description" }, dish.description)))))))));
149
149
  }))));
@@ -105,11 +105,11 @@ export class DefaultTemplate {
105
105
  if (!menuData) {
106
106
  return h("div", { class: "menu-loading" }, "Loading...");
107
107
  }
108
- const { business, sections, templateData } = menuData;
108
+ const { sections, templateData, menu } = menuData;
109
109
  const theme = templateData === null || templateData === void 0 ? void 0 : templateData.theme;
110
110
  const primaryColor = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#18181b';
111
111
  const sortedSections = [...(sections || [])].sort((a, b) => a.order - b.order);
112
- return (h("div", { class: "menu-wrapper" }, h("header", { class: "menu-header" }, (business === null || business === void 0 ? void 0 : business.name) && h("h1", { class: "business-name" }, business.name), (business === null || business === void 0 ? void 0 : business.description) && (h("p", { class: "business-description" }, business.description))), h("veleta-menu-tabs", { sections: sortedSections.map((s) => ({ id: s.id, title: s.title })), activeSectionId: this.activeSectionId || ((_a = sortedSections[0]) === null || _a === void 0 ? void 0 : _a.id), onTabClick: (ev) => this.handleTabClick(ev.detail) }), h("main", { class: "menu-content" }, sortedSections.map((section) => {
112
+ return (h("div", { class: "menu-wrapper" }, h("header", { class: "menu-header" }, (menu === null || menu === void 0 ? void 0 : menu.name) && h("h1", { class: "business-name" }, menu.name), (menu === null || menu === void 0 ? void 0 : menu.description) && (h("p", { class: "business-description" }, menu.description))), h("veleta-menu-tabs", { sections: sortedSections.map((s) => ({ id: s.id, title: s.title })), activeSectionId: this.activeSectionId || ((_a = sortedSections[0]) === null || _a === void 0 ? void 0 : _a.id), onTabClick: (ev) => this.handleTabClick(ev.detail) }), h("main", { class: "menu-content" }, sortedSections.map((section) => {
113
113
  var _a;
114
114
  return (h("section", { key: section.id, id: `section-${section.id}`, class: "menu-section" }, h("h2", { class: "section-title", style: { borderColor: primaryColor } }, section.title), section.description && (h("p", { class: "section-description" }, section.description)), h("div", { class: "dishes-list" }, (_a = section.dishes) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.order - b.order).map((dish) => (h("div", { key: dish.id, class: `dish-item ${this.expandedDishes[dish.id] ? 'expanded' : ''}`, onClick: () => this.toggleDish(dish.id) }, h("div", { class: "dish-header" }, h("span", { class: "dish-name" }, dish.name), h("span", { class: "dish-price" }, formatPrice(dish.price))), dish.description && (h("div", { class: "dish-details" }, h("p", { class: "dish-description" }, dish.description)))))))));
115
115
  }))));
@@ -1 +1 @@
1
- import{t as e,p as t,H as i,h as s}from"./index.js";import{d as o}from"./p-Bn5G3Oo7.js";const n=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.expandedDishes={},this.activeSectionId="",this.sectionVisibility=new Map,this.isScrollingByTab=!1,this.toggleDish=e=>{this.expandedDishes=Object.assign(Object.assign({},this.expandedDishes),{[e]:!this.expandedDishes[e]})},this.handleTabClick=e=>{const t=this.el.querySelector("#section-"+e);if(t){this.isScrollingByTab=!0,this.activeSectionId=e;const i=95,s=t.getBoundingClientRect().top+window.pageYOffset-i;window.scrollTo({top:s,behavior:"smooth"})}},this.handleScroll=()=>{if(this.isScrollingByTab)return clearTimeout(this.scrollTimeout),void(this.scrollTimeout=setTimeout((()=>{this.isScrollingByTab=!1,this.updateActiveSection()}),150));this.updateActiveSection()},this.updateActiveSection=()=>{if(this.isScrollingByTab)return;const e=Array.from(this.el.querySelectorAll(".menu-section"));if(0===e.length)return;const t=window.innerHeight+window.pageYOffset>=document.documentElement.scrollHeight-10;let i=this.activeSectionId;if(t){for(let t=e.length-1;t>=0;t--)if(this.sectionVisibility.get(e[t].id)){i=e[t].id.replace("section-","");break}}else for(const t of e)if(this.sectionVisibility.get(t.id)){i=t.id.replace("section-","");break}i!==this.activeSectionId&&(this.activeSectionId=i)},this.dataJson="{}"}componentDidLoad(){this.initIntersectionObserver(),window.addEventListener("scroll",this.handleScroll)}disconnectedCallback(){this.observer&&this.observer.disconnect(),window.removeEventListener("scroll",this.handleScroll),clearTimeout(this.scrollTimeout)}initIntersectionObserver(){this.observer=new IntersectionObserver((e=>{e.forEach((e=>{this.sectionVisibility.set(e.target.id,e.isIntersecting)})),this.isScrollingByTab||this.updateActiveSection()}),{root:null,rootMargin:"-90px 0px -10% 0px",threshold:0}),this.el.querySelectorAll(".menu-section").forEach((e=>this.observer.observe(e)))}render(){var e;const t=function(e,t){if(e&&"object"==typeof e&&!Array.isArray(e))return e;if(t&&"string"==typeof t&&"{}"!==t)try{return JSON.parse(t)}catch(e){console.warn("Error parsing menu dataJson:",e)}return null}(this.data,this.dataJson);if(!t)return s("div",{class:"menu-loading"},"Loading...");const{business:i,sections:o,templateData:n}=t,a=null==n?void 0:n.theme,r=(null==a?void 0:a.primaryColor)||"#18181b",l=[...o||[]].sort(((e,t)=>e.order-t.order));return s("div",{class:"menu-wrapper"},s("header",{class:"menu-header"},(null==i?void 0:i.name)&&s("h1",{class:"business-name"},i.name),(null==i?void 0:i.description)&&s("p",{class:"business-description"},i.description)),s("veleta-menu-tabs",{sections:l.map((e=>({id:e.id,title:e.title}))),activeSectionId:this.activeSectionId||(null===(e=l[0])||void 0===e?void 0:e.id),onTabClick:e=>this.handleTabClick(e.detail)}),s("main",{class:"menu-content"},l.map((e=>{var t;return s("section",{key:e.id,id:"section-"+e.id,class:"menu-section"},s("h2",{class:"section-title",style:{borderColor:r}},e.title),e.description&&s("p",{class:"section-description"},e.description),s("div",{class:"dishes-list"},null===(t=e.dishes)||void 0===t?void 0:t.sort(((e,t)=>e.order-t.order)).map((e=>s("div",{key:e.id,class:"dish-item "+(this.expandedDishes[e.id]?"expanded":""),onClick:()=>this.toggleDish(e.id)},s("div",{class:"dish-header"},s("span",{class:"dish-name"},e.name),s("span",{class:"dish-price"},function(e){return(e%1==0?""+e:e.toFixed(2))+"€"}(e.price))),e.description&&s("div",{class:"dish-details"},s("p",{class:"dish-description"},e.description)))))))}))))}get el(){return this}static get style(){return'@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); .menu-tabs-container{position:-webkit-sticky;position:sticky;top:0;z-index:100;background-color:white;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:0;margin-bottom:24px}.menu-tabs-scroll{display:-ms-flexbox;display:flex;gap:12px;overflow-x:auto;padding:0 20px;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}.menu-tabs-scroll::after{content:"";padding-right:20px}.menu-tabs-scroll::-webkit-scrollbar{display:none}.menu-tab-item{white-space:nowrap;padding:1rem;border:none;-webkit-box-shadow:inset 0 -2px 0 0 transparent;box-shadow:inset 0 -2px 0 0 transparent;background-color:transparent;color:#71717a;font-size:1rem;font-weight:500;cursor:pointer;-webkit-transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease, -webkit-box-shadow 0.3s ease;font-family:inherit;-ms-flex-negative:0;flex-shrink:0;outline:none}.menu-tab-item:hover{color:#18181b}.menu-tab-item.active{color:#18181b;-webkit-box-shadow:inset 0 -2px 0 0 #18181b;box-shadow:inset 0 -2px 0 0 #18181b}.menu-tabs-container::after{content:"";position:absolute;right:0;top:0;bottom:0;width:40px;background:-webkit-gradient(linear, left top, right top, from(transparent), to(rgba(255, 255, 255, 0.8)));background:linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));pointer-events:none;opacity:0;}.menu-wrapper{font-family:"Poppins", sans-serif;max-width:800px;margin:0 auto;padding:20px 0;background-color:#ffffff;min-height:100vh}.menu-header{text-align:center;margin-bottom:24px;padding:0 20px;}.business-name{font-size:2.5rem;font-weight:700;margin-bottom:8px;letter-spacing:-0.02em}.business-description{font-size:1.1rem;color:#71717a;margin:0 auto;padding-left:1px;padding-right:1px;line-height:1.5rem}.menu-section{margin-bottom:48px}.section-title{font-size:1.3rem;font-weight:600;padding-bottom:8px;margin-bottom:1rem}.section-description{font-size:1rem;color:#71717a;margin-bottom:20px;margin-top:-16px;line-height:1.25rem}.dishes-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}.dish-item{padding:1rem 0.2rem;border-bottom:1px solid #e4e4e7;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}.dish-item:hover{border-color:#e4e4e7}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;gap:12px}.dish-name{font-weight:500;font-size:1rem;color:#18181b}.dish-price{font-weight:400;font-size:0.9rem;color:#18181b}.dish-details{max-height:1.35rem;overflow:hidden;margin-top:4px;opacity:1;-webkit-transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1)}.dish-item.expanded .dish-details{max-height:400px;margin-top:4px}.dish-description{font-size:0.9rem;color:#71717a;line-height:1.5;margin:0;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.dish-item.expanded .dish-description{-webkit-line-clamp:10}.menu-content{padding:0.1rem 20px}.menu-footer{margin-top:80px;text-align:center;padding:0 20px}.social-link{display:inline-block;padding:12px 24px;border-radius:99px;color:white;text-decoration:none;font-weight:500;-webkit-transition:opacity 0.2s;transition:opacity 0.2s}.social-link:hover{opacity:0.9}.menu-loading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:200px;color:#71717a}'}},[0,"veleta-default-template",{data:[16],dataJson:[1,"data-json"],expandedDishes:[32],activeSectionId:[32]}]);function a(){"undefined"!=typeof customElements&&["veleta-default-template","veleta-menu-tabs"].forEach((t=>{switch(t){case"veleta-default-template":customElements.get(e(t))||customElements.define(e(t),n);break;case"veleta-menu-tabs":customElements.get(e(t))||o()}}))}a();const r=n,l=a;export{r as VeletaDefaultTemplate,l as defineCustomElement}
1
+ import{t as e,p as t,H as i,h as s}from"./index.js";import{d as o}from"./p-Bn5G3Oo7.js";const n=t(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.expandedDishes={},this.activeSectionId="",this.sectionVisibility=new Map,this.isScrollingByTab=!1,this.toggleDish=e=>{this.expandedDishes=Object.assign(Object.assign({},this.expandedDishes),{[e]:!this.expandedDishes[e]})},this.handleTabClick=e=>{const t=this.el.querySelector("#section-"+e);if(t){this.isScrollingByTab=!0,this.activeSectionId=e;const i=95,s=t.getBoundingClientRect().top+window.pageYOffset-i;window.scrollTo({top:s,behavior:"smooth"})}},this.handleScroll=()=>{if(this.isScrollingByTab)return clearTimeout(this.scrollTimeout),void(this.scrollTimeout=setTimeout((()=>{this.isScrollingByTab=!1,this.updateActiveSection()}),150));this.updateActiveSection()},this.updateActiveSection=()=>{if(this.isScrollingByTab)return;const e=Array.from(this.el.querySelectorAll(".menu-section"));if(0===e.length)return;const t=window.innerHeight+window.pageYOffset>=document.documentElement.scrollHeight-10;let i=this.activeSectionId;if(t){for(let t=e.length-1;t>=0;t--)if(this.sectionVisibility.get(e[t].id)){i=e[t].id.replace("section-","");break}}else for(const t of e)if(this.sectionVisibility.get(t.id)){i=t.id.replace("section-","");break}i!==this.activeSectionId&&(this.activeSectionId=i)},this.dataJson="{}"}componentDidLoad(){this.initIntersectionObserver(),window.addEventListener("scroll",this.handleScroll)}disconnectedCallback(){this.observer&&this.observer.disconnect(),window.removeEventListener("scroll",this.handleScroll),clearTimeout(this.scrollTimeout)}initIntersectionObserver(){this.observer=new IntersectionObserver((e=>{e.forEach((e=>{this.sectionVisibility.set(e.target.id,e.isIntersecting)})),this.isScrollingByTab||this.updateActiveSection()}),{root:null,rootMargin:"-90px 0px -10% 0px",threshold:0}),this.el.querySelectorAll(".menu-section").forEach((e=>this.observer.observe(e)))}render(){var e;const t=function(e,t){if(e&&"object"==typeof e&&!Array.isArray(e))return e;if(t&&"string"==typeof t&&"{}"!==t)try{return JSON.parse(t)}catch(e){console.warn("Error parsing menu dataJson:",e)}return null}(this.data,this.dataJson);if(!t)return s("div",{class:"menu-loading"},"Loading...");const{sections:i,templateData:o,menu:n}=t,a=null==o?void 0:o.theme,r=(null==a?void 0:a.primaryColor)||"#18181b",l=[...i||[]].sort(((e,t)=>e.order-t.order));return s("div",{class:"menu-wrapper"},s("header",{class:"menu-header"},(null==n?void 0:n.name)&&s("h1",{class:"business-name"},n.name),(null==n?void 0:n.description)&&s("p",{class:"business-description"},n.description)),s("veleta-menu-tabs",{sections:l.map((e=>({id:e.id,title:e.title}))),activeSectionId:this.activeSectionId||(null===(e=l[0])||void 0===e?void 0:e.id),onTabClick:e=>this.handleTabClick(e.detail)}),s("main",{class:"menu-content"},l.map((e=>{var t;return s("section",{key:e.id,id:"section-"+e.id,class:"menu-section"},s("h2",{class:"section-title",style:{borderColor:r}},e.title),e.description&&s("p",{class:"section-description"},e.description),s("div",{class:"dishes-list"},null===(t=e.dishes)||void 0===t?void 0:t.sort(((e,t)=>e.order-t.order)).map((e=>s("div",{key:e.id,class:"dish-item "+(this.expandedDishes[e.id]?"expanded":""),onClick:()=>this.toggleDish(e.id)},s("div",{class:"dish-header"},s("span",{class:"dish-name"},e.name),s("span",{class:"dish-price"},function(e){return(e%1==0?""+e:e.toFixed(2))+"€"}(e.price))),e.description&&s("div",{class:"dish-details"},s("p",{class:"dish-description"},e.description)))))))}))))}get el(){return this}static get style(){return'@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); .menu-tabs-container{position:-webkit-sticky;position:sticky;top:0;z-index:100;background-color:white;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:0;margin-bottom:24px}.menu-tabs-scroll{display:-ms-flexbox;display:flex;gap:12px;overflow-x:auto;padding:0 20px;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}.menu-tabs-scroll::after{content:"";padding-right:20px}.menu-tabs-scroll::-webkit-scrollbar{display:none}.menu-tab-item{white-space:nowrap;padding:1rem;border:none;-webkit-box-shadow:inset 0 -2px 0 0 transparent;box-shadow:inset 0 -2px 0 0 transparent;background-color:transparent;color:#71717a;font-size:1rem;font-weight:500;cursor:pointer;-webkit-transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease, -webkit-box-shadow 0.3s ease;font-family:inherit;-ms-flex-negative:0;flex-shrink:0;outline:none}.menu-tab-item:hover{color:#18181b}.menu-tab-item.active{color:#18181b;-webkit-box-shadow:inset 0 -2px 0 0 #18181b;box-shadow:inset 0 -2px 0 0 #18181b}.menu-tabs-container::after{content:"";position:absolute;right:0;top:0;bottom:0;width:40px;background:-webkit-gradient(linear, left top, right top, from(transparent), to(rgba(255, 255, 255, 0.8)));background:linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));pointer-events:none;opacity:0;}.menu-wrapper{font-family:"Poppins", sans-serif;max-width:800px;margin:0 auto;padding:20px 0;background-color:#ffffff;min-height:100vh}.menu-header{text-align:center;margin-bottom:24px;padding:0 20px;}.business-name{font-size:2.5rem;font-weight:700;margin-bottom:8px;letter-spacing:-0.02em}.business-description{font-size:1.1rem;color:#71717a;margin:0 auto;padding-left:1px;padding-right:1px;line-height:1.5rem}.menu-section{margin-bottom:48px}.section-title{font-size:1.3rem;font-weight:600;padding-bottom:8px;margin-bottom:1rem}.section-description{font-size:1rem;color:#71717a;margin-bottom:20px;margin-top:-16px;line-height:1.25rem}.dishes-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}.dish-item{padding:1rem 0.2rem;border-bottom:1px solid #e4e4e7;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}.dish-item:hover{border-color:#e4e4e7}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;gap:12px}.dish-name{font-weight:500;font-size:1rem;color:#18181b}.dish-price{font-weight:400;font-size:0.9rem;color:#18181b}.dish-details{max-height:1.35rem;overflow:hidden;margin-top:4px;opacity:1;-webkit-transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1)}.dish-item.expanded .dish-details{max-height:400px;margin-top:4px}.dish-description{font-size:0.9rem;color:#71717a;line-height:1.5;margin:0;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.dish-item.expanded .dish-description{-webkit-line-clamp:10}.menu-content{padding:0.1rem 20px}.menu-footer{margin-top:80px;text-align:center;padding:0 20px}.social-link{display:inline-block;padding:12px 24px;border-radius:99px;color:white;text-decoration:none;font-weight:500;-webkit-transition:opacity 0.2s;transition:opacity 0.2s}.social-link:hover{opacity:0.9}.menu-loading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:200px;color:#71717a}'}},[0,"veleta-default-template",{data:[16],dataJson:[1,"data-json"],expandedDishes:[32],activeSectionId:[32]}]);function a(){"undefined"!=typeof customElements&&["veleta-default-template","veleta-menu-tabs"].forEach((t=>{switch(t){case"veleta-default-template":customElements.get(e(t))||customElements.define(e(t),n);break;case"veleta-menu-tabs":customElements.get(e(t))||o()}}))}a();const r=n,l=a;export{r as VeletaDefaultTemplate,l as defineCustomElement}
@@ -137,11 +137,11 @@ const DefaultTemplate = class {
137
137
  if (!menuData) {
138
138
  return h("div", { class: "menu-loading" }, "Loading...");
139
139
  }
140
- const { business, sections, templateData } = menuData;
140
+ const { sections, templateData, menu } = menuData;
141
141
  const theme = templateData === null || templateData === void 0 ? void 0 : templateData.theme;
142
142
  const primaryColor = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#18181b';
143
143
  const sortedSections = [...(sections || [])].sort((a, b) => a.order - b.order);
144
- return (h("div", { class: "menu-wrapper" }, h("header", { class: "menu-header" }, (business === null || business === void 0 ? void 0 : business.name) && h("h1", { class: "business-name" }, business.name), (business === null || business === void 0 ? void 0 : business.description) && (h("p", { class: "business-description" }, business.description))), h("veleta-menu-tabs", { sections: sortedSections.map((s) => ({ id: s.id, title: s.title })), activeSectionId: this.activeSectionId || ((_a = sortedSections[0]) === null || _a === void 0 ? void 0 : _a.id), onTabClick: (ev) => this.handleTabClick(ev.detail) }), h("main", { class: "menu-content" }, sortedSections.map((section) => {
144
+ return (h("div", { class: "menu-wrapper" }, h("header", { class: "menu-header" }, (menu === null || menu === void 0 ? void 0 : menu.name) && h("h1", { class: "business-name" }, menu.name), (menu === null || menu === void 0 ? void 0 : menu.description) && (h("p", { class: "business-description" }, menu.description))), h("veleta-menu-tabs", { sections: sortedSections.map((s) => ({ id: s.id, title: s.title })), activeSectionId: this.activeSectionId || ((_a = sortedSections[0]) === null || _a === void 0 ? void 0 : _a.id), onTabClick: (ev) => this.handleTabClick(ev.detail) }), h("main", { class: "menu-content" }, sortedSections.map((section) => {
145
145
  var _a;
146
146
  return (h("section", { key: section.id, id: `section-${section.id}`, class: "menu-section" }, h("h2", { class: "section-title", style: { borderColor: primaryColor } }, section.title), section.description && (h("p", { class: "section-description" }, section.description)), h("div", { class: "dishes-list" }, (_a = section.dishes) === null || _a === void 0 ? void 0 : _a.sort((a, b) => a.order - b.order).map((dish) => (h("div", { key: dish.id, class: `dish-item ${this.expandedDishes[dish.id] ? 'expanded' : ''}`, onClick: () => this.toggleDish(dish.id) }, h("div", { class: "dish-header" }, h("span", { class: "dish-name" }, dish.name), h("span", { class: "dish-price" }, formatPrice(dish.price))), dish.description && (h("div", { class: "dish-details" }, h("p", { class: "dish-description" }, dish.description)))))))));
147
147
  }))));
@@ -1 +1 @@
1
- var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||arguments.length===2)for(var n=0,o=i.length,r;n<o;n++){if(r||!(n in i)){if(!r)r=Array.prototype.slice.call(i,0,n);r[n]=i[n]}}return e.concat(r||Array.prototype.slice.call(i))};import{r as registerInstance,h,g as getElement}from"./index-fw0ZKjNE.js";function parseMenu(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){return e}if(i&&typeof i==="string"&&i!=="{}"){try{return JSON.parse(i)}catch(e){console.warn("Error parsing menu dataJson:",e)}}return null}function formatPrice(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var defaultTemplateCss=function(){return'@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); .menu-tabs-container{position:-webkit-sticky;position:sticky;top:0;z-index:100;background-color:white;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:0;margin-bottom:24px}.menu-tabs-scroll{display:-ms-flexbox;display:flex;gap:12px;overflow-x:auto;padding:0 20px;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}.menu-tabs-scroll::after{content:"";padding-right:20px}.menu-tabs-scroll::-webkit-scrollbar{display:none}.menu-tab-item{white-space:nowrap;padding:1rem;border:none;-webkit-box-shadow:inset 0 -2px 0 0 transparent;box-shadow:inset 0 -2px 0 0 transparent;background-color:transparent;color:#71717a;font-size:1rem;font-weight:500;cursor:pointer;-webkit-transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease, -webkit-box-shadow 0.3s ease;font-family:inherit;-ms-flex-negative:0;flex-shrink:0;outline:none}.menu-tab-item:hover{color:#18181b}.menu-tab-item.active{color:#18181b;-webkit-box-shadow:inset 0 -2px 0 0 #18181b;box-shadow:inset 0 -2px 0 0 #18181b}.menu-tabs-container::after{content:"";position:absolute;right:0;top:0;bottom:0;width:40px;background:-webkit-gradient(linear, left top, right top, from(transparent), to(rgba(255, 255, 255, 0.8)));background:linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));pointer-events:none;opacity:0;}.menu-wrapper{font-family:"Poppins", sans-serif;max-width:800px;margin:0 auto;padding:20px 0;background-color:#ffffff;min-height:100vh}.menu-header{text-align:center;margin-bottom:24px;padding:0 20px;}.business-name{font-size:2.5rem;font-weight:700;margin-bottom:8px;letter-spacing:-0.02em}.business-description{font-size:1.1rem;color:#71717a;margin:0 auto;padding-left:1px;padding-right:1px;line-height:1.5rem}.menu-section{margin-bottom:48px}.section-title{font-size:1.3rem;font-weight:600;padding-bottom:8px;margin-bottom:1rem}.section-description{font-size:1rem;color:#71717a;margin-bottom:20px;margin-top:-16px;line-height:1.25rem}.dishes-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}.dish-item{padding:1rem 0.2rem;border-bottom:1px solid #e4e4e7;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}.dish-item:hover{border-color:#e4e4e7}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;gap:12px}.dish-name{font-weight:500;font-size:1rem;color:#18181b}.dish-price{font-weight:400;font-size:0.9rem;color:#18181b}.dish-details{max-height:1.35rem;overflow:hidden;margin-top:4px;opacity:1;-webkit-transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1)}.dish-item.expanded .dish-details{max-height:400px;margin-top:4px}.dish-description{font-size:0.9rem;color:#71717a;line-height:1.5;margin:0;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.dish-item.expanded .dish-description{-webkit-line-clamp:10}.menu-content{padding:0.1rem 20px}.menu-footer{margin-top:80px;text-align:center;padding:0 20px}.social-link{display:inline-block;padding:12px 24px;border-radius:99px;color:white;text-decoration:none;font-weight:500;-webkit-transition:opacity 0.2s;transition:opacity 0.2s}.social-link:hover{opacity:0.9}.menu-loading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:200px;color:#71717a}'};var DefaultTemplate=function(){function e(e){var i=this;registerInstance(this,e);this.expandedDishes={};this.activeSectionId="";this.sectionVisibility=new Map;this.isScrollingByTab=false;this.toggleDish=function(e){var t;i.expandedDishes=Object.assign(Object.assign({},i.expandedDishes),(t={},t[e]=!i.expandedDishes[e],t))};this.handleTabClick=function(e){var t=i.el.querySelector("#section-".concat(e));if(t){i.isScrollingByTab=true;i.activeSectionId=e;var n=95;var o=t.getBoundingClientRect().top;var r=o+window.pageYOffset-n;window.scrollTo({top:r,behavior:"smooth"})}};this.handleScroll=function(){if(i.isScrollingByTab){clearTimeout(i.scrollTimeout);i.scrollTimeout=setTimeout((function(){i.isScrollingByTab=false;i.updateActiveSection()}),150);return}i.updateActiveSection()};this.updateActiveSection=function(){if(i.isScrollingByTab)return;var e=Array.from(i.el.querySelectorAll(".menu-section"));if(e.length===0)return;var t=window.innerHeight+window.pageYOffset>=document.documentElement.scrollHeight-10;var n=i.activeSectionId;if(t){for(var o=e.length-1;o>=0;o--){if(i.sectionVisibility.get(e[o].id)){n=e[o].id.replace("section-","");break}}}else{for(var r=0,s=e;r<s.length;r++){var a=s[r];if(i.sectionVisibility.get(a.id)){n=a.id.replace("section-","");break}}}if(n!==i.activeSectionId){i.activeSectionId=n}};this.dataJson="{}"}e.prototype.componentDidLoad=function(){this.initIntersectionObserver();window.addEventListener("scroll",this.handleScroll)};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}window.removeEventListener("scroll",this.handleScroll);clearTimeout(this.scrollTimeout)};e.prototype.initIntersectionObserver=function(){var e=this;var i={root:null,rootMargin:"-90px 0px -10% 0px",threshold:0};this.observer=new IntersectionObserver((function(i){i.forEach((function(i){e.sectionVisibility.set(i.target.id,i.isIntersecting)}));if(!e.isScrollingByTab){e.updateActiveSection()}}),i);var t=this.el.querySelectorAll(".menu-section");t.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e=this;var i;var t=parseMenu(this.data,this.dataJson);if(!t){return h("div",{class:"menu-loading"},"Loading...")}var n=t.business,o=t.sections,r=t.templateData;var s=r===null||r===void 0?void 0:r.theme;var a=(s===null||s===void 0?void 0:s.primaryColor)||"#18181b";var l=__spreadArray([],o||[],true).sort((function(e,i){return e.order-i.order}));return h("div",{class:"menu-wrapper"},h("header",{class:"menu-header"},(n===null||n===void 0?void 0:n.name)&&h("h1",{class:"business-name"},n.name),(n===null||n===void 0?void 0:n.description)&&h("p",{class:"business-description"},n.description)),h("veleta-menu-tabs",{sections:l.map((function(e){return{id:e.id,title:e.title}})),activeSectionId:this.activeSectionId||((i=l[0])===null||i===void 0?void 0:i.id),onTabClick:function(i){return e.handleTabClick(i.detail)}}),h("main",{class:"menu-content"},l.map((function(i){var t;return h("section",{key:i.id,id:"section-".concat(i.id),class:"menu-section"},h("h2",{class:"section-title",style:{borderColor:a}},i.title),i.description&&h("p",{class:"section-description"},i.description),h("div",{class:"dishes-list"},(t=i.dishes)===null||t===void 0?void 0:t.sort((function(e,i){return e.order-i.order})).map((function(i){return h("div",{key:i.id,class:"dish-item ".concat(e.expandedDishes[i.id]?"expanded":""),onClick:function(){return e.toggleDish(i.id)}},h("div",{class:"dish-header"},h("span",{class:"dish-name"},i.name),h("span",{class:"dish-price"},formatPrice(i.price))),i.description&&h("div",{class:"dish-details"},h("p",{class:"dish-description"},i.description)))}))))}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DefaultTemplate.style=defaultTemplateCss();export{DefaultTemplate as veleta_default_template};
1
+ var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||arguments.length===2)for(var n=0,o=i.length,r;n<o;n++){if(r||!(n in i)){if(!r)r=Array.prototype.slice.call(i,0,n);r[n]=i[n]}}return e.concat(r||Array.prototype.slice.call(i))};import{r as registerInstance,h,g as getElement}from"./index-fw0ZKjNE.js";function parseMenu(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){return e}if(i&&typeof i==="string"&&i!=="{}"){try{return JSON.parse(i)}catch(e){console.warn("Error parsing menu dataJson:",e)}}return null}function formatPrice(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var defaultTemplateCss=function(){return'@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); .menu-tabs-container{position:-webkit-sticky;position:sticky;top:0;z-index:100;background-color:white;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:0;margin-bottom:24px}.menu-tabs-scroll{display:-ms-flexbox;display:flex;gap:12px;overflow-x:auto;padding:0 20px;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}.menu-tabs-scroll::after{content:"";padding-right:20px}.menu-tabs-scroll::-webkit-scrollbar{display:none}.menu-tab-item{white-space:nowrap;padding:1rem;border:none;-webkit-box-shadow:inset 0 -2px 0 0 transparent;box-shadow:inset 0 -2px 0 0 transparent;background-color:transparent;color:#71717a;font-size:1rem;font-weight:500;cursor:pointer;-webkit-transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease, -webkit-box-shadow 0.3s ease;font-family:inherit;-ms-flex-negative:0;flex-shrink:0;outline:none}.menu-tab-item:hover{color:#18181b}.menu-tab-item.active{color:#18181b;-webkit-box-shadow:inset 0 -2px 0 0 #18181b;box-shadow:inset 0 -2px 0 0 #18181b}.menu-tabs-container::after{content:"";position:absolute;right:0;top:0;bottom:0;width:40px;background:-webkit-gradient(linear, left top, right top, from(transparent), to(rgba(255, 255, 255, 0.8)));background:linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));pointer-events:none;opacity:0;}.menu-wrapper{font-family:"Poppins", sans-serif;max-width:800px;margin:0 auto;padding:20px 0;background-color:#ffffff;min-height:100vh}.menu-header{text-align:center;margin-bottom:24px;padding:0 20px;}.business-name{font-size:2.5rem;font-weight:700;margin-bottom:8px;letter-spacing:-0.02em}.business-description{font-size:1.1rem;color:#71717a;margin:0 auto;padding-left:1px;padding-right:1px;line-height:1.5rem}.menu-section{margin-bottom:48px}.section-title{font-size:1.3rem;font-weight:600;padding-bottom:8px;margin-bottom:1rem}.section-description{font-size:1rem;color:#71717a;margin-bottom:20px;margin-top:-16px;line-height:1.25rem}.dishes-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}.dish-item{padding:1rem 0.2rem;border-bottom:1px solid #e4e4e7;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}.dish-item:hover{border-color:#e4e4e7}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;gap:12px}.dish-name{font-weight:500;font-size:1rem;color:#18181b}.dish-price{font-weight:400;font-size:0.9rem;color:#18181b}.dish-details{max-height:1.35rem;overflow:hidden;margin-top:4px;opacity:1;-webkit-transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1)}.dish-item.expanded .dish-details{max-height:400px;margin-top:4px}.dish-description{font-size:0.9rem;color:#71717a;line-height:1.5;margin:0;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.dish-item.expanded .dish-description{-webkit-line-clamp:10}.menu-content{padding:0.1rem 20px}.menu-footer{margin-top:80px;text-align:center;padding:0 20px}.social-link{display:inline-block;padding:12px 24px;border-radius:99px;color:white;text-decoration:none;font-weight:500;-webkit-transition:opacity 0.2s;transition:opacity 0.2s}.social-link:hover{opacity:0.9}.menu-loading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:200px;color:#71717a}'};var DefaultTemplate=function(){function e(e){var i=this;registerInstance(this,e);this.expandedDishes={};this.activeSectionId="";this.sectionVisibility=new Map;this.isScrollingByTab=false;this.toggleDish=function(e){var t;i.expandedDishes=Object.assign(Object.assign({},i.expandedDishes),(t={},t[e]=!i.expandedDishes[e],t))};this.handleTabClick=function(e){var t=i.el.querySelector("#section-".concat(e));if(t){i.isScrollingByTab=true;i.activeSectionId=e;var n=95;var o=t.getBoundingClientRect().top;var r=o+window.pageYOffset-n;window.scrollTo({top:r,behavior:"smooth"})}};this.handleScroll=function(){if(i.isScrollingByTab){clearTimeout(i.scrollTimeout);i.scrollTimeout=setTimeout((function(){i.isScrollingByTab=false;i.updateActiveSection()}),150);return}i.updateActiveSection()};this.updateActiveSection=function(){if(i.isScrollingByTab)return;var e=Array.from(i.el.querySelectorAll(".menu-section"));if(e.length===0)return;var t=window.innerHeight+window.pageYOffset>=document.documentElement.scrollHeight-10;var n=i.activeSectionId;if(t){for(var o=e.length-1;o>=0;o--){if(i.sectionVisibility.get(e[o].id)){n=e[o].id.replace("section-","");break}}}else{for(var r=0,s=e;r<s.length;r++){var a=s[r];if(i.sectionVisibility.get(a.id)){n=a.id.replace("section-","");break}}}if(n!==i.activeSectionId){i.activeSectionId=n}};this.dataJson="{}"}e.prototype.componentDidLoad=function(){this.initIntersectionObserver();window.addEventListener("scroll",this.handleScroll)};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}window.removeEventListener("scroll",this.handleScroll);clearTimeout(this.scrollTimeout)};e.prototype.initIntersectionObserver=function(){var e=this;var i={root:null,rootMargin:"-90px 0px -10% 0px",threshold:0};this.observer=new IntersectionObserver((function(i){i.forEach((function(i){e.sectionVisibility.set(i.target.id,i.isIntersecting)}));if(!e.isScrollingByTab){e.updateActiveSection()}}),i);var t=this.el.querySelectorAll(".menu-section");t.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e=this;var i;var t=parseMenu(this.data,this.dataJson);if(!t){return h("div",{class:"menu-loading"},"Loading...")}var n=t.sections,o=t.templateData,r=t.menu;var s=o===null||o===void 0?void 0:o.theme;var a=(s===null||s===void 0?void 0:s.primaryColor)||"#18181b";var l=__spreadArray([],n||[],true).sort((function(e,i){return e.order-i.order}));return h("div",{class:"menu-wrapper"},h("header",{class:"menu-header"},(r===null||r===void 0?void 0:r.name)&&h("h1",{class:"business-name"},r.name),(r===null||r===void 0?void 0:r.description)&&h("p",{class:"business-description"},r.description)),h("veleta-menu-tabs",{sections:l.map((function(e){return{id:e.id,title:e.title}})),activeSectionId:this.activeSectionId||((i=l[0])===null||i===void 0?void 0:i.id),onTabClick:function(i){return e.handleTabClick(i.detail)}}),h("main",{class:"menu-content"},l.map((function(i){var t;return h("section",{key:i.id,id:"section-".concat(i.id),class:"menu-section"},h("h2",{class:"section-title",style:{borderColor:a}},i.title),i.description&&h("p",{class:"section-description"},i.description),h("div",{class:"dishes-list"},(t=i.dishes)===null||t===void 0?void 0:t.sort((function(e,i){return e.order-i.order})).map((function(i){return h("div",{key:i.id,class:"dish-item ".concat(e.expandedDishes[i.id]?"expanded":""),onClick:function(){return e.toggleDish(i.id)}},h("div",{class:"dish-header"},h("span",{class:"dish-name"},i.name),h("span",{class:"dish-price"},formatPrice(i.price))),i.description&&h("div",{class:"dish-details"},h("p",{class:"dish-description"},i.description)))}))))}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();DefaultTemplate.style=defaultTemplateCss();export{DefaultTemplate as veleta_default_template};
@@ -25,6 +25,7 @@ export interface MenuInfo {
25
25
  name: string;
26
26
  slug: string;
27
27
  active: boolean;
28
+ description?: string;
28
29
  }
29
30
  export interface BusinessInfo {
30
31
  name: string;
@@ -1 +1 @@
1
- var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||arguments.length===2)for(var n=0,o=i.length,r;n<o;n++){if(r||!(n in i)){if(!r)r=Array.prototype.slice.call(i,0,n);r[n]=i[n]}}return e.concat(r||Array.prototype.slice.call(i))};System.register(["./p-BPEIAwuB.system.js"],(function(e){"use strict";var i,t,n;return{setters:[function(e){i=e.r;t=e.h;n=e.g}],execute:function(){function o(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){return e}if(i&&typeof i==="string"&&i!=="{}"){try{return JSON.parse(i)}catch(e){console.warn("Error parsing menu dataJson:",e)}}return null}function r(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var s=function(){return'@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); .menu-tabs-container{position:-webkit-sticky;position:sticky;top:0;z-index:100;background-color:white;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:0;margin-bottom:24px}.menu-tabs-scroll{display:-ms-flexbox;display:flex;gap:12px;overflow-x:auto;padding:0 20px;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}.menu-tabs-scroll::after{content:"";padding-right:20px}.menu-tabs-scroll::-webkit-scrollbar{display:none}.menu-tab-item{white-space:nowrap;padding:1rem;border:none;-webkit-box-shadow:inset 0 -2px 0 0 transparent;box-shadow:inset 0 -2px 0 0 transparent;background-color:transparent;color:#71717a;font-size:1rem;font-weight:500;cursor:pointer;-webkit-transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease, -webkit-box-shadow 0.3s ease;font-family:inherit;-ms-flex-negative:0;flex-shrink:0;outline:none}.menu-tab-item:hover{color:#18181b}.menu-tab-item.active{color:#18181b;-webkit-box-shadow:inset 0 -2px 0 0 #18181b;box-shadow:inset 0 -2px 0 0 #18181b}.menu-tabs-container::after{content:"";position:absolute;right:0;top:0;bottom:0;width:40px;background:-webkit-gradient(linear, left top, right top, from(transparent), to(rgba(255, 255, 255, 0.8)));background:linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));pointer-events:none;opacity:0;}.menu-wrapper{font-family:"Poppins", sans-serif;max-width:800px;margin:0 auto;padding:20px 0;background-color:#ffffff;min-height:100vh}.menu-header{text-align:center;margin-bottom:24px;padding:0 20px;}.business-name{font-size:2.5rem;font-weight:700;margin-bottom:8px;letter-spacing:-0.02em}.business-description{font-size:1.1rem;color:#71717a;margin:0 auto;padding-left:1px;padding-right:1px;line-height:1.5rem}.menu-section{margin-bottom:48px}.section-title{font-size:1.3rem;font-weight:600;padding-bottom:8px;margin-bottom:1rem}.section-description{font-size:1rem;color:#71717a;margin-bottom:20px;margin-top:-16px;line-height:1.25rem}.dishes-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}.dish-item{padding:1rem 0.2rem;border-bottom:1px solid #e4e4e7;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}.dish-item:hover{border-color:#e4e4e7}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;gap:12px}.dish-name{font-weight:500;font-size:1rem;color:#18181b}.dish-price{font-weight:400;font-size:0.9rem;color:#18181b}.dish-details{max-height:1.35rem;overflow:hidden;margin-top:4px;opacity:1;-webkit-transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1)}.dish-item.expanded .dish-details{max-height:400px;margin-top:4px}.dish-description{font-size:0.9rem;color:#71717a;line-height:1.5;margin:0;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.dish-item.expanded .dish-description{-webkit-line-clamp:10}.menu-content{padding:0.1rem 20px}.menu-footer{margin-top:80px;text-align:center;padding:0 20px}.social-link{display:inline-block;padding:12px 24px;border-radius:99px;color:white;text-decoration:none;font-weight:500;-webkit-transition:opacity 0.2s;transition:opacity 0.2s}.social-link:hover{opacity:0.9}.menu-loading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:200px;color:#71717a}'};var a=e("veleta_default_template",function(){function e(e){var t=this;i(this,e);this.expandedDishes={};this.activeSectionId="";this.sectionVisibility=new Map;this.isScrollingByTab=false;this.toggleDish=function(e){var i;t.expandedDishes=Object.assign(Object.assign({},t.expandedDishes),(i={},i[e]=!t.expandedDishes[e],i))};this.handleTabClick=function(e){var i=t.el.querySelector("#section-".concat(e));if(i){t.isScrollingByTab=true;t.activeSectionId=e;var n=95;var o=i.getBoundingClientRect().top;var r=o+window.pageYOffset-n;window.scrollTo({top:r,behavior:"smooth"})}};this.handleScroll=function(){if(t.isScrollingByTab){clearTimeout(t.scrollTimeout);t.scrollTimeout=setTimeout((function(){t.isScrollingByTab=false;t.updateActiveSection()}),150);return}t.updateActiveSection()};this.updateActiveSection=function(){if(t.isScrollingByTab)return;var e=Array.from(t.el.querySelectorAll(".menu-section"));if(e.length===0)return;var i=window.innerHeight+window.pageYOffset>=document.documentElement.scrollHeight-10;var n=t.activeSectionId;if(i){for(var o=e.length-1;o>=0;o--){if(t.sectionVisibility.get(e[o].id)){n=e[o].id.replace("section-","");break}}}else{for(var r=0,s=e;r<s.length;r++){var a=s[r];if(t.sectionVisibility.get(a.id)){n=a.id.replace("section-","");break}}}if(n!==t.activeSectionId){t.activeSectionId=n}};this.dataJson="{}"}e.prototype.componentDidLoad=function(){this.initIntersectionObserver();window.addEventListener("scroll",this.handleScroll)};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}window.removeEventListener("scroll",this.handleScroll);clearTimeout(this.scrollTimeout)};e.prototype.initIntersectionObserver=function(){var e=this;var i={root:null,rootMargin:"-90px 0px -10% 0px",threshold:0};this.observer=new IntersectionObserver((function(i){i.forEach((function(i){e.sectionVisibility.set(i.target.id,i.isIntersecting)}));if(!e.isScrollingByTab){e.updateActiveSection()}}),i);var t=this.el.querySelectorAll(".menu-section");t.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e=this;var i;var n=o(this.data,this.dataJson);if(!n){return t("div",{class:"menu-loading"},"Loading...")}var s=n.business,a=n.sections,l=n.templateData;var c=l===null||l===void 0?void 0:l.theme;var d=(c===null||c===void 0?void 0:c.primaryColor)||"#18181b";var p=__spreadArray([],a||[],true).sort((function(e,i){return e.order-i.order}));return t("div",{class:"menu-wrapper"},t("header",{class:"menu-header"},(s===null||s===void 0?void 0:s.name)&&t("h1",{class:"business-name"},s.name),(s===null||s===void 0?void 0:s.description)&&t("p",{class:"business-description"},s.description)),t("veleta-menu-tabs",{sections:p.map((function(e){return{id:e.id,title:e.title}})),activeSectionId:this.activeSectionId||((i=p[0])===null||i===void 0?void 0:i.id),onTabClick:function(i){return e.handleTabClick(i.detail)}}),t("main",{class:"menu-content"},p.map((function(i){var n;return t("section",{key:i.id,id:"section-".concat(i.id),class:"menu-section"},t("h2",{class:"section-title",style:{borderColor:d}},i.title),i.description&&t("p",{class:"section-description"},i.description),t("div",{class:"dishes-list"},(n=i.dishes)===null||n===void 0?void 0:n.sort((function(e,i){return e.order-i.order})).map((function(i){return t("div",{key:i.id,class:"dish-item ".concat(e.expandedDishes[i.id]?"expanded":""),onClick:function(){return e.toggleDish(i.id)}},t("div",{class:"dish-header"},t("span",{class:"dish-name"},i.name),t("span",{class:"dish-price"},r(i.price))),i.description&&t("div",{class:"dish-details"},t("p",{class:"dish-description"},i.description)))}))))}))))};Object.defineProperty(e.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());a.style=s()}}}));
1
+ var __spreadArray=this&&this.__spreadArray||function(e,i,t){if(t||arguments.length===2)for(var n=0,o=i.length,r;n<o;n++){if(r||!(n in i)){if(!r)r=Array.prototype.slice.call(i,0,n);r[n]=i[n]}}return e.concat(r||Array.prototype.slice.call(i))};System.register(["./p-BPEIAwuB.system.js"],(function(e){"use strict";var i,t,n;return{setters:[function(e){i=e.r;t=e.h;n=e.g}],execute:function(){function o(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){return e}if(i&&typeof i==="string"&&i!=="{}"){try{return JSON.parse(i)}catch(e){console.warn("Error parsing menu dataJson:",e)}}return null}function r(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var s=function(){return'@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); .menu-tabs-container{position:-webkit-sticky;position:sticky;top:0;z-index:100;background-color:white;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:0;margin-bottom:24px}.menu-tabs-scroll{display:-ms-flexbox;display:flex;gap:12px;overflow-x:auto;padding:0 20px;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}.menu-tabs-scroll::after{content:"";padding-right:20px}.menu-tabs-scroll::-webkit-scrollbar{display:none}.menu-tab-item{white-space:nowrap;padding:1rem;border:none;-webkit-box-shadow:inset 0 -2px 0 0 transparent;box-shadow:inset 0 -2px 0 0 transparent;background-color:transparent;color:#71717a;font-size:1rem;font-weight:500;cursor:pointer;-webkit-transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease, -webkit-box-shadow 0.3s ease;font-family:inherit;-ms-flex-negative:0;flex-shrink:0;outline:none}.menu-tab-item:hover{color:#18181b}.menu-tab-item.active{color:#18181b;-webkit-box-shadow:inset 0 -2px 0 0 #18181b;box-shadow:inset 0 -2px 0 0 #18181b}.menu-tabs-container::after{content:"";position:absolute;right:0;top:0;bottom:0;width:40px;background:-webkit-gradient(linear, left top, right top, from(transparent), to(rgba(255, 255, 255, 0.8)));background:linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));pointer-events:none;opacity:0;}.menu-wrapper{font-family:"Poppins", sans-serif;max-width:800px;margin:0 auto;padding:20px 0;background-color:#ffffff;min-height:100vh}.menu-header{text-align:center;margin-bottom:24px;padding:0 20px;}.business-name{font-size:2.5rem;font-weight:700;margin-bottom:8px;letter-spacing:-0.02em}.business-description{font-size:1.1rem;color:#71717a;margin:0 auto;padding-left:1px;padding-right:1px;line-height:1.5rem}.menu-section{margin-bottom:48px}.section-title{font-size:1.3rem;font-weight:600;padding-bottom:8px;margin-bottom:1rem}.section-description{font-size:1rem;color:#71717a;margin-bottom:20px;margin-top:-16px;line-height:1.25rem}.dishes-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}.dish-item{padding:1rem 0.2rem;border-bottom:1px solid #e4e4e7;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}.dish-item:hover{border-color:#e4e4e7}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;gap:12px}.dish-name{font-weight:500;font-size:1rem;color:#18181b}.dish-price{font-weight:400;font-size:0.9rem;color:#18181b}.dish-details{max-height:1.35rem;overflow:hidden;margin-top:4px;opacity:1;-webkit-transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1)}.dish-item.expanded .dish-details{max-height:400px;margin-top:4px}.dish-description{font-size:0.9rem;color:#71717a;line-height:1.5;margin:0;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.dish-item.expanded .dish-description{-webkit-line-clamp:10}.menu-content{padding:0.1rem 20px}.menu-footer{margin-top:80px;text-align:center;padding:0 20px}.social-link{display:inline-block;padding:12px 24px;border-radius:99px;color:white;text-decoration:none;font-weight:500;-webkit-transition:opacity 0.2s;transition:opacity 0.2s}.social-link:hover{opacity:0.9}.menu-loading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:200px;color:#71717a}'};var a=e("veleta_default_template",function(){function e(e){var t=this;i(this,e);this.expandedDishes={};this.activeSectionId="";this.sectionVisibility=new Map;this.isScrollingByTab=false;this.toggleDish=function(e){var i;t.expandedDishes=Object.assign(Object.assign({},t.expandedDishes),(i={},i[e]=!t.expandedDishes[e],i))};this.handleTabClick=function(e){var i=t.el.querySelector("#section-".concat(e));if(i){t.isScrollingByTab=true;t.activeSectionId=e;var n=95;var o=i.getBoundingClientRect().top;var r=o+window.pageYOffset-n;window.scrollTo({top:r,behavior:"smooth"})}};this.handleScroll=function(){if(t.isScrollingByTab){clearTimeout(t.scrollTimeout);t.scrollTimeout=setTimeout((function(){t.isScrollingByTab=false;t.updateActiveSection()}),150);return}t.updateActiveSection()};this.updateActiveSection=function(){if(t.isScrollingByTab)return;var e=Array.from(t.el.querySelectorAll(".menu-section"));if(e.length===0)return;var i=window.innerHeight+window.pageYOffset>=document.documentElement.scrollHeight-10;var n=t.activeSectionId;if(i){for(var o=e.length-1;o>=0;o--){if(t.sectionVisibility.get(e[o].id)){n=e[o].id.replace("section-","");break}}}else{for(var r=0,s=e;r<s.length;r++){var a=s[r];if(t.sectionVisibility.get(a.id)){n=a.id.replace("section-","");break}}}if(n!==t.activeSectionId){t.activeSectionId=n}};this.dataJson="{}"}e.prototype.componentDidLoad=function(){this.initIntersectionObserver();window.addEventListener("scroll",this.handleScroll)};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}window.removeEventListener("scroll",this.handleScroll);clearTimeout(this.scrollTimeout)};e.prototype.initIntersectionObserver=function(){var e=this;var i={root:null,rootMargin:"-90px 0px -10% 0px",threshold:0};this.observer=new IntersectionObserver((function(i){i.forEach((function(i){e.sectionVisibility.set(i.target.id,i.isIntersecting)}));if(!e.isScrollingByTab){e.updateActiveSection()}}),i);var t=this.el.querySelectorAll(".menu-section");t.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e=this;var i;var n=o(this.data,this.dataJson);if(!n){return t("div",{class:"menu-loading"},"Loading...")}var s=n.sections,a=n.templateData,l=n.menu;var c=a===null||a===void 0?void 0:a.theme;var d=(c===null||c===void 0?void 0:c.primaryColor)||"#18181b";var p=__spreadArray([],s||[],true).sort((function(e,i){return e.order-i.order}));return t("div",{class:"menu-wrapper"},t("header",{class:"menu-header"},(l===null||l===void 0?void 0:l.name)&&t("h1",{class:"business-name"},l.name),(l===null||l===void 0?void 0:l.description)&&t("p",{class:"business-description"},l.description)),t("veleta-menu-tabs",{sections:p.map((function(e){return{id:e.id,title:e.title}})),activeSectionId:this.activeSectionId||((i=p[0])===null||i===void 0?void 0:i.id),onTabClick:function(i){return e.handleTabClick(i.detail)}}),t("main",{class:"menu-content"},p.map((function(i){var n;return t("section",{key:i.id,id:"section-".concat(i.id),class:"menu-section"},t("h2",{class:"section-title",style:{borderColor:d}},i.title),i.description&&t("p",{class:"section-description"},i.description),t("div",{class:"dishes-list"},(n=i.dishes)===null||n===void 0?void 0:n.sort((function(e,i){return e.order-i.order})).map((function(i){return t("div",{key:i.id,class:"dish-item ".concat(e.expandedDishes[i.id]?"expanded":""),onClick:function(){return e.toggleDish(i.id)}},t("div",{class:"dish-header"},t("span",{class:"dish-name"},i.name),t("span",{class:"dish-price"},r(i.price))),i.description&&t("div",{class:"dish-details"},t("p",{class:"dish-description"},i.description)))}))))}))))};Object.defineProperty(e.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());a.style=s()}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,c){function a(t){try{u(i.next(t))}catch(t){c(t)}}function o(t){try{u(i["throw"](t))}catch(t){c(t)}}function u(t){t.done?n(t.value):r(t.value).then(a,o)}u((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},i,r,c,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=o(0),a["throw"]=o(1),a["return"]=o(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(t){return function(e){return u([t,e])}}function u(o){if(i)throw new TypeError("Generator is already executing.");while(a&&(a=0,o[0]&&(n=0)),n)try{if(i=1,r&&(c=o[0]&2?r["return"]:o[0]?r["throw"]||((c=r["return"])&&c.call(r),0):r.next)&&!(c=c.call(r,o[1])).done)return c;if(r=0,c)o=[o[0]&2,c.value];switch(o[0]){case 0:case 1:c=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;r=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(c=n.trys,c=c.length>0&&c[c.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!c||o[1]>c[0]&&o[1]<c[3])){n.label=o[1];break}if(o[0]===6&&n.label<c[1]){n.label=c[1];c=o;break}if(c&&n.label<c[2]){n.label=c[2];n.ops.push(o);break}if(c[2])n.ops.pop();n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t];r=0}finally{i=c=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-BPEIAwuB.system.js","./p-BbPAtVJG.system.js"],(function(t,e){"use strict";var n,i,r;return{setters:[function(e){n=e.p;i=e.b;t("setNonce",e.s)},function(t){r=t.g}],execute:function(){var t=this;var c=function(){var t=e.meta.url;var i={};if(t!==""){i.resourcesUrl=new URL(".",t).href}return n(i)};c().then((function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,r()];case 1:t.sent();return[2,i([["p-1ef4fdaa.system",[[0,"veleta-menu-tabs",{sections:[16],activeSectionId:[1,"active-section-id"]},null,{activeSectionId:[{handleActiveSectionChange:0}]}]]],["p-8bcdfedb.system",[[0,"veleta-default-template",{data:[16],dataJson:[1,"data-json"],expandedDishes:[32],activeSectionId:[32]}]]]],e)]}}))}))}))}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,a){function c(t){try{u(i.next(t))}catch(t){a(t)}}function o(t){try{u(i["throw"](t))}catch(t){a(t)}}function u(t){t.done?n(t.value):r(t.value).then(c,o)}u((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=o(0),c["throw"]=o(1),c["return"]=o(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function o(t){return function(e){return u([t,e])}}function u(o){if(i)throw new TypeError("Generator is already executing.");while(c&&(c=0,o[0]&&(n=0)),n)try{if(i=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;r=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t];r=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-BPEIAwuB.system.js","./p-BbPAtVJG.system.js"],(function(t,e){"use strict";var n,i,r;return{setters:[function(e){n=e.p;i=e.b;t("setNonce",e.s)},function(t){r=t.g}],execute:function(){var t=this;var a=function(){var t=e.meta.url;var i={};if(t!==""){i.resourcesUrl=new URL(".",t).href}return n(i)};a().then((function(e){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,r()];case 1:t.sent();return[2,i([["p-1ef4fdaa.system",[[0,"veleta-menu-tabs",{sections:[16],activeSectionId:[1,"active-section-id"]},null,{activeSectionId:[{handleActiveSectionChange:0}]}]]],["p-5e336841.system",[[0,"veleta-default-template",{data:[16],dataJson:[1,"data-json"],expandedDishes:[32],activeSectionId:[32]}]]]],e)]}}))}))}))}}}));
@@ -0,0 +1 @@
1
+ import{r as i,h as e,g as t}from"./p-fw0ZKjNE.js";const s=class{constructor(e){i(this,e),this.expandedDishes={},this.activeSectionId="",this.sectionVisibility=new Map,this.isScrollingByTab=!1,this.toggleDish=i=>{this.expandedDishes=Object.assign(Object.assign({},this.expandedDishes),{[i]:!this.expandedDishes[i]})},this.handleTabClick=i=>{const e=this.el.querySelector(`#section-${i}`);if(e){this.isScrollingByTab=!0,this.activeSectionId=i;const t=95,s=e.getBoundingClientRect().top+window.pageYOffset-t;window.scrollTo({top:s,behavior:"smooth"})}},this.handleScroll=()=>{if(this.isScrollingByTab)return clearTimeout(this.scrollTimeout),void(this.scrollTimeout=setTimeout((()=>{this.isScrollingByTab=!1,this.updateActiveSection()}),150));this.updateActiveSection()},this.updateActiveSection=()=>{if(this.isScrollingByTab)return;const i=Array.from(this.el.querySelectorAll(".menu-section"));if(0===i.length)return;const e=window.innerHeight+window.pageYOffset>=document.documentElement.scrollHeight-10;let t=this.activeSectionId;if(e){for(let e=i.length-1;e>=0;e--)if(this.sectionVisibility.get(i[e].id)){t=i[e].id.replace("section-","");break}}else for(const e of i)if(this.sectionVisibility.get(e.id)){t=e.id.replace("section-","");break}t!==this.activeSectionId&&(this.activeSectionId=t)},this.dataJson="{}"}componentDidLoad(){this.initIntersectionObserver(),window.addEventListener("scroll",this.handleScroll)}disconnectedCallback(){this.observer&&this.observer.disconnect(),window.removeEventListener("scroll",this.handleScroll),clearTimeout(this.scrollTimeout)}initIntersectionObserver(){this.observer=new IntersectionObserver((i=>{i.forEach((i=>{this.sectionVisibility.set(i.target.id,i.isIntersecting)})),this.isScrollingByTab||this.updateActiveSection()}),{root:null,rootMargin:"-90px 0px -10% 0px",threshold:0}),this.el.querySelectorAll(".menu-section").forEach((i=>this.observer.observe(i)))}render(){var i;const t=function(i,e){if(i&&"object"==typeof i&&!Array.isArray(i))return i;if(e&&"string"==typeof e&&"{}"!==e)try{return JSON.parse(e)}catch(i){console.warn("Error parsing menu dataJson:",i)}return null}(this.data,this.dataJson);if(!t)return e("div",{class:"menu-loading"},"Loading...");const{sections:s,templateData:o,menu:n}=t,a=null==o?void 0:o.theme,r=(null==a?void 0:a.primaryColor)||"#18181b",l=[...s||[]].sort(((i,e)=>i.order-e.order));return e("div",{class:"menu-wrapper"},e("header",{class:"menu-header"},(null==n?void 0:n.name)&&e("h1",{class:"business-name"},n.name),(null==n?void 0:n.description)&&e("p",{class:"business-description"},n.description)),e("veleta-menu-tabs",{sections:l.map((i=>({id:i.id,title:i.title}))),activeSectionId:this.activeSectionId||(null===(i=l[0])||void 0===i?void 0:i.id),onTabClick:i=>this.handleTabClick(i.detail)}),e("main",{class:"menu-content"},l.map((i=>{var t;return e("section",{key:i.id,id:`section-${i.id}`,class:"menu-section"},e("h2",{class:"section-title",style:{borderColor:r}},i.title),i.description&&e("p",{class:"section-description"},i.description),e("div",{class:"dishes-list"},null===(t=i.dishes)||void 0===t?void 0:t.sort(((i,e)=>i.order-e.order)).map((i=>{return e("div",{key:i.id,class:"dish-item "+(this.expandedDishes[i.id]?"expanded":""),onClick:()=>this.toggleDish(i.id)},e("div",{class:"dish-header"},e("span",{class:"dish-name"},i.name),e("span",{class:"dish-price"},((t=i.price)%1==0?t.toString():t.toFixed(2))+"€")),i.description&&e("div",{class:"dish-details"},e("p",{class:"dish-description"},i.description)));var t}))))}))))}get el(){return t(this)}};s.style='@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); .menu-tabs-container{position:-webkit-sticky;position:sticky;top:0;z-index:100;background-color:white;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:0;margin-bottom:24px}.menu-tabs-scroll{display:-ms-flexbox;display:flex;gap:12px;overflow-x:auto;padding:0 20px;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}.menu-tabs-scroll::after{content:"";padding-right:20px}.menu-tabs-scroll::-webkit-scrollbar{display:none}.menu-tab-item{white-space:nowrap;padding:1rem;border:none;-webkit-box-shadow:inset 0 -2px 0 0 transparent;box-shadow:inset 0 -2px 0 0 transparent;background-color:transparent;color:#71717a;font-size:1rem;font-weight:500;cursor:pointer;-webkit-transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease, -webkit-box-shadow 0.3s ease;font-family:inherit;-ms-flex-negative:0;flex-shrink:0;outline:none}.menu-tab-item:hover{color:#18181b}.menu-tab-item.active{color:#18181b;-webkit-box-shadow:inset 0 -2px 0 0 #18181b;box-shadow:inset 0 -2px 0 0 #18181b}.menu-tabs-container::after{content:"";position:absolute;right:0;top:0;bottom:0;width:40px;background:-webkit-gradient(linear, left top, right top, from(transparent), to(rgba(255, 255, 255, 0.8)));background:linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));pointer-events:none;opacity:0;}.menu-wrapper{font-family:"Poppins", sans-serif;max-width:800px;margin:0 auto;padding:20px 0;background-color:#ffffff;min-height:100vh}.menu-header{text-align:center;margin-bottom:24px;padding:0 20px;}.business-name{font-size:2.5rem;font-weight:700;margin-bottom:8px;letter-spacing:-0.02em}.business-description{font-size:1.1rem;color:#71717a;margin:0 auto;padding-left:1px;padding-right:1px;line-height:1.5rem}.menu-section{margin-bottom:48px}.section-title{font-size:1.3rem;font-weight:600;padding-bottom:8px;margin-bottom:1rem}.section-description{font-size:1rem;color:#71717a;margin-bottom:20px;margin-top:-16px;line-height:1.25rem}.dishes-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}.dish-item{padding:1rem 0.2rem;border-bottom:1px solid #e4e4e7;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}.dish-item:hover{border-color:#e4e4e7}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;gap:12px}.dish-name{font-weight:500;font-size:1rem;color:#18181b}.dish-price{font-weight:400;font-size:0.9rem;color:#18181b}.dish-details{max-height:1.35rem;overflow:hidden;margin-top:4px;opacity:1;-webkit-transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1)}.dish-item.expanded .dish-details{max-height:400px;margin-top:4px}.dish-description{font-size:0.9rem;color:#71717a;line-height:1.5;margin:0;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.dish-item.expanded .dish-description{-webkit-line-clamp:10}.menu-content{padding:0.1rem 20px}.menu-footer{margin-top:80px;text-align:center;padding:0 20px}.social-link{display:inline-block;padding:12px 24px;border-radius:99px;color:white;text-decoration:none;font-weight:500;-webkit-transition:opacity 0.2s;transition:opacity 0.2s}.social-link:hover{opacity:0.9}.menu-loading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:200px;color:#71717a}';export{s as veleta_default_template}
@@ -1 +1 @@
1
- import{p as e,b as a}from"./p-fw0ZKjNE.js";export{s as setNonce}from"./p-fw0ZKjNE.js";import{g as t}from"./p-DQuL1Twl.js";(()=>{const a=import.meta.url,t={};return""!==a&&(t.resourcesUrl=new URL(".",a).href),e(t)})().then((async e=>(await t(),a([["p-31ab2ac4",[[0,"veleta-menu-tabs",{sections:[16],activeSectionId:[1,"active-section-id"]},null,{activeSectionId:[{handleActiveSectionChange:0}]}]]],["p-24ad7b94",[[0,"veleta-default-template",{data:[16],dataJson:[1,"data-json"],expandedDishes:[32],activeSectionId:[32]}]]]],e))));
1
+ import{p as e,b as t}from"./p-fw0ZKjNE.js";export{s as setNonce}from"./p-fw0ZKjNE.js";import{g as a}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((async e=>(await a(),t([["p-31ab2ac4",[[0,"veleta-menu-tabs",{sections:[16],activeSectionId:[1,"active-section-id"]},null,{activeSectionId:[{handleActiveSectionChange:0}]}]]],["p-dc58be8e",[[0,"veleta-default-template",{data:[16],dataJson:[1,"data-json"],expandedDishes:[32],activeSectionId:[32]}]]]],e))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veleta-templates",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Stencil Component Starter with TypeScript and PostCSS",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as i,h as e,g as t}from"./p-fw0ZKjNE.js";const s=class{constructor(e){i(this,e),this.expandedDishes={},this.activeSectionId="",this.sectionVisibility=new Map,this.isScrollingByTab=!1,this.toggleDish=i=>{this.expandedDishes=Object.assign(Object.assign({},this.expandedDishes),{[i]:!this.expandedDishes[i]})},this.handleTabClick=i=>{const e=this.el.querySelector(`#section-${i}`);if(e){this.isScrollingByTab=!0,this.activeSectionId=i;const t=95,s=e.getBoundingClientRect().top+window.pageYOffset-t;window.scrollTo({top:s,behavior:"smooth"})}},this.handleScroll=()=>{if(this.isScrollingByTab)return clearTimeout(this.scrollTimeout),void(this.scrollTimeout=setTimeout((()=>{this.isScrollingByTab=!1,this.updateActiveSection()}),150));this.updateActiveSection()},this.updateActiveSection=()=>{if(this.isScrollingByTab)return;const i=Array.from(this.el.querySelectorAll(".menu-section"));if(0===i.length)return;const e=window.innerHeight+window.pageYOffset>=document.documentElement.scrollHeight-10;let t=this.activeSectionId;if(e){for(let e=i.length-1;e>=0;e--)if(this.sectionVisibility.get(i[e].id)){t=i[e].id.replace("section-","");break}}else for(const e of i)if(this.sectionVisibility.get(e.id)){t=e.id.replace("section-","");break}t!==this.activeSectionId&&(this.activeSectionId=t)},this.dataJson="{}"}componentDidLoad(){this.initIntersectionObserver(),window.addEventListener("scroll",this.handleScroll)}disconnectedCallback(){this.observer&&this.observer.disconnect(),window.removeEventListener("scroll",this.handleScroll),clearTimeout(this.scrollTimeout)}initIntersectionObserver(){this.observer=new IntersectionObserver((i=>{i.forEach((i=>{this.sectionVisibility.set(i.target.id,i.isIntersecting)})),this.isScrollingByTab||this.updateActiveSection()}),{root:null,rootMargin:"-90px 0px -10% 0px",threshold:0}),this.el.querySelectorAll(".menu-section").forEach((i=>this.observer.observe(i)))}render(){var i;const t=function(i,e){if(i&&"object"==typeof i&&!Array.isArray(i))return i;if(e&&"string"==typeof e&&"{}"!==e)try{return JSON.parse(e)}catch(i){console.warn("Error parsing menu dataJson:",i)}return null}(this.data,this.dataJson);if(!t)return e("div",{class:"menu-loading"},"Loading...");const{business:s,sections:o,templateData:n}=t,a=null==n?void 0:n.theme,r=(null==a?void 0:a.primaryColor)||"#18181b",l=[...o||[]].sort(((i,e)=>i.order-e.order));return e("div",{class:"menu-wrapper"},e("header",{class:"menu-header"},(null==s?void 0:s.name)&&e("h1",{class:"business-name"},s.name),(null==s?void 0:s.description)&&e("p",{class:"business-description"},s.description)),e("veleta-menu-tabs",{sections:l.map((i=>({id:i.id,title:i.title}))),activeSectionId:this.activeSectionId||(null===(i=l[0])||void 0===i?void 0:i.id),onTabClick:i=>this.handleTabClick(i.detail)}),e("main",{class:"menu-content"},l.map((i=>{var t;return e("section",{key:i.id,id:`section-${i.id}`,class:"menu-section"},e("h2",{class:"section-title",style:{borderColor:r}},i.title),i.description&&e("p",{class:"section-description"},i.description),e("div",{class:"dishes-list"},null===(t=i.dishes)||void 0===t?void 0:t.sort(((i,e)=>i.order-e.order)).map((i=>{return e("div",{key:i.id,class:"dish-item "+(this.expandedDishes[i.id]?"expanded":""),onClick:()=>this.toggleDish(i.id)},e("div",{class:"dish-header"},e("span",{class:"dish-name"},i.name),e("span",{class:"dish-price"},((t=i.price)%1==0?t.toString():t.toFixed(2))+"€")),i.description&&e("div",{class:"dish-details"},e("p",{class:"dish-description"},i.description)));var t}))))}))))}get el(){return t(this)}};s.style='@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"); .menu-tabs-container{position:-webkit-sticky;position:sticky;top:0;z-index:100;background-color:white;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);padding:0;margin-bottom:24px}.menu-tabs-scroll{display:-ms-flexbox;display:flex;gap:12px;overflow-x:auto;padding:0 20px;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}.menu-tabs-scroll::after{content:"";padding-right:20px}.menu-tabs-scroll::-webkit-scrollbar{display:none}.menu-tab-item{white-space:nowrap;padding:1rem;border:none;-webkit-box-shadow:inset 0 -2px 0 0 transparent;box-shadow:inset 0 -2px 0 0 transparent;background-color:transparent;color:#71717a;font-size:1rem;font-weight:500;cursor:pointer;-webkit-transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, -webkit-box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease;transition:color 0.3s ease, box-shadow 0.3s ease, -webkit-box-shadow 0.3s ease;font-family:inherit;-ms-flex-negative:0;flex-shrink:0;outline:none}.menu-tab-item:hover{color:#18181b}.menu-tab-item.active{color:#18181b;-webkit-box-shadow:inset 0 -2px 0 0 #18181b;box-shadow:inset 0 -2px 0 0 #18181b}.menu-tabs-container::after{content:"";position:absolute;right:0;top:0;bottom:0;width:40px;background:-webkit-gradient(linear, left top, right top, from(transparent), to(rgba(255, 255, 255, 0.8)));background:linear-gradient(to right, transparent, rgba(255, 255, 255, 0.8));pointer-events:none;opacity:0;}.menu-wrapper{font-family:"Poppins", sans-serif;max-width:800px;margin:0 auto;padding:20px 0;background-color:#ffffff;min-height:100vh}.menu-header{text-align:center;margin-bottom:24px;padding:0 20px;}.business-name{font-size:2.5rem;font-weight:700;margin-bottom:8px;letter-spacing:-0.02em}.business-description{font-size:1.1rem;color:#71717a;margin:0 auto;padding-left:1px;padding-right:1px;line-height:1.5rem}.menu-section{margin-bottom:48px}.section-title{font-size:1.3rem;font-weight:600;padding-bottom:8px;margin-bottom:1rem}.section-description{font-size:1rem;color:#71717a;margin-bottom:20px;margin-top:-16px;line-height:1.25rem}.dishes-list{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}.dish-item{padding:1rem 0.2rem;border-bottom:1px solid #e4e4e7;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}.dish-item:hover{border-color:#e4e4e7}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:baseline;align-items:baseline;gap:12px}.dish-name{font-weight:500;font-size:1rem;color:#18181b}.dish-price{font-weight:400;font-size:0.9rem;color:#18181b}.dish-details{max-height:1.35rem;overflow:hidden;margin-top:4px;opacity:1;-webkit-transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);transition:max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1)}.dish-item.expanded .dish-details{max-height:400px;margin-top:4px}.dish-description{font-size:0.9rem;color:#71717a;line-height:1.5;margin:0;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}.dish-item.expanded .dish-description{-webkit-line-clamp:10}.menu-content{padding:0.1rem 20px}.menu-footer{margin-top:80px;text-align:center;padding:0 20px}.social-link{display:inline-block;padding:12px 24px;border-radius:99px;color:white;text-decoration:none;font-weight:500;-webkit-transition:opacity 0.2s;transition:opacity 0.2s}.social-link:hover{opacity:0.9}.menu-loading{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:200px;color:#71717a}';export{s as veleta_default_template}