veleta-templates 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/veleta-boston-template.cjs.entry.js +15 -4
- package/dist/cjs/veleta-templates.cjs.js +1 -1
- package/dist/collection/components/boston-template/boston-template.js +43 -6
- package/dist/components/veleta-boston-template.js +17 -5
- package/dist/esm/loader.js +1 -1
- package/dist/esm/veleta-boston-template.entry.js +15 -4
- package/dist/esm/veleta-templates.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/veleta-boston-template.entry.js +1 -1
- package/dist/esm-es5/veleta-templates.js +1 -1
- package/dist/types/components/boston-template/boston-template.d.ts +10 -0
- package/dist/types/components.d.ts +14 -0
- package/dist/veleta-templates/{p-5ac3e588.system.entry.js → p-2a61ffe8.system.entry.js} +1 -1
- package/dist/veleta-templates/p-64db36d4.entry.js +1 -0
- package/dist/veleta-templates/p-D1BkLoGd.system.js +1 -1
- package/dist/veleta-templates/veleta-templates.esm.js +1 -1
- package/package.json +1 -1
- package/dist/veleta-templates/p-d4171e7c.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var appGlobals = require('./app-globals-V2Kpy_OQ.js');
|
|
|
6
6
|
const defineCustomElements = async (win, options) => {
|
|
7
7
|
if (typeof window === 'undefined') return undefined;
|
|
8
8
|
await appGlobals.globalScripts();
|
|
9
|
-
return index.bootstrapLazy([["veleta-boston-template.cjs",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"]}]]]], options);
|
|
9
|
+
return index.bootstrapLazy([["veleta-boston-template.cjs",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"],"data":[16]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -70,6 +70,10 @@ const bostonTemplateCss = () => `.menu-wrapper{min-height:100vh;width:100%;paddi
|
|
|
70
70
|
const BostonTemplate = class {
|
|
71
71
|
constructor(hostRef) {
|
|
72
72
|
index.registerInstance(this, hostRef);
|
|
73
|
+
/**
|
|
74
|
+
* Menu data as JSON string (for compatibility with HTML attributes)
|
|
75
|
+
* @deprecated Use `data` prop instead for better type safety
|
|
76
|
+
*/
|
|
73
77
|
this.dataJson = '{}';
|
|
74
78
|
this.fontConfig = {
|
|
75
79
|
google: {
|
|
@@ -115,11 +119,18 @@ const BostonTemplate = class {
|
|
|
115
119
|
render() {
|
|
116
120
|
var _a;
|
|
117
121
|
let menuData = null;
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
// Priority 1: Use object data if provided
|
|
123
|
+
if (this.data) {
|
|
124
|
+
menuData = this.data;
|
|
120
125
|
}
|
|
121
|
-
|
|
122
|
-
|
|
126
|
+
// Priority 2: Parse JSON string
|
|
127
|
+
else if (this.dataJson && this.dataJson !== '{}') {
|
|
128
|
+
try {
|
|
129
|
+
menuData = JSON.parse(this.dataJson);
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
console.warn('Invalid dataJson provided to veleta-boston-template:', e);
|
|
133
|
+
}
|
|
123
134
|
}
|
|
124
135
|
const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
|
|
125
136
|
const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1a365d';
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["veleta-boston-template.cjs",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["veleta-boston-template.cjs",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"],"data":[16]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -3,6 +3,10 @@ import { loadFonts, applyFontFamily } from "../../utils/font-loader";
|
|
|
3
3
|
import { formatPrice } from "../../utils/data-helpers";
|
|
4
4
|
export class BostonTemplate {
|
|
5
5
|
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Menu data as JSON string (for compatibility with HTML attributes)
|
|
8
|
+
* @deprecated Use `data` prop instead for better type safety
|
|
9
|
+
*/
|
|
6
10
|
this.dataJson = '{}';
|
|
7
11
|
this.fontConfig = {
|
|
8
12
|
google: {
|
|
@@ -48,11 +52,18 @@ export class BostonTemplate {
|
|
|
48
52
|
render() {
|
|
49
53
|
var _a;
|
|
50
54
|
let menuData = null;
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
// Priority 1: Use object data if provided
|
|
56
|
+
if (this.data) {
|
|
57
|
+
menuData = this.data;
|
|
53
58
|
}
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
// Priority 2: Parse JSON string
|
|
60
|
+
else if (this.dataJson && this.dataJson !== '{}') {
|
|
61
|
+
try {
|
|
62
|
+
menuData = JSON.parse(this.dataJson);
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.warn('Invalid dataJson provided to veleta-boston-template:', e);
|
|
66
|
+
}
|
|
56
67
|
}
|
|
57
68
|
const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
|
|
58
69
|
const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1a365d';
|
|
@@ -96,14 +107,40 @@ export class BostonTemplate {
|
|
|
96
107
|
"required": false,
|
|
97
108
|
"optional": false,
|
|
98
109
|
"docs": {
|
|
99
|
-
"tags": [
|
|
100
|
-
|
|
110
|
+
"tags": [{
|
|
111
|
+
"name": "deprecated",
|
|
112
|
+
"text": "Use `data` prop instead for better type safety"
|
|
113
|
+
}],
|
|
114
|
+
"text": "Menu data as JSON string (for compatibility with HTML attributes)"
|
|
101
115
|
},
|
|
102
116
|
"getter": false,
|
|
103
117
|
"setter": false,
|
|
104
118
|
"reflect": false,
|
|
105
119
|
"attribute": "data-json",
|
|
106
120
|
"defaultValue": "'{}'"
|
|
121
|
+
},
|
|
122
|
+
"data": {
|
|
123
|
+
"type": "unknown",
|
|
124
|
+
"mutable": false,
|
|
125
|
+
"complexType": {
|
|
126
|
+
"original": "Menu",
|
|
127
|
+
"resolved": "Menu",
|
|
128
|
+
"references": {
|
|
129
|
+
"Menu": {
|
|
130
|
+
"location": "import",
|
|
131
|
+
"path": "../../types/interfaces",
|
|
132
|
+
"id": "src/types/interfaces.ts::Menu"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"required": false,
|
|
137
|
+
"optional": true,
|
|
138
|
+
"docs": {
|
|
139
|
+
"tags": [],
|
|
140
|
+
"text": "Menu data as object (recommended for frameworks like Angular, React, Vue)\nThis takes precedence over dataJson if both are provided"
|
|
141
|
+
},
|
|
142
|
+
"getter": false,
|
|
143
|
+
"setter": false
|
|
107
144
|
}
|
|
108
145
|
};
|
|
109
146
|
}
|
|
@@ -71,6 +71,10 @@ const BostonTemplate = /*@__PURE__*/ proxyCustomElement(class BostonTemplate ext
|
|
|
71
71
|
if (registerHost !== false) {
|
|
72
72
|
this.__registerHost();
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Menu data as JSON string (for compatibility with HTML attributes)
|
|
76
|
+
* @deprecated Use `data` prop instead for better type safety
|
|
77
|
+
*/
|
|
74
78
|
this.dataJson = '{}';
|
|
75
79
|
this.fontConfig = {
|
|
76
80
|
google: {
|
|
@@ -116,11 +120,18 @@ const BostonTemplate = /*@__PURE__*/ proxyCustomElement(class BostonTemplate ext
|
|
|
116
120
|
render() {
|
|
117
121
|
var _a;
|
|
118
122
|
let menuData = null;
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
// Priority 1: Use object data if provided
|
|
124
|
+
if (this.data) {
|
|
125
|
+
menuData = this.data;
|
|
121
126
|
}
|
|
122
|
-
|
|
123
|
-
|
|
127
|
+
// Priority 2: Parse JSON string
|
|
128
|
+
else if (this.dataJson && this.dataJson !== '{}') {
|
|
129
|
+
try {
|
|
130
|
+
menuData = JSON.parse(this.dataJson);
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
console.warn('Invalid dataJson provided to veleta-boston-template:', e);
|
|
134
|
+
}
|
|
124
135
|
}
|
|
125
136
|
const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
|
|
126
137
|
const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1a365d';
|
|
@@ -143,7 +154,8 @@ const BostonTemplate = /*@__PURE__*/ proxyCustomElement(class BostonTemplate ext
|
|
|
143
154
|
get el() { return this; }
|
|
144
155
|
static get style() { return bostonTemplateCss(); }
|
|
145
156
|
}, [256, "veleta-boston-template", {
|
|
146
|
-
"dataJson": [1, "data-json"]
|
|
157
|
+
"dataJson": [1, "data-json"],
|
|
158
|
+
"data": [16]
|
|
147
159
|
}]);
|
|
148
160
|
function defineCustomElement$1() {
|
|
149
161
|
if (typeof customElements === "undefined") {
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy([["veleta-boston-template",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"]}]]]], options);
|
|
8
|
+
return bootstrapLazy([["veleta-boston-template",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"],"data":[16]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -68,6 +68,10 @@ const bostonTemplateCss = () => `.menu-wrapper{min-height:100vh;width:100%;paddi
|
|
|
68
68
|
const BostonTemplate = class {
|
|
69
69
|
constructor(hostRef) {
|
|
70
70
|
registerInstance(this, hostRef);
|
|
71
|
+
/**
|
|
72
|
+
* Menu data as JSON string (for compatibility with HTML attributes)
|
|
73
|
+
* @deprecated Use `data` prop instead for better type safety
|
|
74
|
+
*/
|
|
71
75
|
this.dataJson = '{}';
|
|
72
76
|
this.fontConfig = {
|
|
73
77
|
google: {
|
|
@@ -113,11 +117,18 @@ const BostonTemplate = class {
|
|
|
113
117
|
render() {
|
|
114
118
|
var _a;
|
|
115
119
|
let menuData = null;
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
// Priority 1: Use object data if provided
|
|
121
|
+
if (this.data) {
|
|
122
|
+
menuData = this.data;
|
|
118
123
|
}
|
|
119
|
-
|
|
120
|
-
|
|
124
|
+
// Priority 2: Parse JSON string
|
|
125
|
+
else if (this.dataJson && this.dataJson !== '{}') {
|
|
126
|
+
try {
|
|
127
|
+
menuData = JSON.parse(this.dataJson);
|
|
128
|
+
}
|
|
129
|
+
catch (e) {
|
|
130
|
+
console.warn('Invalid dataJson provided to veleta-boston-template:', e);
|
|
131
|
+
}
|
|
121
132
|
}
|
|
122
133
|
const theme = (_a = menuData === null || menuData === void 0 ? void 0 : menuData.templateData) === null || _a === void 0 ? void 0 : _a.theme;
|
|
123
134
|
const primary = (theme === null || theme === void 0 ? void 0 : theme.primaryColor) || '#1a365d';
|
|
@@ -17,5 +17,5 @@ var patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(async (options) => {
|
|
19
19
|
await globalScripts();
|
|
20
|
-
return bootstrapLazy([["veleta-boston-template",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"]}]]]], options);
|
|
20
|
+
return bootstrapLazy([["veleta-boston-template",[[256,"veleta-boston-template",{"dataJson":[1,"data-json"],"data":[16]}]]]], options);
|
|
21
21
|
});
|
package/dist/esm-es5/loader.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r["throw"](t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=u(0),a["throw"]=u(1),a["return"]=u(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(e){return c([t,e])}}function c(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(n=0)),n)try{if(r=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;o=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1];i=u;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(u);break}if(i[2])n.ops.pop();n.trys.pop();continue}u=e.call(t,n)}catch(t){u=[6,t];o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};import{b as bootstrapLazy}from"./index-zOTWMTLj.js";export{s as setNonce}from"./index-zOTWMTLj.js";import{g as globalScripts}from"./app-globals-DQuL1Twl.js";var defineCustomElements=function(t,e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(typeof window==="undefined")return[2,undefined];return[4,globalScripts()];case 1:t.sent();return[2,bootstrapLazy([["veleta-boston-template",[[256,"veleta-boston-template",{dataJson:[1,"data-json"]}]]]],e)]}}))}))};export{defineCustomElements};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function u(t){try{c(r["throw"](t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,u)}c((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=u(0),a["throw"]=u(1),a["return"]=u(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(e){return c([t,e])}}function c(u){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(n=0)),n)try{if(r=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;o=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1];i=u;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(u);break}if(i[2])n.ops.pop();n.trys.pop();continue}u=e.call(t,n)}catch(t){u=[6,t];o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};import{b as bootstrapLazy}from"./index-zOTWMTLj.js";export{s as setNonce}from"./index-zOTWMTLj.js";import{g as globalScripts}from"./app-globals-DQuL1Twl.js";var defineCustomElements=function(t,e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(typeof window==="undefined")return[2,undefined];return[4,globalScripts()];case 1:t.sent();return[2,bootstrapLazy([["veleta-boston-template",[[256,"veleta-boston-template",{dataJson:[1,"data-json"],data:[16]}]]]],e)]}}))}))};export{defineCustomElements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{m(n.next(e))}catch(e){a(e)}}function s(e){try{m(n["throw"](e))}catch(e){a(e)}}function m(e){e.done?t(e.value):r(e.value).then(o,s)}m((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return m([e,i])}}function m(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=i.call(e,t)}catch(e){s=[6,e];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,g as getElement}from"./index-zOTWMTLj.js";function loadFonts(e){return __awaiter(this,void 0,void 0,(function(){var i,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!e||!e.google&&!e.custom){return[2,Promise.resolve()]}r.label=1;case 1:r.trys.push([1,3,,4]);return[4,import("./webfontloader-DjUJwx0S.js").then((function(e){return e.w}))];case 2:i=r.sent();t=i.default||i;if(!t||typeof t.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return[2,Promise.resolve()]}return[2,new Promise((function(i){var n=Object.assign(Object.assign({},e),{active:function(){if(e.active){e.active()}i()},inactive:function(){if(e.inactive){e.inactive()}i()}});t.load(n)}))];case 3:n=r.sent();console.error("Error loading webfontloader:",n);return[2,Promise.resolve()];case 4:return[2]}}))}))}function applyFontFamily(e,i){if(e){e.style.fontFamily=i}}function formatPrice(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var bostonTemplateCss=function(){return".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}"};var BostonTemplate=function(){function e(e){registerInstance(this,e);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,loadFonts(this.fontConfig)];case 1:e.sent();applyFontFamily(this.el,"Merriweather, serif");return[2]}}))}))};e.prototype.componentDidLoad=function(){this.initObserver()};e.prototype.componentDidUpdate=function(){this.initObserver()};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}};e.prototype.initObserver=function(){var e=this;if(this.observer){this.observer.disconnect()}this.observer=new IntersectionObserver((function(i){i.forEach((function(i){if(i.isIntersecting){var t=i.target;t.classList.add("is-visible");e.observer.unobserve(t)}}))}),{threshold:.1,rootMargin:"0px 0px -50px 0px"});var i=this.el.querySelectorAll(".animate-item");i.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e;var i=null;try{i=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template")}var t=(e=i===null||i===void 0?void 0:i.templateData)===null||e===void 0?void 0:e.theme;var n=(t===null||t===void 0?void 0:t.primaryColor)||"#1a365d";var r=(t===null||t===void 0?void 0:t.backgroundColor)||"#FFFFFF";var a="Merriweather, serif";var o="Oswald, sans-serif";if(!i){return h("div",{class:"menu-wrapper",style:{color:n,backgroundColor:r}})}var s=i.sections,m=i.business;var l=(s||[]).sort((function(e,i){return e.order-i.order}));return h("div",{class:"menu-wrapper",style:{color:n,backgroundColor:r}},h("div",{class:"menu-container"},(m===null||m===void 0?void 0:m.name)&&h("header",{class:"menu-header"},h("h1",{class:"restaurant-title animate-item",style:{fontFamily:o}},m.name)),h("div",{class:"sections-container"},l.map((function(e){var i=(e.dishes||[]).sort((function(e,i){return e.order-i.order}));if(!i.length)return null;return h("section",{key:e.id,class:"menu-section animate-item"},h("div",{class:"section-label-wrapper"},h("div",{class:"section-label-line",style:{borderColor:n}}),h("h2",{class:"section-label",style:{fontFamily:o,color:n}},e.title)),h("div",{class:"section-content"},e.description&&h("p",{class:"section-description",style:{fontFamily:a}},e.description),h("ul",{class:"dishes-list"},i.map((function(e,i){return h("li",{key:e.id,class:"dish-item animate-item",style:{transitionDelay:"".concat(i*50,"ms")}},h("div",{class:"dish-header"},h("h3",{class:"dish-name",style:{fontFamily:o,color:n}},e.name),h("div",{class:"dish-dots"}),h("span",{class:"dish-price",style:{fontFamily:o,color:n}},formatPrice(e.price))),e.description&&h("p",{class:"dish-description",style:{fontFamily:a}},e.description))})))))})))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();BostonTemplate.style=bostonTemplateCss();export{BostonTemplate as veleta_boston_template};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{m(n.next(e))}catch(e){a(e)}}function s(e){try{m(n["throw"](e))}catch(e){a(e)}}function m(e){e.done?t(e.value):r(e.value).then(o,s)}m((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return m([e,i])}}function m(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=i.call(e,t)}catch(e){s=[6,e];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,h,g as getElement}from"./index-zOTWMTLj.js";function loadFonts(e){return __awaiter(this,void 0,void 0,(function(){var i,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!e||!e.google&&!e.custom){return[2,Promise.resolve()]}r.label=1;case 1:r.trys.push([1,3,,4]);return[4,import("./webfontloader-DjUJwx0S.js").then((function(e){return e.w}))];case 2:i=r.sent();t=i.default||i;if(!t||typeof t.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return[2,Promise.resolve()]}return[2,new Promise((function(i){var n=Object.assign(Object.assign({},e),{active:function(){if(e.active){e.active()}i()},inactive:function(){if(e.inactive){e.inactive()}i()}});t.load(n)}))];case 3:n=r.sent();console.error("Error loading webfontloader:",n);return[2,Promise.resolve()];case 4:return[2]}}))}))}function applyFontFamily(e,i){if(e){e.style.fontFamily=i}}function formatPrice(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var bostonTemplateCss=function(){return".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}"};var BostonTemplate=function(){function e(e){registerInstance(this,e);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,loadFonts(this.fontConfig)];case 1:e.sent();applyFontFamily(this.el,"Merriweather, serif");return[2]}}))}))};e.prototype.componentDidLoad=function(){this.initObserver()};e.prototype.componentDidUpdate=function(){this.initObserver()};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}};e.prototype.initObserver=function(){var e=this;if(this.observer){this.observer.disconnect()}this.observer=new IntersectionObserver((function(i){i.forEach((function(i){if(i.isIntersecting){var t=i.target;t.classList.add("is-visible");e.observer.unobserve(t)}}))}),{threshold:.1,rootMargin:"0px 0px -50px 0px"});var i=this.el.querySelectorAll(".animate-item");i.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e;var i=null;if(this.data){i=this.data}else if(this.dataJson&&this.dataJson!=="{}"){try{i=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template:",e)}}var t=(e=i===null||i===void 0?void 0:i.templateData)===null||e===void 0?void 0:e.theme;var n=(t===null||t===void 0?void 0:t.primaryColor)||"#1a365d";var r=(t===null||t===void 0?void 0:t.backgroundColor)||"#FFFFFF";var a="Merriweather, serif";var o="Oswald, sans-serif";if(!i){return h("div",{class:"menu-wrapper",style:{color:n,backgroundColor:r}})}var s=i.sections,m=i.business;var l=(s||[]).sort((function(e,i){return e.order-i.order}));return h("div",{class:"menu-wrapper",style:{color:n,backgroundColor:r}},h("div",{class:"menu-container"},(m===null||m===void 0?void 0:m.name)&&h("header",{class:"menu-header"},h("h1",{class:"restaurant-title animate-item",style:{fontFamily:o}},m.name)),h("div",{class:"sections-container"},l.map((function(e){var i=(e.dishes||[]).sort((function(e,i){return e.order-i.order}));if(!i.length)return null;return h("section",{key:e.id,class:"menu-section animate-item"},h("div",{class:"section-label-wrapper"},h("div",{class:"section-label-line",style:{borderColor:n}}),h("h2",{class:"section-label",style:{fontFamily:o,color:n}},e.title)),h("div",{class:"section-content"},e.description&&h("p",{class:"section-description",style:{fontFamily:a}},e.description),h("ul",{class:"dishes-list"},i.map((function(e,i){return h("li",{key:e.id,class:"dish-item animate-item",style:{transitionDelay:"".concat(i*50,"ms")}},h("div",{class:"dish-header"},h("h3",{class:"dish-name",style:{fontFamily:o,color:n}},e.name),h("div",{class:"dish-dots"}),h("span",{class:"dish-price",style:{fontFamily:o,color:n}},formatPrice(e.price))),e.description&&h("p",{class:"dish-description",style:{fontFamily:a}},e.description))})))))})))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();BostonTemplate.style=bostonTemplateCss();export{BostonTemplate as veleta_boston_template};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,a){function i(t){try{s(r.next(t))}catch(t){a(t)}}function c(t){try{s(r["throw"](t))}catch(t){a(t)}}function s(t){t.done?n(t.value):o(t.value).then(i,c)}s((r=r.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:[]},r,o,a,i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=c(0),i["throw"]=c(1),i["return"]=c(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(t){return function(e){return s([t,e])}}function s(c){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(n=0)),n)try{if(r=1,o&&(a=c[0]&2?o["return"]:c[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,c[1])).done)return a;if(o=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:n.label++;return{value:c[1],done:false};case 5:n.label++;o=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){n.label=c[1];break}if(c[0]===6&&n.label<a[1]){n.label=a[1];a=c;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(c);break}if(a[2])n.ops.pop();n.trys.pop();continue}c=e.call(t,n)}catch(t){c=[6,t];o=0}finally{r=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{p as promiseResolve,b as bootstrapLazy}from"./index-zOTWMTLj.js";export{s as setNonce}from"./index-zOTWMTLj.js";import{g as globalScripts}from"./app-globals-DQuL1Twl.js";var patchBrowser=function(){var t=import.meta.url;var e={};if(t!==""){e.resourcesUrl=new URL(".",t).href}return promiseResolve(e)};patchBrowser().then((function(t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,globalScripts()];case 1:e.sent();return[2,bootstrapLazy([["veleta-boston-template",[[256,"veleta-boston-template",{dataJson:[1,"data-json"],data:[16]}]]]],t)]}}))}))}));
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
import { Menu } from '../../types/interfaces';
|
|
1
2
|
export declare class BostonTemplate {
|
|
2
3
|
el: HTMLElement;
|
|
4
|
+
/**
|
|
5
|
+
* Menu data as JSON string (for compatibility with HTML attributes)
|
|
6
|
+
* @deprecated Use `data` prop instead for better type safety
|
|
7
|
+
*/
|
|
3
8
|
dataJson: string;
|
|
9
|
+
/**
|
|
10
|
+
* Menu data as object (recommended for frameworks like Angular, React, Vue)
|
|
11
|
+
* This takes precedence over dataJson if both are provided
|
|
12
|
+
*/
|
|
13
|
+
data?: Menu;
|
|
4
14
|
private readonly fontConfig;
|
|
5
15
|
private observer;
|
|
6
16
|
componentWillLoad(): Promise<void>;
|
|
@@ -5,9 +5,17 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
+
import { Menu } from "./types/interfaces";
|
|
9
|
+
export { Menu } from "./types/interfaces";
|
|
8
10
|
export namespace Components {
|
|
9
11
|
interface VeletaBostonTemplate {
|
|
10
12
|
/**
|
|
13
|
+
* Menu data as object (recommended for frameworks like Angular, React, Vue) This takes precedence over dataJson if both are provided
|
|
14
|
+
*/
|
|
15
|
+
"data"?: Menu;
|
|
16
|
+
/**
|
|
17
|
+
* Menu data as JSON string (for compatibility with HTML attributes)
|
|
18
|
+
* @deprecated Use `data` prop instead for better type safety
|
|
11
19
|
* @default '{}'
|
|
12
20
|
*/
|
|
13
21
|
"dataJson": string;
|
|
@@ -27,6 +35,12 @@ declare global {
|
|
|
27
35
|
declare namespace LocalJSX {
|
|
28
36
|
interface VeletaBostonTemplate {
|
|
29
37
|
/**
|
|
38
|
+
* Menu data as object (recommended for frameworks like Angular, React, Vue) This takes precedence over dataJson if both are provided
|
|
39
|
+
*/
|
|
40
|
+
"data"?: Menu;
|
|
41
|
+
/**
|
|
42
|
+
* Menu data as JSON string (for compatibility with HTML attributes)
|
|
43
|
+
* @deprecated Use `data` prop instead for better type safety
|
|
30
44
|
* @default '{}'
|
|
31
45
|
*/
|
|
32
46
|
"dataJson"?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{m(n.next(e))}catch(e){a(e)}}function s(e){try{m(n["throw"](e))}catch(e){a(e)}}function m(e){e.done?t(e.value):r(e.value).then(o,s)}m((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return m([e,i])}}function m(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=i.call(e,t)}catch(e){s=[6,e];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-D3ESHVSd.system.js"],(function(e,i){"use strict";var t,n,r;return{setters:[function(e){t=e.r;n=e.h;r=e.g}],execute:function(){function a(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r;return __generator(this,(function(a){switch(a.label){case 0:if(!e||!e.google&&!e.custom){return[2,Promise.resolve()]}a.label=1;case 1:a.trys.push([1,3,,4]);return[4,i.import("./p-6tMTQRgb.system.js").then((function(e){return e.w}))];case 2:t=a.sent();n=t.default||t;if(!n||typeof n.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return[2,Promise.resolve()]}return[2,new Promise((function(i){var t=Object.assign(Object.assign({},e),{active:function(){if(e.active){e.active()}i()},inactive:function(){if(e.inactive){e.inactive()}i()}});n.load(t)}))];case 3:r=a.sent();console.error("Error loading webfontloader:",r);return[2,Promise.resolve()];case 4:return[2]}}))}))}function o(e,i){if(e){e.style.fontFamily=i}}function s(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var m=function(){return".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}"};var l=e("veleta_boston_template",function(){function e(e){t(this,e);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,a(this.fontConfig)];case 1:e.sent();o(this.el,"Merriweather, serif");return[2]}}))}))};e.prototype.componentDidLoad=function(){this.initObserver()};e.prototype.componentDidUpdate=function(){this.initObserver()};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}};e.prototype.initObserver=function(){var e=this;if(this.observer){this.observer.disconnect()}this.observer=new IntersectionObserver((function(i){i.forEach((function(i){if(i.isIntersecting){var t=i.target;t.classList.add("is-visible");e.observer.unobserve(t)}}))}),{threshold:.1,rootMargin:"0px 0px -50px 0px"});var i=this.el.querySelectorAll(".animate-item");i.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e;var i=null;try{i=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template")}var t=(e=i===null||i===void 0?void 0:i.templateData)===null||e===void 0?void 0:e.theme;var r=(t===null||t===void 0?void 0:t.primaryColor)||"#1a365d";var a=(t===null||t===void 0?void 0:t.backgroundColor)||"#FFFFFF";var o="Merriweather, serif";var m="Oswald, sans-serif";if(!i){return n("div",{class:"menu-wrapper",style:{color:r,backgroundColor:a}})}var l=i.sections,c=i.business;var d=(l||[]).sort((function(e,i){return e.order-i.order}));return n("div",{class:"menu-wrapper",style:{color:r,backgroundColor:a}},n("div",{class:"menu-container"},(c===null||c===void 0?void 0:c.name)&&n("header",{class:"menu-header"},n("h1",{class:"restaurant-title animate-item",style:{fontFamily:m}},c.name)),n("div",{class:"sections-container"},d.map((function(e){var i=(e.dishes||[]).sort((function(e,i){return e.order-i.order}));if(!i.length)return null;return n("section",{key:e.id,class:"menu-section animate-item"},n("div",{class:"section-label-wrapper"},n("div",{class:"section-label-line",style:{borderColor:r}}),n("h2",{class:"section-label",style:{fontFamily:m,color:r}},e.title)),n("div",{class:"section-content"},e.description&&n("p",{class:"section-description",style:{fontFamily:o}},e.description),n("ul",{class:"dishes-list"},i.map((function(e,i){return n("li",{key:e.id,class:"dish-item animate-item",style:{transitionDelay:"".concat(i*50,"ms")}},n("div",{class:"dish-header"},n("h3",{class:"dish-name",style:{fontFamily:m,color:r}},e.name),n("div",{class:"dish-dots"}),n("span",{class:"dish-price",style:{fontFamily:m,color:r}},s(e.price))),e.description&&n("p",{class:"dish-description",style:{fontFamily:o}},e.description))})))))})))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());l.style=m()}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,i,t,n){function r(e){return e instanceof t?e:new t((function(i){i(e)}))}return new(t||(t=Promise))((function(t,a){function o(e){try{m(n.next(e))}catch(e){a(e)}}function s(e){try{m(n["throw"](e))}catch(e){a(e)}}function m(e){e.done?t(e.value):r(e.value).then(o,s)}m((n=n.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=s(0),o["throw"]=s(1),o["return"]=s(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(i){return m([e,i])}}function m(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,r&&(a=s[0]&2?r["return"]:s[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,s[1])).done)return a;if(r=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;r=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=i.call(e,t)}catch(e){s=[6,e];r=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-D3ESHVSd.system.js"],(function(e,i){"use strict";var t,n,r;return{setters:[function(e){t=e.r;n=e.h;r=e.g}],execute:function(){function a(e){return __awaiter(this,void 0,void 0,(function(){var t,n,r;return __generator(this,(function(a){switch(a.label){case 0:if(!e||!e.google&&!e.custom){return[2,Promise.resolve()]}a.label=1;case 1:a.trys.push([1,3,,4]);return[4,i.import("./p-6tMTQRgb.system.js").then((function(e){return e.w}))];case 2:t=a.sent();n=t.default||t;if(!n||typeof n.load!=="function"){console.warn("webfontloader no está disponible o no tiene el método load");return[2,Promise.resolve()]}return[2,new Promise((function(i){var t=Object.assign(Object.assign({},e),{active:function(){if(e.active){e.active()}i()},inactive:function(){if(e.inactive){e.inactive()}i()}});n.load(t)}))];case 3:r=a.sent();console.error("Error loading webfontloader:",r);return[2,Promise.resolve()];case 4:return[2]}}))}))}function o(e,i){if(e){e.style.fontFamily=i}}function s(e){return(e%1===0?e.toString():e.toFixed(2))+"€"}var m=function(){return".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}"};var l=e("veleta_boston_template",function(){function e(e){t(this,e);this.dataJson="{}";this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,a(this.fontConfig)];case 1:e.sent();o(this.el,"Merriweather, serif");return[2]}}))}))};e.prototype.componentDidLoad=function(){this.initObserver()};e.prototype.componentDidUpdate=function(){this.initObserver()};e.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}};e.prototype.initObserver=function(){var e=this;if(this.observer){this.observer.disconnect()}this.observer=new IntersectionObserver((function(i){i.forEach((function(i){if(i.isIntersecting){var t=i.target;t.classList.add("is-visible");e.observer.unobserve(t)}}))}),{threshold:.1,rootMargin:"0px 0px -50px 0px"});var i=this.el.querySelectorAll(".animate-item");i.forEach((function(i){return e.observer.observe(i)}))};e.prototype.render=function(){var e;var i=null;if(this.data){i=this.data}else if(this.dataJson&&this.dataJson!=="{}"){try{i=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template:",e)}}var t=(e=i===null||i===void 0?void 0:i.templateData)===null||e===void 0?void 0:e.theme;var r=(t===null||t===void 0?void 0:t.primaryColor)||"#1a365d";var a=(t===null||t===void 0?void 0:t.backgroundColor)||"#FFFFFF";var o="Merriweather, serif";var m="Oswald, sans-serif";if(!i){return n("div",{class:"menu-wrapper",style:{color:r,backgroundColor:a}})}var l=i.sections,c=i.business;var d=(l||[]).sort((function(e,i){return e.order-i.order}));return n("div",{class:"menu-wrapper",style:{color:r,backgroundColor:a}},n("div",{class:"menu-container"},(c===null||c===void 0?void 0:c.name)&&n("header",{class:"menu-header"},n("h1",{class:"restaurant-title animate-item",style:{fontFamily:m}},c.name)),n("div",{class:"sections-container"},d.map((function(e){var i=(e.dishes||[]).sort((function(e,i){return e.order-i.order}));if(!i.length)return null;return n("section",{key:e.id,class:"menu-section animate-item"},n("div",{class:"section-label-wrapper"},n("div",{class:"section-label-line",style:{borderColor:r}}),n("h2",{class:"section-label",style:{fontFamily:m,color:r}},e.title)),n("div",{class:"section-content"},e.description&&n("p",{class:"section-description",style:{fontFamily:o}},e.description),n("ul",{class:"dishes-list"},i.map((function(e,i){return n("li",{key:e.id,class:"dish-item animate-item",style:{transitionDelay:"".concat(i*50,"ms")}},n("div",{class:"dish-header"},n("h3",{class:"dish-name",style:{fontFamily:m,color:r}},e.name),n("div",{class:"dish-dots"}),n("span",{class:"dish-price",style:{fontFamily:m,color:r}},s(e.price))),e.description&&n("p",{class:"dish-description",style:{fontFamily:o}},e.description))})))))})))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());l.style=m()}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as i,g as t}from"./p-zOTWMTLj.js";const r=class{constructor(i){e(this,i),this.dataJson="{}",this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}async componentWillLoad(){var e;await async function(e){if(!e||!e.google&&!e.custom)return Promise.resolve();try{const i=await import("./p-DjUJwx0S.js").then((function(e){return e.w})),t=i.default||i;return t&&"function"==typeof t.load?new Promise((i=>{const r=Object.assign(Object.assign({},e),{active:()=>{e.active&&e.active(),i()},inactive:()=>{e.inactive&&e.inactive(),i()}});t.load(r)})):(console.warn("webfontloader no está disponible o no tiene el método load"),Promise.resolve())}catch(e){return console.error("Error loading webfontloader:",e),Promise.resolve()}}(this.fontConfig),(e=this.el)&&(e.style.fontFamily="Merriweather, serif")}componentDidLoad(){this.initObserver()}componentDidUpdate(){this.initObserver()}disconnectedCallback(){this.observer&&this.observer.disconnect()}initObserver(){this.observer&&this.observer.disconnect(),this.observer=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const i=e.target;i.classList.add("is-visible"),this.observer.unobserve(i)}}))}),{threshold:.1,rootMargin:"0px 0px -50px 0px"}),this.el.querySelectorAll(".animate-item").forEach((e=>this.observer.observe(e)))}render(){var e;let t=null;if(this.data)t=this.data;else if(this.dataJson&&"{}"!==this.dataJson)try{t=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template:",e)}const r=null===(e=null==t?void 0:t.templateData)||void 0===e?void 0:e.theme,n=(null==r?void 0:r.primaryColor)||"#1a365d",a=(null==r?void 0:r.backgroundColor)||"#FFFFFF",s="Merriweather, serif",o="Oswald, sans-serif";if(!t)return i("div",{class:"menu-wrapper",style:{color:n,backgroundColor:a}});const{sections:m,business:l}=t,p=(m||[]).sort(((e,i)=>e.order-i.order));return i("div",{class:"menu-wrapper",style:{color:n,backgroundColor:a}},i("div",{class:"menu-container"},(null==l?void 0:l.name)&&i("header",{class:"menu-header"},i("h1",{class:"restaurant-title animate-item",style:{fontFamily:o}},l.name)),i("div",{class:"sections-container"},p.map((e=>{const t=(e.dishes||[]).sort(((e,i)=>e.order-i.order));return t.length?i("section",{key:e.id,class:"menu-section animate-item"},i("div",{class:"section-label-wrapper"},i("div",{class:"section-label-line",style:{borderColor:n}}),i("h2",{class:"section-label",style:{fontFamily:o,color:n}},e.title)),i("div",{class:"section-content"},e.description&&i("p",{class:"section-description",style:{fontFamily:s}},e.description),i("ul",{class:"dishes-list"},t.map(((e,t)=>{return i("li",{key:e.id,class:"dish-item animate-item",style:{transitionDelay:50*t+"ms"}},i("div",{class:"dish-header"},i("h3",{class:"dish-name",style:{fontFamily:o,color:n}},e.name),i("div",{class:"dish-dots"}),i("span",{class:"dish-price",style:{fontFamily:o,color:n}},((r=e.price)%1==0?r.toString():r.toFixed(2))+"€")),e.description&&i("p",{class:"dish-description",style:{fontFamily:s}},e.description));var r}))))):null})))))}get el(){return t(this)}};r.style=".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}";export{r as veleta_boston_template}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,e,r){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,o){function
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,e,r){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,o){function u(t){try{c(r.next(t))}catch(t){o(t)}}function a(t){try{c(r["throw"](t))}catch(t){o(t)}}function c(t){t.done?e(t.value):i(t.value).then(u,a)}c((r=r.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=a(0),u["throw"]=a(1),u["return"]=a(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(t){return function(n){return c([t,n])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(e=0)),e)try{if(r=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:e.label++;return{value:a[1],done:false};case 5:e.label++;i=a[1];a=[0];continue;case 7:a=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){e.label=a[1];break}if(a[0]===6&&e.label<o[1]){e.label=o[1];o=a;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(a);break}if(o[2])e.ops.pop();e.trys.pop();continue}a=n.call(t,e)}catch(t){a=[6,t];i=0}finally{r=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-D3ESHVSd.system.js","./p-BbPAtVJG.system.js"],(function(t,n){"use strict";var e,r,i;return{setters:[function(n){e=n.p;r=n.b;t("setNonce",n.s)},function(t){i=t.g}],execute:function(){var t=this;var o=function(){var t=n.meta.url;var r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};o().then((function(n){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,i()];case 1:t.sent();return[2,r([["p-2a61ffe8.system",[[256,"veleta-boston-template",{dataJson:[1,"data-json"],data:[16]}]]]],n)]}}))}))}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as a,b as t}from"./p-zOTWMTLj.js";export{s as setNonce}from"./p-zOTWMTLj.js";import{g as o}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,s={};return""!==t&&(s.resourcesUrl=new URL(".",t).href),a(s)})().then((async a=>(await o(),t([["p-64db36d4",[[256,"veleta-boston-template",{dataJson:[1,"data-json"],data:[16]}]]]],a))));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as i,g as t}from"./p-zOTWMTLj.js";const r=class{constructor(i){e(this,i),this.dataJson="{}",this.fontConfig={google:{families:["Oswald:400,600,700","Merriweather:300,400,700"]}}}async componentWillLoad(){var e;await async function(e){if(!e||!e.google&&!e.custom)return Promise.resolve();try{const i=await import("./p-DjUJwx0S.js").then((function(e){return e.w})),t=i.default||i;return t&&"function"==typeof t.load?new Promise((i=>{const r=Object.assign(Object.assign({},e),{active:()=>{e.active&&e.active(),i()},inactive:()=>{e.inactive&&e.inactive(),i()}});t.load(r)})):(console.warn("webfontloader no está disponible o no tiene el método load"),Promise.resolve())}catch(e){return console.error("Error loading webfontloader:",e),Promise.resolve()}}(this.fontConfig),(e=this.el)&&(e.style.fontFamily="Merriweather, serif")}componentDidLoad(){this.initObserver()}componentDidUpdate(){this.initObserver()}disconnectedCallback(){this.observer&&this.observer.disconnect()}initObserver(){this.observer&&this.observer.disconnect(),this.observer=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const i=e.target;i.classList.add("is-visible"),this.observer.unobserve(i)}}))}),{threshold:.1,rootMargin:"0px 0px -50px 0px"}),this.el.querySelectorAll(".animate-item").forEach((e=>this.observer.observe(e)))}render(){var e;let t=null;try{t=JSON.parse(this.dataJson)}catch(e){console.warn("Invalid dataJson provided to veleta-boston-template")}const r=null===(e=null==t?void 0:t.templateData)||void 0===e?void 0:e.theme,n=(null==r?void 0:r.primaryColor)||"#1a365d",a=(null==r?void 0:r.backgroundColor)||"#FFFFFF",s="Merriweather, serif",o="Oswald, sans-serif";if(!t)return i("div",{class:"menu-wrapper",style:{color:n,backgroundColor:a}});const{sections:m,business:l}=t,p=(m||[]).sort(((e,i)=>e.order-i.order));return i("div",{class:"menu-wrapper",style:{color:n,backgroundColor:a}},i("div",{class:"menu-container"},(null==l?void 0:l.name)&&i("header",{class:"menu-header"},i("h1",{class:"restaurant-title animate-item",style:{fontFamily:o}},l.name)),i("div",{class:"sections-container"},p.map((e=>{const t=(e.dishes||[]).sort(((e,i)=>e.order-i.order));return t.length?i("section",{key:e.id,class:"menu-section animate-item"},i("div",{class:"section-label-wrapper"},i("div",{class:"section-label-line",style:{borderColor:n}}),i("h2",{class:"section-label",style:{fontFamily:o,color:n}},e.title)),i("div",{class:"section-content"},e.description&&i("p",{class:"section-description",style:{fontFamily:s}},e.description),i("ul",{class:"dishes-list"},t.map(((e,t)=>{return i("li",{key:e.id,class:"dish-item animate-item",style:{transitionDelay:50*t+"ms"}},i("div",{class:"dish-header"},i("h3",{class:"dish-name",style:{fontFamily:o,color:n}},e.name),i("div",{class:"dish-dots"}),i("span",{class:"dish-price",style:{fontFamily:o,color:n}},((r=e.price)%1==0?r.toString():r.toFixed(2))+"€")),e.description&&i("p",{class:"dish-description",style:{fontFamily:s}},e.description));var r}))))):null})))))}get el(){return t(this)}};r.style=".menu-wrapper{min-height:100vh;width:100%;padding:1.5rem 1rem;font-family:'Merriweather', serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;display:block}.menu-wrapper *,.menu-wrapper *::before,.menu-wrapper *::after{-webkit-box-sizing:border-box;box-sizing:border-box}.animate-item{opacity:0;-webkit-transform:translateY(30px);transform:translateY(30px);-webkit-transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, -webkit-transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out;transition:opacity 0.8s ease-out, transform 0.8s ease-out, -webkit-transform 0.8s ease-out;will-change:opacity, transform}.animate-item.is-visible{opacity:1;-webkit-transform:translateY(0);transform:translateY(0)}.menu-wrapper h1,.menu-wrapper h2,.menu-wrapper h3,.menu-wrapper h4,.menu-wrapper h5,.menu-wrapper h6,.menu-wrapper p,.menu-wrapper ul,.menu-wrapper ol,.menu-wrapper li,.menu-wrapper header,.menu-wrapper section,.menu-wrapper article,.menu-wrapper aside,.menu-wrapper nav,.menu-wrapper blockquote,.menu-wrapper figure,.menu-wrapper figcaption{margin:0;-webkit-margin-before:0;margin-block-start:0;-webkit-margin-after:0;margin-block-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:0;margin-inline-end:0}.menu-wrapper ul,.menu-wrapper ol{padding:0}@media (min-width: 640px){.menu-wrapper{padding:2rem 1.5rem}}@media (min-width: 768px){.menu-wrapper{padding:2rem 1rem}}.menu-container{max-width:1280px;margin:0 auto}.menu-header{text-align:center}@media (min-width: 768px){.menu-header{margin-bottom:3rem}}.restaurant-title{font-size:2rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;line-height:1.1;margin:0 0 1.5rem 0 !important}@media (min-width: 640px){.restaurant-title{font-size:2.5rem;margin:0 0 3rem 0 !important}}@media (min-width: 768px){.restaurant-title{font-size:3rem}}@media (min-width: 1024px){.restaurant-title{font-size:3.5rem}}.sections-container{display:grid;grid-template-columns:1fr;gap:4rem}@media (min-width: 768px){.sections-container{grid-template-columns:repeat(2, 1fr);gap:3rem}}.menu-section{display:-ms-flexbox;display:flex;width:100%;position:relative}.section-label-wrapper{position:relative;width:3rem;-ms-flex-negative:0;flex-shrink:0;margin-right:1rem;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.section-label-line{position:absolute;right:0;top:0;bottom:0;width:1px;border-right:1px solid}.section-label{font-weight:700;font-size:1.125rem;text-transform:uppercase;letter-spacing:0.15em;-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;-webkit-transform:rotate(180deg);transform:rotate(180deg);text-align:right;white-space:nowrap;margin:0 0 0.5rem 0;-webkit-margin-after:0.5rem;margin-block-end:0.5rem;position:absolute;top:0}@media (min-width: 640px){.section-label{font-size:1.2375rem}}@media (min-width: 768px){.section-label{font-size:1.35rem}}@media (min-width: 1024px){.section-label{font-size:1.51875rem}}.section-content{-ms-flex:1;flex:1;padding-top:0.25rem}.section-description{font-size:0.875rem;font-style:italic;margin:0 0 1rem 0 !important;-webkit-margin-after:1rem;margin-block-end:1rem;opacity:0.75;color:inherit}@media (min-width: 640px){.section-description{font-size:0.9625rem}}@media (min-width: 768px){.section-description{font-size:1.05rem}}@media (min-width: 1024px){.section-description{font-size:1.18125rem}}.dishes-list{list-style:none;padding:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem}.dish-item{position:relative}.dish-header{display:-ms-flexbox;display:flex;-ms-flex-align:baseline;align-items:baseline;width:100%;gap:0.5rem}.dish-name{font-size:1rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em;-ms-flex-negative:1;flex-shrink:1;min-width:0;overflow-wrap:break-word}@media (min-width: 640px){.dish-name{font-size:1.1rem}}@media (min-width: 768px){.dish-name{font-size:1.2rem}}@media (min-width: 1024px){.dish-name{font-size:1.35rem}}.dish-dots{-ms-flex:1;flex:1;opacity:0.25;border-bottom:2px dotted;margin:0 0.55rem;position:relative;-webkit-transform:translateY(-5px);transform:translateY(-5px);border-color:currentColor;min-width:1rem}.dish-price{font-size:1rem;font-weight:700;-ms-flex-negative:0;flex-shrink:0;text-align:right;min-width:3ch}@media (min-width: 640px){.dish-price{font-size:1.1rem}}@media (min-width: 768px){.dish-price{font-size:1.2rem}}@media (min-width: 1024px){.dish-price{font-size:1.35rem}}.dish-description{font-size:0.8125rem;margin-top:0.25rem;line-height:1.4;opacity:0.7;color:inherit;width:100%}@media (min-width: 640px){.dish-description{font-size:0.9425rem}}";export{r as veleta_boston_template}
|