From d4980d93db0718381d2ffeded0a3969dd0b9b8ec Mon Sep 17 00:00:00 2001 From: Ingo Fahrentholz Date: Mon, 5 Feb 2024 22:49:59 +0100 Subject: [PATCH] WIP --- dist/__chunks__/icon.tfEDDx5q.js | 28 +++++++++++++++++++ dist/__chunks__/icon.tfEDDx5q.js.map | 1 + dist/__chunks__/preload-helper.hlDPvxQM.js | 2 -- .../__chunks__/preload-helper.hlDPvxQM.js.map | 1 - dist/features/features.js | 28 +------------------ dist/features/features.js.map | 2 +- dist/main/main.js | 4 +-- dist/main/main.js.map | 2 +- src/components/icon.ts | 1 + src/components/sidebar/sidebarNav.ts | 4 ++- types/components/sidebar/sidebarNav.d.ts | 1 + 11 files changed, 39 insertions(+), 35 deletions(-) create mode 100644 dist/__chunks__/icon.tfEDDx5q.js create mode 100644 dist/__chunks__/icon.tfEDDx5q.js.map delete mode 100644 dist/__chunks__/preload-helper.hlDPvxQM.js delete mode 100644 dist/__chunks__/preload-helper.hlDPvxQM.js.map diff --git a/dist/__chunks__/icon.tfEDDx5q.js b/dist/__chunks__/icon.tfEDDx5q.js new file mode 100644 index 00000000..6bb6265b --- /dev/null +++ b/dist/__chunks__/icon.tfEDDx5q.js @@ -0,0 +1,28 @@ +import{w as g,i as b,s as O,x as I}from"./lit-element.XkUWx5ik.js";import{n as S,t as L}from"./property.0daVBkvz.js";import{e as R,a as y,i as T,t as V}from"./unsafe-html.dKgBHtsI.js";const D="modulepreload",N=function(t){return"/"+t},p={},_=function(e,s,n){let r=Promise.resolve();if(s&&s.length>0){const o=document.getElementsByTagName("link");r=Promise.all(s.map(i=>{if(i=N(i),i in p)return;p[i]=!0;const c=i.endsWith(".css"),a=c?'[rel="stylesheet"]':"";if(!!n)for(let l=o.length-1;l>=0;l--){const d=o[l];if(d.href===i&&(!c||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${a}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":D,c||(h.as="script",h.crossOrigin=""),h.href=i,document.head.appendChild(h),c)return new Promise((l,d)=>{h.addEventListener("load",l),h.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${i}`)))})}))}return r.then(()=>e()).catch(o=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o})};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class v extends R{}v.directiveName="unsafeSVG",v.resultType=2;const x=y(v);/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const k=t=>t===null||typeof t!="object"&&typeof t!="function",M=t=>t.strings===void 0;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const u=(t,e)=>{var n;const s=t._$AN;if(s===void 0)return!1;for(const r of s)(n=r._$AO)==null||n.call(r,e,!1),u(r,e);return!0},$=t=>{let e,s;do{if((e=t._$AM)===void 0)break;s=e._$AN,s.delete(t),t=e}while((s==null?void 0:s.size)===0)},E=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(s===void 0)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),K(e)}};function q(t){this._$AN!==void 0?($(this),this._$AM=t,E(this)):this._$AM=t}function j(t,e=!1,s=0){const n=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(e)if(Array.isArray(n))for(let o=s;o{t.type==V.CHILD&&(t._$AP??(t._$AP=j),t._$AQ??(t._$AQ=q))};class X extends T{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,s,n){super._$AT(e,s,n),E(this),this.isConnected=e._$AU}_$AO(e,s=!0){var n,r;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)==null||n.call(this):(r=this.disconnected)==null||r.call(this)),s&&(u(this,e),$(this))}setValue(e){if(M(this._$Ct))this._$Ct._$AI(e,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=e,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class Y{constructor(e){this.Y=e}disconnect(){this.Y=void 0}reconnect(e){this.Y=e}deref(){return this.Y}}class Z{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??(this.Z=new Promise(e=>this.q=e))}resume(){var e;(e=this.q)==null||e.call(this),this.Z=this.q=void 0}}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const C=t=>!k(t)&&typeof t.then=="function",A=1073741823;class B extends X{constructor(){super(...arguments),this._$Cwt=A,this._$Cbt=[],this._$CK=new Y(this),this._$CX=new Z}render(...e){return e.find(s=>!C(s))??g}update(e,s){const n=this._$Cbt;let r=n.length;this._$Cbt=s;const o=this._$CK,i=this._$CX;this.isConnected||this.disconnected();for(let c=0;cthis._$Cwt);c++){const a=s[c];if(!C(a))return this._$Cwt=c,a;c{for(;i.get();)await i.get();const h=o.deref();if(h!==void 0){const l=h._$Cbt.indexOf(a);l>-1&&l{for(var r=n>1?void 0:n?z(e,s):e,o=t.length-1,i;o>=0;o--)(i=t[o])&&(r=(n?i(e,s,r):i(r))||r);return n&&r&&U(e,s,r),r};const w=Object.assign({"/src/icons/building-storefront.svg":()=>_(()=>import("./building-storefront.GI5O3UY2.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/chat-bubble-left-right.svg":()=>_(()=>import("./chat-bubble-left-right.RdWapjj4.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/chevron-down.svg":()=>_(()=>import("./chevron-down.6_gNiehw.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/cpu-chip.svg":()=>_(()=>import("./cpu-chip.e4997-9R.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/cursor-arrow-ripple.svg":()=>_(()=>import("./cursor-arrow-ripple.5f05fUdo.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/hamburger.svg":()=>_(()=>import("./hamburger.B4eeRdlK.js"),__vite__mapDeps([])).then(t=>t.default)});let f=class extends O{constructor(){super(...arguments),this.name=""}async getSvg(t){const e=w[`/src/icons/${t}.svg`],s=e!==void 0?e:w["/src/icons/cross.svg"];console.log("🚀 ~ Icon ~ getSvg ~ key:",e);const n=await s().catch(r=>console.error(`SVG icon: ${r.message}`));return x(n)}render(){const t=this.getSvg(this.name);return I`${H(t)}`}};f.styles=b`:host{display:flex;align-items:center}svg{width:100%;height:auto}`;P([S({type:String})],f.prototype,"name",2);f=P([L("icon-component")],f);export{_}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +//# sourceMappingURL=icon.tfEDDx5q.js.map diff --git a/dist/__chunks__/icon.tfEDDx5q.js.map b/dist/__chunks__/icon.tfEDDx5q.js.map new file mode 100644 index 00000000..e012cbd6 --- /dev/null +++ b/dist/__chunks__/icon.tfEDDx5q.js.map @@ -0,0 +1 @@ +{"version":3,"mappings":"miCACA;AAAA;AAAA;AAAA;AAAA,GAIG,MAAMA,UAAUC,CAAC,EAAED,EAAE,cAAc,YAAYA,EAAE,WAAW,EAAE,MAAME,EAAEC,EAAEH,CAAC,ECJ5E;AAAA;AAAA;AAAA;AAAA,GAIO,MAASI,EAAEF,GAAUA,IAAP,MAAoB,OAAOA,GAAjB,UAAgC,OAAOA,GAAnB,WAAwLG,EAAEH,GAAYA,EAAE,UAAX,OCJhP;AAAA;AAAA;AAAA;AAAA,GAIG,MAAMC,EAAE,CAACC,EAAEJ,IAAI,OAAC,MAAMC,EAAEG,EAAE,KAAK,GAAYH,IAAT,OAAW,MAAM,GAAG,UAAUG,KAAKH,GAAEK,EAAAF,EAAE,OAAF,MAAAE,EAAA,KAAAF,EAASJ,EAAE,IAAIG,EAAEC,EAAEJ,CAAC,EAAE,MAAM,EAAE,EAAEE,EAAEE,GAAG,CAAC,IAAIJ,EAAEC,EAAE,EAAE,CAAC,IAAaD,EAAEI,EAAE,QAAd,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I,4BAA6BI,CAAG,EAC5C,MAAME,EAAa,MAAMD,EAAe,EAAE,MAAOjB,GAAa,QAAQ,MAAM,aAAaA,EAAE,OAAO,EAAE,CAAC,EACrG,OAAOmB,EAAUD,CAAoB,CACvC,CAEA,QAAS,CACP,MAAME,EAAM,KAAK,OAAO,KAAK,IAAI,EAC1B,OAAAC,IAAOC,EAAMF,CAAG,CAAC,EAC1B,CAaF,EA5BaP,EAiBJ,OAASU,qEAfhBC,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,GADfZ,EAEX,oBAFWA,EAANW,EAAA,CADNE,EAAc,gBAAgB,GAClBb,CAAA","names":["t","e","o","s","i","f","_a","r","c","h","n","_b","m","modules","Icon","LitElement","name","key","iconMarkupFunc","iconMarkup","unsafeSVG","svg","html","until","css","__decorateClass","property","customElement"],"sources":["../../node_modules/lit-html/directives/unsafe-svg.js","../../node_modules/lit-html/directive-helpers.js","../../node_modules/lit-html/async-directive.js","../../node_modules/lit-html/directives/private-async-helpers.js","../../node_modules/lit-html/directives/until.js","../../src/components/icon.ts"],"sourcesContent":["import{directive as s}from\"../directive.js\";import{UnsafeHTMLDirective as e}from\"./unsafe-html.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class t extends e{}t.directiveName=\"unsafeSVG\",t.resultType=2;const o=s(t);export{o as unsafeSVG};\n//# sourceMappingURL=unsafe-svg.js.map\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,n={HTML:1,SVG:2},e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,l=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,d=o=>o?._$litDirective$,f=o=>void 0===o.strings,s=()=>document.createComment(\"\"),r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(s(),l),c=e.insertBefore(s(),l);n=new t(i,c,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}}return n},v=(o,t,i=o)=>(o._$AI(t,i),o),u={},m=(o,t=u)=>o._$AH=t,p=o=>o._$AH,h=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},j=o=>{o._$AR()};export{n as TemplateResultType,j as clearPart,p as getCommittedValue,d as getDirectiveClass,r as insertPart,l as isCompiledTemplateResult,c as isDirectiveResult,i as isPrimitive,f as isSingleExpression,e as isTemplateResult,h as removePart,v as setChildPartValue,m as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{Directive,PartType,directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective};\n//# sourceMappingURL=async-directive.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=async(t,s)=>{for await(const i of t)if(!1===await s(i))return};class s{constructor(t){this.Y=t}disconnect(){this.Y=void 0}reconnect(t){this.Y=t}deref(){return this.Y}}class i{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??=new Promise((t=>this.q=t))}resume(){this.q?.(),this.Z=this.q=void 0}}export{i as Pauser,s as PseudoWeakRef,t as forAwaitOf};\n//# sourceMappingURL=private-async-helpers.js.map\n","import{noChange as t}from\"../lit-html.js\";import{isPrimitive as s}from\"../directive-helpers.js\";import{AsyncDirective as i}from\"../async-directive.js\";import{PseudoWeakRef as e,Pauser as r}from\"./private-async-helpers.js\";import{directive as o}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const n=t=>!s(t)&&\"function\"==typeof t.then,h=1073741823;class c extends i{constructor(){super(...arguments),this._$Cwt=h,this._$Cbt=[],this._$CK=new e(this),this._$CX=new r}render(...s){return s.find((t=>!n(t)))??t}update(s,i){const e=this._$Cbt;let r=e.length;this._$Cbt=i;const o=this._$CK,c=this._$CX;this.isConnected||this.disconnected();for(let t=0;tthis._$Cwt);t++){const s=i[t];if(!n(s))return this._$Cwt=t,s;t{for(;c.get();)await c.get();const i=o.deref();if(void 0!==i){const e=i._$Cbt.indexOf(s);e>-1&&e console.error(`SVG icon: ${e.message}`));\n return unsafeSVG(iconMarkup as string);\n }\n\n render() {\n const svg = this.getSvg(this.name);\n return html`${until(svg)}`;\n }\n\n static styles = css`\n :host {\n display: flex;\n align-items: center;\n }\n\n svg {\n width: 100%;\n height: auto;\n }\n `;\n}\n"],"file":"__chunks__/icon.tfEDDx5q.js"} \ No newline at end of file diff --git a/dist/__chunks__/preload-helper.hlDPvxQM.js b/dist/__chunks__/preload-helper.hlDPvxQM.js deleted file mode 100644 index b01b71da..00000000 --- a/dist/__chunks__/preload-helper.hlDPvxQM.js +++ /dev/null @@ -1,2 +0,0 @@ -const d="modulepreload",m=function(i){return"/"+i},c={},E=function(u,l,f){let a=Promise.resolve();if(l&&l.length>0){const n=document.getElementsByTagName("link");a=Promise.all(l.map(e=>{if(e=m(e),e in c)return;c[e]=!0;const r=e.endsWith(".css"),h=r?'[rel="stylesheet"]':"";if(!!f)for(let s=n.length-1;s>=0;s--){const o=n[s];if(o.href===e&&(!r||o.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${h}`))return;const t=document.createElement("link");if(t.rel=r?"stylesheet":d,r||(t.as="script",t.crossOrigin=""),t.href=e,document.head.appendChild(t),r)return new Promise((s,o)=>{t.addEventListener("load",s),t.addEventListener("error",()=>o(new Error(`Unable to preload CSS for ${e}`)))})}))}return a.then(()=>u()).catch(n=>{const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=n,window.dispatchEvent(e),!e.defaultPrevented)throw n})};export{E as _}; -//# sourceMappingURL=preload-helper.hlDPvxQM.js.map diff --git a/dist/__chunks__/preload-helper.hlDPvxQM.js.map b/dist/__chunks__/preload-helper.hlDPvxQM.js.map deleted file mode 100644 index 8b8edf93..00000000 --- a/dist/__chunks__/preload-helper.hlDPvxQM.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"preload-helper.hlDPvxQM.js","sources":[],"sourcesContent":[],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/features/features.js b/dist/features/features.js index f55a4968..6578ed49 100644 --- a/dist/features/features.js +++ b/dist/features/features.js @@ -1,28 +1,2 @@ -import{w as v,i as O,s as E,x as f,j as b}from"../__chunks__/lit-element.XkUWx5ik.js";import{e as T,a as C,i as x,t as I,o as L}from"../__chunks__/unsafe-html.dKgBHtsI.js";import{_ as h}from"../__chunks__/preload-helper.hlDPvxQM.js";import{n as M,t as V}from"../__chunks__/property.0daVBkvz.js";/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */class p extends T{}p.directiveName="unsafeSVG",p.resultType=2;const D=C(p);/** - * @license - * Copyright 2020 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const N=t=>t===null||typeof t!="object"&&typeof t!="function",S=t=>t.strings===void 0;/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const d=(t,s)=>{var n;const e=t._$AN;if(e===void 0)return!1;for(const i of e)(n=i._$AO)==null||n.call(i,s,!1),d(i,s);return!0},u=t=>{let s,e;do{if((s=t._$AM)===void 0)break;e=s._$AN,e.delete(t),t=s}while((e==null?void 0:e.size)===0)},w=t=>{for(let s;s=t._$AM;t=s){let e=s._$AN;if(e===void 0)s._$AN=e=new Set;else if(e.has(t))break;e.add(t),j(s)}};function H(t){this._$AN!==void 0?(u(this),this._$AM=t,w(this)):this._$AM=t}function R(t,s=!1,e=0){const n=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(s)if(Array.isArray(n))for(let o=e;o{t.type==I.CHILD&&(t._$AP??(t._$AP=R),t._$AQ??(t._$AQ=H))};class q extends x{constructor(){super(...arguments),this._$AN=void 0}_$AT(s,e,n){super._$AT(s,e,n),w(this),this.isConnected=s._$AU}_$AO(s,e=!0){var n,i;s!==this.isConnected&&(this.isConnected=s,s?(n=this.reconnected)==null||n.call(this):(i=this.disconnected)==null||i.call(this)),e&&(d(this,s),u(this))}setValue(s){if(S(this._$Ct))this._$Ct._$AI(s,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=s,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */class K{constructor(s){this.Y=s}disconnect(){this.Y=void 0}reconnect(s){this.Y=s}deref(){return this.Y}}class X{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??(this.Z=new Promise(s=>this.q=s))}resume(){var s;(s=this.q)==null||s.call(this),this.Z=this.q=void 0}}/** - * @license - * Copyright 2017 Google LLC - * SPDX-License-Identifier: BSD-3-Clause - */const m=t=>!N(t)&&typeof t.then=="function",g=1073741823;class Y extends q{constructor(){super(...arguments),this._$Cwt=g,this._$Cbt=[],this._$CK=new K(this),this._$CX=new X}render(...s){return s.find(e=>!m(e))??v}update(s,e){const n=this._$Cbt;let i=n.length;this._$Cbt=e;const o=this._$CK,c=this._$CX;this.isConnected||this.disconnected();for(let r=0;rthis._$Cwt);r++){const _=e[r];if(!m(_))return this._$Cwt=r,_;r{for(;c.get();)await c.get();const a=o.deref();if(a!==void 0){const l=a._$Cbt.indexOf(_);l>-1&&l{for(var i=n>1?void 0:n?B(s,e):s,o=t.length-1,c;o>=0;o--)(c=t[o])&&(i=(n?c(s,e,i):c(i))||i);return n&&i&&z(s,e,i),i};const A=Object.assign({"/src/icons/building-storefront.svg":()=>h(()=>import("../__chunks__/building-storefront.GI5O3UY2.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/chat-bubble-left-right.svg":()=>h(()=>import("../__chunks__/chat-bubble-left-right.RdWapjj4.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/chevron-down.svg":()=>h(()=>import("../__chunks__/chevron-down.6_gNiehw.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/cpu-chip.svg":()=>h(()=>import("../__chunks__/cpu-chip.e4997-9R.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/cursor-arrow-ripple.svg":()=>h(()=>import("../__chunks__/cursor-arrow-ripple.5f05fUdo.js"),__vite__mapDeps([])).then(t=>t.default),"/src/icons/hamburger.svg":()=>h(()=>import("../__chunks__/hamburger.B4eeRdlK.js"),__vite__mapDeps([])).then(t=>t.default)});let $=class extends E{constructor(){super(...arguments),this.name=""}async getSvg(t){const s=A[`/src/icons/${t}.svg`],n=await(s!==void 0?s:A["/src/icons/cross.svg"])().catch(i=>console.error(`SVG icon: ${i.message}`));return D(n)}render(){const t=this.getSvg(this.name);return f`${Z(t)}`}};$.styles=O`:host{display:flex;align-items:center}svg{width:100%;height:auto}`;y([M({type:String})],$.prototype,"name",2);$=y([V("icon-component")],$);const F=t=>f`${t.map(s=>f`
${L(s.textBlock)}
`)}`;function J(t){const s=t.querySelectorAll(":scope > div");let e=[];[...s].forEach(n=>{const i=n.children[0].innerHTML,o=n.children[1].innerHTML;e.push({icon:i,textBlock:o})}),t.innerHTML="",t.style.removeProperty("display"),b(F(e),t)}export{J as default}; -function __vite__mapDeps(indexes) { - if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = [] - } - return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) -} +import{j as s,x as c}from"../__chunks__/lit-element.XkUWx5ik.js";import{o as a}from"../__chunks__/unsafe-html.dKgBHtsI.js";import"../__chunks__/icon.tfEDDx5q.js";import"../__chunks__/property.0daVBkvz.js";const p=n=>c`${n.map(e=>c`
${a(e.textBlock)}
`)}`;function u(n){const e=n.querySelectorAll(":scope > div");let t=[];[...e].forEach(o=>{const r=o.children[0].innerHTML,i=o.children[1].innerHTML;t.push({icon:r,textBlock:i})}),n.innerHTML="",n.style.removeProperty("display"),s(p(t),n)}export{u as default}; //# sourceMappingURL=features.js.map diff --git a/dist/features/features.js.map b/dist/features/features.js.map index 4f9bf6d1..d858cd63 100644 --- a/dist/features/features.js.map +++ b/dist/features/features.js.map @@ -1 +1 @@ -{"version":3,"mappings":"uSACA;AAAA;AAAA;AAAA;AAAA,GAIG,MAAMA,UAAUC,CAAC,EAAED,EAAE,cAAc,YAAYA,EAAE,WAAW,EAAE,MAAME,EAAEC,EAAEH,CAAC,EC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EAC7BK,EAAAT,EAASC,CAAQ,EAAGG,CAAK,CAClC","names":["t","e","o","s","i","f","_a","r","c","h","n","_b","m","modules","Icon","LitElement","name","key","iconMarkup","unsafeSVG","svg","html","until","css","__decorateClass","property","customElement","template","features","feature","unsafeHTML","block","rows","row","icon","textBlock","render"],"sources":["../../node_modules/lit-html/directives/unsafe-svg.js","../../node_modules/lit-html/directive-helpers.js","../../node_modules/lit-html/async-directive.js","../../node_modules/lit-html/directives/private-async-helpers.js","../../node_modules/lit-html/directives/until.js","../../src/components/icon.ts","../../src/blocks/features/features.ts"],"sourcesContent":["import{directive as s}from\"../directive.js\";import{UnsafeHTMLDirective as e}from\"./unsafe-html.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class t extends e{}t.directiveName=\"unsafeSVG\",t.resultType=2;const o=s(t);export{o as unsafeSVG};\n//# sourceMappingURL=unsafe-svg.js.map\n","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,n={HTML:1,SVG:2},e=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,l=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,d=o=>o?._$litDirective$,f=o=>void 0===o.strings,s=()=>document.createComment(\"\"),r=(o,i,n)=>{const e=o._$AA.parentNode,l=void 0===i?o._$AB:i._$AA;if(void 0===n){const i=e.insertBefore(s(),l),c=e.insertBefore(s(),l);n=new t(i,c,o,o.options)}else{const t=n._$AB.nextSibling,i=n._$AM,c=i!==o;if(c){let t;n._$AQ?.(o),n._$AM=o,void 0!==n._$AP&&(t=o._$AU)!==i._$AU&&n._$AP(t)}if(t!==l||c){let o=n._$AA;for(;o!==t;){const t=o.nextSibling;e.insertBefore(o,l),o=t}}}return n},v=(o,t,i=o)=>(o._$AI(t,i),o),u={},m=(o,t=u)=>o._$AH=t,p=o=>o._$AH,h=o=>{o._$AP?.(!1,!0);let t=o._$AA;const i=o._$AB.nextSibling;for(;t!==i;){const o=t.nextSibling;t.remove(),t=o}},j=o=>{o._$AR()};export{n as TemplateResultType,j as clearPart,p as getCommittedValue,d as getDirectiveClass,r as insertPart,l as isCompiledTemplateResult,c as isDirectiveResult,i as isPrimitive,f as isSingleExpression,e as isTemplateResult,h as removePart,v as setChildPartValue,m as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{Directive,PartType,directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective};\n//# sourceMappingURL=async-directive.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=async(t,s)=>{for await(const i of t)if(!1===await s(i))return};class s{constructor(t){this.Y=t}disconnect(){this.Y=void 0}reconnect(t){this.Y=t}deref(){return this.Y}}class i{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??=new Promise((t=>this.q=t))}resume(){this.q?.(),this.Z=this.q=void 0}}export{i as Pauser,s as PseudoWeakRef,t as forAwaitOf};\n//# sourceMappingURL=private-async-helpers.js.map\n","import{noChange as t}from\"../lit-html.js\";import{isPrimitive as s}from\"../directive-helpers.js\";import{AsyncDirective as i}from\"../async-directive.js\";import{PseudoWeakRef as e,Pauser as r}from\"./private-async-helpers.js\";import{directive as o}from\"../directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const n=t=>!s(t)&&\"function\"==typeof t.then,h=1073741823;class c extends i{constructor(){super(...arguments),this._$Cwt=h,this._$Cbt=[],this._$CK=new e(this),this._$CX=new r}render(...s){return s.find((t=>!n(t)))??t}update(s,i){const e=this._$Cbt;let r=e.length;this._$Cbt=i;const o=this._$CK,c=this._$CX;this.isConnected||this.disconnected();for(let t=0;tthis._$Cwt);t++){const s=i[t];if(!n(s))return this._$Cwt=t,s;t{for(;c.get();)await c.get();const i=o.deref();if(void 0!==i){const e=i._$Cbt.indexOf(s);e>-1&&e console.error(`SVG icon: ${e.message}`));\n return unsafeSVG(iconMarkup as string);\n }\n\n render() {\n const svg = this.getSvg(this.name);\n return html`${until(svg)}`;\n }\n\n static styles = css`\n :host {\n display: flex;\n align-items: center;\n }\n\n svg {\n width: 100%;\n height: auto;\n }\n `;\n}\n","import { html, render } from 'lit';\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js';\n\nimport '../../components/icon';\n\ninterface Feature {\n icon: string;\n textBlock: string;\n}\n\ntype TemplateArgs = Feature[];\n\nconst template = (features: TemplateArgs) => {\n return html`\n ${features.map(\n (feature) => html`\n
\n \n
${unsafeHTML(feature.textBlock)}
\n
\n `\n )}\n `;\n};\n\nexport default function (block: HTMLElement) {\n const rows = block.querySelectorAll(':scope > div');\n let features: Feature[] = [];\n [...rows].forEach((row) => {\n const icon = row.children[0].innerHTML;\n const textBlock = row.children[1].innerHTML;\n features.push({ icon, textBlock });\n });\n\n block.innerHTML = '';\n\n block.style.removeProperty('display');\n render(template(features), block);\n}\n"],"file":"features/features.js"} \ No newline at end of file +{"version":3,"file":"features.js","sources":["../../src/blocks/features/features.ts"],"sourcesContent":["import { html, render } from 'lit';\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js';\n\nimport '../../components/icon';\n\ninterface Feature {\n icon: string;\n textBlock: string;\n}\n\ntype TemplateArgs = Feature[];\n\nconst template = (features: TemplateArgs) => {\n return html`\n ${features.map(\n (feature) => html`\n
\n \n
${unsafeHTML(feature.textBlock)}
\n
\n `\n )}\n `;\n};\n\nexport default function (block: HTMLElement) {\n const rows = block.querySelectorAll(':scope > div');\n let features: Feature[] = [];\n [...rows].forEach((row) => {\n const icon = row.children[0].innerHTML;\n const textBlock = row.children[1].innerHTML;\n features.push({ icon, textBlock });\n });\n\n block.innerHTML = '';\n\n block.style.removeProperty('display');\n render(template(features), block);\n}\n"],"names":["template","features","html","feature","unsafeHTML","block","rows","row","icon","textBlock","render"],"mappings":"6MAYA,MAAMA,EAAYC,GACTC,IACHD,EAAS,IACRE,GAAYD,sEAEkDC,EAAQ,IAAI,kDAChDC,EAAWD,EAAQ,SAAS,CAAC,kBAGzD,CAAA,GAIL,SAAAF,EAAyBI,EAAoB,CACrC,MAAAC,EAAOD,EAAM,iBAAiB,cAAc,EAClD,IAAIJ,EAAsB,CAAA,EAC1B,CAAC,GAAGK,CAAI,EAAE,QAASC,GAAQ,CACzB,MAAMC,EAAOD,EAAI,SAAS,CAAC,EAAE,UACvBE,EAAYF,EAAI,SAAS,CAAC,EAAE,UAClCN,EAAS,KAAK,CAAE,KAAAO,EAAM,UAAAC,CAAW,CAAA,CAAA,CAClC,EAEDJ,EAAM,UAAY,GAEZA,EAAA,MAAM,eAAe,SAAS,EAC7BK,EAAAV,EAASC,CAAQ,EAAGI,CAAK,CAClC"} \ No newline at end of file diff --git a/dist/main/main.js b/dist/main/main.js index 5d1b7b93..11a8aeb1 100644 --- a/dist/main/main.js +++ b/dist/main/main.js @@ -1,4 +1,4 @@ -import{_ as C}from"../__chunks__/preload-helper.hlDPvxQM.js";import{s as b,x as d}from"../__chunks__/lit-element.XkUWx5ik.js";import{n as E,t as S}from"../__chunks__/property.0daVBkvz.js";function h(n){return typeof n=="string"?n.toLowerCase().replace(/[^0-9a-z]/gi,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):""}const v=(n,e)=>{e.split(",").forEach(t=>{n.classList.add(h(t.trim()))})};function g(n,e=document){const t=n&&n.includes(":")?"property":"name",s=[...e.head.querySelectorAll(`meta[${t}="${n}"]`)].map(i=>i.content).join(", ");return s.length?s:""}function L(n){return h(n).replace(/-([a-z])/g,e=>e[1].toUpperCase())}/** +import{_ as C}from"../__chunks__/icon.tfEDDx5q.js";import{s as b,x as d}from"../__chunks__/lit-element.XkUWx5ik.js";import{n as E,t as S}from"../__chunks__/property.0daVBkvz.js";import"../__chunks__/unsafe-html.dKgBHtsI.js";function h(n){return typeof n=="string"?n.toLowerCase().replace(/[^0-9a-z]/gi,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):""}const v=(n,e)=>{e.split(",").forEach(t=>{n.classList.add(h(t.trim()))})};function g(n,e=document){const t=n&&n.includes(":")?"property":"name",s=[...e.head.querySelectorAll(`meta[${t}="${n}"]`)].map(a=>a.content).join(", ");return s.length?s:""}function L(n){return h(n).replace(/-([a-z])/g,e=>e[1].toUpperCase())}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -10,7 +10,7 @@ import{_ as C}from"../__chunks__/preload-helper.hlDPvxQM.js";import{s as b,x as * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function P(n,e){return(t,a,s)=>{const i=o=>{var c;return((c=o.renderRoot)==null?void 0:c.querySelector(n))??null};if(e){const{get:o,set:c}=typeof a=="object"?t:s??(()=>{const r=Symbol();return{get(){return this[r]},set(l){this[r]=l}}})();return y(t,a,{get(){let r=o.call(this);return r===void 0&&(r=i(this),(r!==null||this.hasUpdated)&&c.call(this,r)),r}})}return y(t,a,{get(){return i(this)}})}}var p={},w;function _(n){return function(...e){return function(t,a,s){return Object.assign(Object.assign({},s),{value:n(s.value,...e)})}}}Object.defineProperty(p,"__esModule",{value:!0});const M=_(function(n,e=0){let t=-1;const a=function(...s){clearTimeout(t),t=window.setTimeout(()=>{n.call(this,...s)},e)};return a.cancel=function(){clearTimeout(t)},a}),q=_(function(n,e=0){let t,a=[];const s=function(...i){a=i,t===void 0&&(t=window.setTimeout(()=>{t=void 0,n.call(this,...a)},e))};return s.cancel=function(){clearTimeout(t),t=void 0},s});w=p.debounce=M,p.throttle=q;var T=Object.defineProperty,x=Object.getOwnPropertyDescriptor,$=(n,e,t,a)=>{for(var s=a>1?void 0:a?x(e,t):e,i=n.length-1,o;i>=0;i--)(o=n[i])&&(s=(a?o(e,t,s):o(s))||s);return a&&s&&T(e,t,s),s};let m=class extends b{constructor(){super(...arguments),this.getSubmenuName=n=>n.path.split("/")[1],this.groupByFirstLevelPath=n=>{const e={};return n.forEach(a=>{const s=this.getSubmenuName(a);e[s]||(e[s]=[]),e[s].push({path:a.path,navtitle:this.getNavTitle(a)})}),Object.values(e).map(a=>a.length===1?a[0]:{navtitle:a[0].path.split("/")[1],path:a[0].path,children:a})}}createRenderRoot(){return this}async firstUpdated(){const n=await this.fetchSitemap();this.items=this.groupByFirstLevelPath(n)}render(){if(this.items)return d``}toggleSubmenu({currentTarget:n}){!(n instanceof HTMLElement)||!n.classList.contains("opener")||n.classList.toggle("active")}renderSubMenu(n){return d`${n.navtitle}`}renderMenuItem(n){return d`
  • ${n.children!==void 0?this.renderSubMenu(n):d`${n.navtitle}`}
  • `}renderMenuItems(){return d`
      ${this.items.map(n=>this.renderMenuItem(n))}
    `}async fetchSitemap(){return(await(await fetch(`${window.hlx.codeBasePath}/query-index.json`)).json()).data}getNavTitle(n){return n.path==="/"?"Homepage":n.navtitle||n.title}};$([j()],m.prototype,"items",2);m=$([S("sidebar-nav")],m);var A=Object.defineProperty,O=Object.getOwnPropertyDescriptor,f=(n,e,t,a)=>{for(var s=a>1?void 0:a?O(e,t):e,i=n.length-1,o;i>=0;i--)(o=n[i])&&(s=(a?o(e,t,s):o(s))||s);return a&&s&&A(e,t,s),s};let u=class extends b{constructor(){super(...arguments),this.handleToggleClick=n=>{n.preventDefault(),this.classList.toggle("inactive")}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.setInitialVisibility(),window.addEventListener("resize",this.setInitialVisibility.bind(this))}setInitialVisibility(){window.innerWidth<=1280?this.classList.add("inactive"):this.classList.remove("inactive")}firstUpdated(){this.toggle.addEventListener("click",this.handleToggleClick)}render(){return d`
    `}};f([P(".toggle")],u.prototype,"toggle",2);f([w(100)],u.prototype,"setInitialVisibility",1);u=f([S("sidebar-component")],u);class B{readBlockConfig(e){const t={};return e.querySelectorAll(":scope > div").forEach(a=>{if(a.children){const s=[...a.children];if(s[1]){const i=s[1],o=h(s[0].textContent??"");let c="";if(i.querySelector("a")){const r=[...i.querySelectorAll("a")];r.length===1?c=r[0].href:c=r.map(l=>l.href)}else if(i.querySelector("img")){const r=[...i.querySelectorAll("img")];r.length===1?c=r[0].src:c=r.map(l=>l.src)}else if(i.querySelector("p")){const r=[...i.querySelectorAll("p")];r.length===1?c=r[0].textContent:c=r.map(l=>l.textContent)}else c=a.children[1].textContent;t[o]=c}}}),t}decorateBlocks(e){e.querySelectorAll("div.section > div > div").forEach(this.decorateBlock)}decorateBlock(e){const t=e.classList[0];if(t){e.classList.add("block"),e.dataset.blockName=t;const a=e.parentElement;a==null||a.classList.add(`${t}-wrapper`);const s=e.closest(".section");s&&s.classList.add(`${t}-container`)}}}class I{constructor(e){this.blockService=e}init(e){this.transformSection(e)}transformSection(e){e.querySelectorAll(":scope > div").forEach(t=>{this.adjustMarkup(t),this.processSectionMetaData(t)})}processSectionMetaData(e){const t=e.querySelector("div.section-metadata");if(t){const a=this.blockService.readBlockConfig(t);Object.keys(a).forEach(s=>{s==="style"?a.style.split(",").filter(o=>o).map(o=>h(o.trim())).forEach(o=>e.classList.add(o)):e.dataset[L(s)]=a[s]}),t.parentElement&&t.parentElement.remove()}}adjustMarkup(e){const t=[];let a=!1;[...e.children].forEach(s=>{if(s.tagName==="DIV"||!a){const i=document.createElement("div");t.push(i),a=s.tagName!=="DIV",a&&i.classList.add("default-content-wrapper")}t[t.length-1].append(s)}),t.forEach(s=>e.append(s)),e.classList.add("section"),e.dataset.sectionStatus="initialized",e.style.display="none"}}class D{constructor(e,t){this.sectionService=e,this.blockService=t,this.init=async()=>{this.setup(),await this.loadEager()},this.loadEager=async()=>{if(document.documentElement.lang="en",this.decorateTemplateAndTheme(),document){const s=document.querySelector("body");s&&(s.style.display="none")}const a=document.querySelector("main");a&&(a.setAttribute("id","main"),this.addSidebarContainer(a),this.sectionService.init(a),this.addInnerContainer(a),this.blockService.decorateBlocks(a),await this.loadComponents(),setTimeout(()=>{document.body.removeAttribute("style")},200))},this.loadComponents=async()=>{document.querySelectorAll(".section").forEach(s=>{const i=[],o=s.querySelectorAll("[data-block-name]");if(!o.length){s.style.removeProperty("display");return}o.forEach(c=>{c.style.display="none",i.push({name:c.dataset.blockName,element:c})}),i.length&&i.forEach(async c=>{const r=await C(()=>import(`${window.hlx.codeBasePath}/dist/${c.name}/${c.name}.js`),__vite__mapDeps([]));r.default&&await r.default(c.element)}),s.style.removeProperty("display")})}}setup(){window.hlx=window.hlx||{},window.hlx.RUM_MASK_URL="full",window.hlx.codeBasePath="",window.hlx.lighthouse=new URLSearchParams(window.location.search).get("lighthouse")==="on";const e=document.querySelector('script[src$="/scripts/scripts.js"]');if(e)try{[window.hlx.codeBasePath]=new URL(e.src).pathname.split("/scripts/scripts.js")}catch(t){console.log(t)}}addSidebarContainer(e){const t=document.createElement("sidebar-component");t.setAttribute("id","sidebar"),e.after(t)}addInnerContainer(e){const t=e.innerHTML;e.innerHTML=`
    ${t}
    `}decorateTemplateAndTheme(){const e=g("template");e&&v(document.body,e);const t=g("theme");t&&v(document.body,t)}}(async function(){const n=new B,e=new I(n);await new D(e,n).init()})(); + */function P(n,e){return(t,i,s)=>{const a=o=>{var c;return((c=o.renderRoot)==null?void 0:c.querySelector(n))??null};if(e){const{get:o,set:c}=typeof i=="object"?t:s??(()=>{const r=Symbol();return{get(){return this[r]},set(l){this[r]=l}}})();return y(t,i,{get(){let r=o.call(this);return r===void 0&&(r=a(this),(r!==null||this.hasUpdated)&&c.call(this,r)),r}})}return y(t,i,{get(){return a(this)}})}}var p={},w;function _(n){return function(...e){return function(t,i,s){return Object.assign(Object.assign({},s),{value:n(s.value,...e)})}}}Object.defineProperty(p,"__esModule",{value:!0});const M=_(function(n,e=0){let t=-1;const i=function(...s){clearTimeout(t),t=window.setTimeout(()=>{n.call(this,...s)},e)};return i.cancel=function(){clearTimeout(t)},i}),q=_(function(n,e=0){let t,i=[];const s=function(...a){i=a,t===void 0&&(t=window.setTimeout(()=>{t=void 0,n.call(this,...i)},e))};return s.cancel=function(){clearTimeout(t),t=void 0},s});w=p.debounce=M,p.throttle=q;var T=Object.defineProperty,x=Object.getOwnPropertyDescriptor,$=(n,e,t,i)=>{for(var s=i>1?void 0:i?x(e,t):e,a=n.length-1,o;a>=0;a--)(o=n[a])&&(s=(i?o(e,t,s):o(s))||s);return i&&s&&T(e,t,s),s};let m=class extends b{constructor(){super(...arguments),this.getSubmenuName=n=>n.path.split("/")[1],this.groupByFirstLevelPath=n=>{const e={};return n.forEach(i=>{const s=this.getSubmenuName(i);e[s]||(e[s]=[]),e[s].push({path:i.path,navtitle:this.getNavTitle(i)})}),Object.values(e).map(i=>i.length===1?i[0]:{navtitle:i[0].path.split("/")[1],path:i[0].path,children:i})}}createRenderRoot(){return this}async firstUpdated(){const n=await this.fetchSitemap();this.items=this.groupByFirstLevelPath(n)}render(){if(this.items)return d``}toggleSubmenu({currentTarget:n}){!(n instanceof HTMLElement)||!n.classList.contains("opener")||n.classList.toggle("active")}renderSubMenu(n){return d`${n.navtitle}`}renderMenuItem(n){return d`
  • ${n.children!==void 0?this.renderSubMenu(n):d`${n.navtitle}`}
  • `}renderMenuItems(){return d`
      ${this.items.map(n=>this.renderMenuItem(n))}
    `}async fetchSitemap(){return(await(await fetch(`${window.hlx.codeBasePath}/query-index.json`)).json()).data}getNavTitle(n){return n.path==="/"?"Homepage":n.navtitle||n.title}};$([j()],m.prototype,"items",2);m=$([S("sidebar-nav")],m);var A=Object.defineProperty,O=Object.getOwnPropertyDescriptor,f=(n,e,t,i)=>{for(var s=i>1?void 0:i?O(e,t):e,a=n.length-1,o;a>=0;a--)(o=n[a])&&(s=(i?o(e,t,s):o(s))||s);return i&&s&&A(e,t,s),s};let u=class extends b{constructor(){super(...arguments),this.handleToggleClick=n=>{n.preventDefault(),this.classList.toggle("inactive")}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.setInitialVisibility(),window.addEventListener("resize",this.setInitialVisibility.bind(this))}setInitialVisibility(){window.innerWidth<=1280?this.classList.add("inactive"):this.classList.remove("inactive")}firstUpdated(){this.toggle.addEventListener("click",this.handleToggleClick)}render(){return d`
    `}};f([P(".toggle")],u.prototype,"toggle",2);f([w(100)],u.prototype,"setInitialVisibility",1);u=f([S("sidebar-component")],u);class B{readBlockConfig(e){const t={};return e.querySelectorAll(":scope > div").forEach(i=>{if(i.children){const s=[...i.children];if(s[1]){const a=s[1],o=h(s[0].textContent??"");let c="";if(a.querySelector("a")){const r=[...a.querySelectorAll("a")];r.length===1?c=r[0].href:c=r.map(l=>l.href)}else if(a.querySelector("img")){const r=[...a.querySelectorAll("img")];r.length===1?c=r[0].src:c=r.map(l=>l.src)}else if(a.querySelector("p")){const r=[...a.querySelectorAll("p")];r.length===1?c=r[0].textContent:c=r.map(l=>l.textContent)}else c=i.children[1].textContent;t[o]=c}}}),t}decorateBlocks(e){e.querySelectorAll("div.section > div > div").forEach(this.decorateBlock)}decorateBlock(e){const t=e.classList[0];if(t){e.classList.add("block"),e.dataset.blockName=t;const i=e.parentElement;i==null||i.classList.add(`${t}-wrapper`);const s=e.closest(".section");s&&s.classList.add(`${t}-container`)}}}class I{constructor(e){this.blockService=e}init(e){this.transformSection(e)}transformSection(e){e.querySelectorAll(":scope > div").forEach(t=>{this.adjustMarkup(t),this.processSectionMetaData(t)})}processSectionMetaData(e){const t=e.querySelector("div.section-metadata");if(t){const i=this.blockService.readBlockConfig(t);Object.keys(i).forEach(s=>{s==="style"?i.style.split(",").filter(o=>o).map(o=>h(o.trim())).forEach(o=>e.classList.add(o)):e.dataset[L(s)]=i[s]}),t.parentElement&&t.parentElement.remove()}}adjustMarkup(e){const t=[];let i=!1;[...e.children].forEach(s=>{if(s.tagName==="DIV"||!i){const a=document.createElement("div");t.push(a),i=s.tagName!=="DIV",i&&a.classList.add("default-content-wrapper")}t[t.length-1].append(s)}),t.forEach(s=>e.append(s)),e.classList.add("section"),e.dataset.sectionStatus="initialized",e.style.display="none"}}class D{constructor(e,t){this.sectionService=e,this.blockService=t,this.init=async()=>{this.setup(),await this.loadEager()},this.loadEager=async()=>{if(document.documentElement.lang="en",this.decorateTemplateAndTheme(),document){const s=document.querySelector("body");s&&(s.style.display="none")}const i=document.querySelector("main");i&&(i.setAttribute("id","main"),this.addSidebarContainer(i),this.sectionService.init(i),this.addInnerContainer(i),this.blockService.decorateBlocks(i),await this.loadComponents(),setTimeout(()=>{document.body.removeAttribute("style")},200))},this.loadComponents=async()=>{document.querySelectorAll(".section").forEach(s=>{const a=[],o=s.querySelectorAll("[data-block-name]");if(!o.length){s.style.removeProperty("display");return}o.forEach(c=>{c.style.display="none",a.push({name:c.dataset.blockName,element:c})}),a.length&&a.forEach(async c=>{const r=await C(()=>import(`${window.hlx.codeBasePath}/dist/${c.name}/${c.name}.js`),__vite__mapDeps([]));r.default&&await r.default(c.element)}),s.style.removeProperty("display")})}}setup(){window.hlx=window.hlx||{},window.hlx.RUM_MASK_URL="full",window.hlx.codeBasePath="",window.hlx.lighthouse=new URLSearchParams(window.location.search).get("lighthouse")==="on";const e=document.querySelector('script[src$="/scripts/scripts.js"]');if(e)try{[window.hlx.codeBasePath]=new URL(e.src).pathname.split("/scripts/scripts.js")}catch(t){console.log(t)}}addSidebarContainer(e){const t=document.createElement("sidebar-component");t.setAttribute("id","sidebar"),e.after(t)}addInnerContainer(e){const t=e.innerHTML;e.innerHTML=`
    ${t}
    `}decorateTemplateAndTheme(){const e=g("template");e&&v(document.body,e);const t=g("theme");t&&v(document.body,t)}}(async function(){const n=new B,e=new I(n);await new D(e,n).init()})(); function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] diff --git a/dist/main/main.js.map b/dist/main/main.js.map index c2da8e27..34acc2a7 100644 --- a/dist/main/main.js.map +++ b/dist/main/main.js.map @@ -1 +1 @@ -{"version":3,"mappings":"4LAAO,SAASA,EAAYC,EAAc,CACxC,OAAO,OAAOA,GAAS,SACnBA,EACG,cACA,QAAQ,cAAe,GAAG,EAC1B,QAAQ,MAAO,GAAG,EAClB,QAAQ,SAAU,EAAE,EACvB,EACN,CCNa,MAAAC,EAAa,CAACC,EAAsBC,IAAoB,CACnEA,EAAQ,MAAM,GAAG,EAAE,QAASC,GAAM,CAChCF,EAAQ,UAAU,IAAIH,EAAYK,EAAE,KAAM,EAAC,EAC5C,CACH,ECNgB,SAAAC,EAAYL,EAAcM,EAAM,SAAU,CACxD,MAAMC,EAAOP,GAAQA,EAAK,SAAS,GAAG,EAAI,WAAa,OAGjDQ,EADH,CAAC,GAAGF,EAAI,KAAK,iBAAiB,QAAQC,CAAI,KAAKP,CAAI,IAAI,CAAC,EAExD,IAAKS,GACGA,EAAE,OACV,EACA,KAAK,IA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AClDA,EAAA,aAAa,KAAM,SAAS,EAC7CtB,EAAK,MAAMsB,CAAgB,CAC7B,CAEQ,kBAAkBtB,EAAmB,CAC3C,MAAMuB,EAAWvB,EAAK,UACjBA,EAAA,UAAY,sBAAsBuB,CAAQ,QACjD,CAIQ,0BAA2B,CAC3B,MAAAC,EAAWvE,EAAY,UAAU,EACnCuE,GAAqB3E,EAAA,SAAS,KAAM2E,CAAQ,EAC1C,MAAAC,EAAQxE,EAAY,OAAO,EAC7BwE,GAAkB5E,EAAA,SAAS,KAAM4E,CAAK,CAC5C,CA+BF,EAEC,gBAAkB,CACX,MAAApB,EAAe,IAAIlB,EACnB2B,EAAiB,IAAIV,EAAeC,CAAY,EAEtD,MADa,IAAIQ,EAAKC,EAAgBT,CAAY,EACvC,MACb,GAAG","names":["toClassName","name","addClasses","element","classes","c","getMetadata","doc","attr","meta","m","toCamelCase","g","r","t","e","n","s","i","o","_a","decorators","debounce","SidebarNav","LitElement","entry","data","groups","item","firstLevelPath","group","sitemap","html","currentTarget","child","__decorateClass","state","customElement","SidebarComponent","query","BlockService","block","config","row","cols","col","value","as","a","imgs","img","ps","p","main","shortBlockName","blockWrapper","section","SectionService","blockService","container","sectionMeta","key","style","wrappers","defaultContent","wrapper","Main","sectionService","body","components","blocks","component","componentModule","scriptEl","error","sidebarContainer","children","template","theme"],"sources":["../../src/utils/toClassName.ts","../../src/utils/addClasses.ts","../../src/utils/getMetadata.ts","../../src/utils/toCamelCase.ts","../../node_modules/@lit/reactive-element/decorators/state.js","../../node_modules/@lit/reactive-element/decorators/base.js","../../node_modules/@lit/reactive-element/decorators/query.js","../../node_modules/@kluntje/js-utils/lib/function-helpers/decorators/index.js","../../src/components/sidebar/sidebarNav.ts","../../src/components/sidebar/sidebar.ts","../../src/main.ts"],"sourcesContent":["export function toClassName(name: string) {\n return typeof name === 'string'\n ? name\n .toLowerCase()\n .replace(/[^0-9a-z]/gi, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '')\n : '';\n}\n","import { toClassName } from './toClassName';\n\nexport const addClasses = (element: HTMLElement, classes: string) => {\n classes.split(',').forEach((c) => {\n element.classList.add(toClassName(c.trim()));\n });\n};\n","export function getMetadata(name: string, doc = document) {\n const attr = name && name.includes(':') ? 'property' : 'name';\n const metaTags: HTMLMetaElement[] =\n ([...doc.head.querySelectorAll(`meta[${attr}=\"${name}\"]`)] as HTMLMetaElement[]) || [];\n const meta = metaTags\n .map((m) => {\n return m.content;\n })\n .join(', ');\n return meta.length ? meta : '';\n}\n","import { toClassName } from './toClassName';\n\n/**\n * Sanitizes a string for use as a js property name.\n * @param {string} name The unsanitized string\n * @returns {string} The camelCased name\n */\nexport function toCamelCase(name: string) {\n return toClassName(name).replace(/-([a-z])/g, (g) => g[1].toUpperCase());\n}\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&\"object\"!=typeof t&&Object.defineProperty(e,t,c),c);export{e as desc};\n//# sourceMappingURL=base.js.map\n","import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}=\"object\"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return t(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return t(n,s,{get(){return o(this)}})}}export{e as query};\n//# sourceMappingURL=query.js.map\n","\"use strict\";function t(t){return function(...e){return function(n,o,c){return Object.assign(Object.assign({},c),{value:t(c.value,...e)})}}}Object.defineProperty(exports,\"__esModule\",{value:!0});const e=t((function(t,e=0){let n=-1;const o=function(...o){clearTimeout(n),n=window.setTimeout((()=>{t.call(this,...o)}),e)};return o.cancel=function(){clearTimeout(n)},o})),n=t((function(t,e=0){let n,o=[];const c=function(...c){o=c,void 0===n&&(n=window.setTimeout((()=>{n=void 0,t.call(this,...o)}),e))};return c.cancel=function(){clearTimeout(n),n=void 0},c}));exports.debounce=e,exports.throttle=n;\n//# sourceMappingURL=index.js.map\n","import { html, LitElement } from 'lit';\nimport { customElement, query, state } from 'lit/decorators.js';\n\ntype SiteMapEntry = {\n path: string;\n title: string;\n description: string;\n lastModified: string; // Assuming this is a string representing a timestamp\n image: string;\n imagealt: string;\n navtitle: string;\n 'nav-test': string;\n imageAlt: string;\n};\n\ninterface SubMenuItem {\n path: string;\n navtitle: string;\n}\n\ninterface MenuItem {\n path: string;\n navtitle: string;\n children?: SubMenuItem[];\n}\n\ntype Sitemap = SiteMapEntry[];\n\n@customElement('sidebar-nav')\nexport class SidebarNav extends LitElement {\n @state()\n items: MenuItem[];\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n async firstUpdated() {\n const sitemap = await this.fetchSitemap();\n this.items = this.groupByFirstLevelPath(sitemap);\n }\n\n render() {\n if (!this.items) return;\n return html` `;\n }\n\n private toggleSubmenu({ currentTarget }: Event) {\n if (!(currentTarget instanceof HTMLElement) || !currentTarget.classList.contains('opener')) return;\n currentTarget.classList.toggle('active');\n }\n\n private renderSubMenu(item) {\n return html`\n ${item.navtitle} \n \n \n `;\n }\n\n private renderMenuItem(item) {\n return html`
  • \n ${item.children !== undefined ? this.renderSubMenu(item) : html`${item.navtitle}`}\n
  • `;\n }\n\n private renderMenuItems() {\n return html`
      \n ${this.items.map((item) => this.renderMenuItem(item))}\n
    `;\n }\n\n private async fetchSitemap(): Promise {\n const response = await fetch(`${window.hlx.codeBasePath}/query-index.json`);\n const json = await response.json();\n return json.data;\n }\n\n private getSubmenuName = (entry: SiteMapEntry) => {\n return entry.path.split('/')[1];\n };\n\n private getNavTitle(item: SiteMapEntry) {\n if (item.path === '/') return 'Homepage';\n return item.navtitle || item.title;\n }\n\n groupByFirstLevelPath = (data: Sitemap) => {\n const groups = {};\n data.forEach((item) => {\n const firstLevelPath = this.getSubmenuName(item); // Extracting the first level of the path\n if (!groups[firstLevelPath]) {\n groups[firstLevelPath] = [];\n }\n groups[firstLevelPath].push({\n path: item.path,\n navtitle: this.getNavTitle(item),\n });\n });\n\n const groupedData = Object.values(groups);\n\n return groupedData.map((group: MenuItem[]) => {\n if (group.length === 1) {\n return group[0];\n }\n\n return {\n navtitle: group[0].path.split('/')[1],\n path: group[0].path,\n children: group,\n };\n });\n };\n}\n","import { LitElement, html } from 'lit';\nimport { customElement, query } from 'lit/decorators.js';\nimport { debounce } from '@kluntje/js-utils/lib/function-helpers/decorators';\n\nimport './sidebarNav.ts';\n\n@customElement('sidebar-component')\nexport class SidebarComponent extends LitElement {\n @query('.toggle')\n toggle: HTMLAnchorElement;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.setInitialVisibility();\n window.addEventListener('resize', this.setInitialVisibility.bind(this));\n }\n\n @debounce(100)\n private setInitialVisibility() {\n window.innerWidth <= 1280 ? this.classList.add('inactive') : this.classList.remove('inactive');\n }\n\n firstUpdated(): void {\n this.toggle.addEventListener('click', this.handleToggleClick);\n }\n\n handleToggleClick = (e: Event) => {\n e.preventDefault();\n this.classList.toggle('inactive');\n };\n\n render() {\n return html`\n
    \n \n
    \n \n `;\n }\n}\n","// const LCP_BLOCKS: string[] = []; // add your LCP blocks to the list\n\nimport { addClasses } from '../src/utils/addClasses';\nimport { getMetadata } from '../src/utils/getMetadata';\nimport { toCamelCase } from '../src/utils/toCamelCase';\nimport { toClassName } from '../src/utils/toClassName';\nimport './components/sidebar/sidebar.ts';\n\ntype ComponentMapping = {\n name: string;\n element: HTMLDivElement;\n};\n\nclass BlockService {\n //TODO: Provider for fetch data\n\n /**\n * Extracts the config from a block.\n * @param {Element} block The block element\n * @returns {object} The block config\n */\n readBlockConfig(block: Element): Record {\n const config: Record = {};\n block.querySelectorAll(':scope > div').forEach((row) => {\n if (row.children) {\n const cols = [...row.children];\n if (cols[1]) {\n const col = cols[1];\n const name = toClassName(cols[0].textContent ?? '');\n let value: any = '';\n if (col.querySelector('a')) {\n const as = [...col.querySelectorAll('a')];\n if (as.length === 1) {\n value = as[0].href;\n } else {\n value = as.map((a) => a.href);\n }\n } else if (col.querySelector('img')) {\n const imgs = [...col.querySelectorAll('img')];\n if (imgs.length === 1) {\n value = imgs[0].src;\n } else {\n value = imgs.map((img) => img.src);\n }\n } else if (col.querySelector('p')) {\n const ps = [...col.querySelectorAll('p')];\n if (ps.length === 1) {\n value = ps[0].textContent;\n } else {\n value = ps.map((p) => p.textContent);\n }\n } else value = row.children[1].textContent;\n config[name] = value;\n }\n }\n });\n return config;\n }\n\n /**\n * Decorates all blocks in a container element.\n * @param {Element} main The container element\n */\n decorateBlocks(main: HTMLElement) {\n main.querySelectorAll('div.section > div > div').forEach(this.decorateBlock);\n }\n\n /**\n * Decorates a block.\n * @param {Element} block The block element\n */\n private decorateBlock(block: HTMLElement) {\n const shortBlockName = block.classList[0];\n if (shortBlockName) {\n block.classList.add('block');\n block.dataset.blockName = shortBlockName;\n const blockWrapper = block.parentElement;\n blockWrapper?.classList.add(`${shortBlockName}-wrapper`);\n const section = block.closest('.section');\n if (section) section.classList.add(`${shortBlockName}-container`);\n }\n }\n}\n\nclass SectionService {\n constructor(private blockService: BlockService) {}\n\n init(container: HTMLElement) {\n this.transformSection(container);\n }\n\n /**\n * Decorates all sections in a container element.\n * @param {Element} main The container element\n */\n private transformSection(main: HTMLElement) {\n main.querySelectorAll(':scope > div').forEach((section) => {\n this.adjustMarkup(section);\n this.processSectionMetaData(section);\n });\n }\n\n private processSectionMetaData(section: HTMLElement) {\n // Process section metadata\n const sectionMeta = section.querySelector('div.section-metadata');\n if (sectionMeta) {\n const meta = this.blockService.readBlockConfig(sectionMeta);\n Object.keys(meta).forEach((key) => {\n if (key === 'style') {\n const styles = meta.style\n .split(',')\n .filter((style: string) => style)\n .map((style: string) => toClassName(style.trim()));\n styles.forEach((style: string) => section.classList.add(style));\n } else {\n section.dataset[toCamelCase(key)] = meta[key];\n }\n });\n if (sectionMeta.parentElement) sectionMeta.parentElement.remove();\n }\n }\n\n private adjustMarkup(section: HTMLDivElement) {\n const wrappers: HTMLDivElement[] = [];\n let defaultContent = false;\n [...section.children].forEach((e) => {\n if (e.tagName === 'DIV' || !defaultContent) {\n const wrapper = document.createElement('div');\n wrappers.push(wrapper);\n defaultContent = e.tagName !== 'DIV';\n if (defaultContent) wrapper.classList.add('default-content-wrapper');\n }\n wrappers[wrappers.length - 1].append(e);\n });\n wrappers.forEach((wrapper) => section.append(wrapper));\n section.classList.add('section');\n section.dataset.sectionStatus = 'initialized';\n section.style.display = 'none';\n }\n}\n\nclass Main {\n constructor(\n private sectionService: SectionService,\n private blockService: BlockService\n ) {}\n\n init = async () => {\n this.setup();\n await this.loadEager();\n };\n\n /**\n * Setup block utils.\n */\n private setup() {\n window.hlx = window.hlx || {};\n window.hlx.RUM_MASK_URL = 'full';\n window.hlx.codeBasePath = '';\n window.hlx.lighthouse = new URLSearchParams(window.location.search).get('lighthouse') === 'on';\n\n const scriptEl = document.querySelector('script[src$=\"/scripts/scripts.js\"]') as HTMLScriptElement;\n if (scriptEl) {\n try {\n [window.hlx.codeBasePath] = new URL(scriptEl.src).pathname.split('/scripts/scripts.js');\n } catch (error) {\n // eslint-disable-next-line no-console\n console.log(error);\n }\n }\n }\n\n private loadEager = async () => {\n // TODO: how to support different languages here\n document.documentElement.lang = 'en';\n this.decorateTemplateAndTheme();\n if (document) {\n const body = document.querySelector('body');\n if (body) {\n body.style.display = 'none';\n }\n }\n const main = document.querySelector('main');\n if (main) {\n main.setAttribute('id', 'main');\n this.addSidebarContainer(main);\n this.sectionService.init(main);\n this.addInnerContainer(main); // TODO refactor initializing\n this.blockService.decorateBlocks(main);\n await this.loadComponents();\n // TODO: Performace adjustment\n setTimeout(() => {\n document.body.removeAttribute('style');\n }, 200);\n\n // await this.waitForLCP(LCP_BLOCKS);\n }\n };\n\n private addSidebarContainer(main: HTMLElement) {\n const sidebarContainer = document.createElement('sidebar-component');\n sidebarContainer.setAttribute('id', 'sidebar');\n main.after(sidebarContainer);\n }\n\n private addInnerContainer(main: HTMLElement) {\n const children = main.innerHTML;\n main.innerHTML = `
    ${children}
    `;\n }\n\n // private loadLazy = async () => {};\n\n private decorateTemplateAndTheme() {\n const template = getMetadata('template');\n if (template) addClasses(document.body, template);\n const theme = getMetadata('theme');\n if (theme) addClasses(document.body, theme);\n }\n\n private loadComponents = async () => {\n const sections = document.querySelectorAll('.section');\n sections.forEach((section) => {\n const components: ComponentMapping[] = [];\n const blocks = section.querySelectorAll('[data-block-name]');\n if (!blocks.length) {\n section.style.removeProperty('display');\n return;\n }\n blocks.forEach((block: HTMLDivElement) => {\n block.style.display = 'none';\n components.push({\n name: block.dataset['blockName'] as string,\n element: block,\n });\n });\n if (components.length) {\n components.forEach(async (component) => {\n const componentModule = await import(\n `${window.hlx.codeBasePath}/dist/${component.name}/${component.name}.js`\n );\n if (componentModule.default) {\n await componentModule.default(component.element);\n }\n });\n }\n section.style.removeProperty('display');\n });\n };\n}\n\n(async function () {\n const blockService = new BlockService();\n const sectionService = new SectionService(blockService);\n const main = new Main(sectionService, blockService);\n await main.init();\n})();\n\n// /**\n// * Loads JS and CSS for a block.\n// * @param {Element} block The block element\n// */\n// async function loadBlock(block) {\n// const status = block.dataset.blockStatus;\n// if (status !== 'loading' && status !== 'loaded') {\n// block.dataset.blockStatus = 'loading';\n// const { blockName } = block.dataset;\n// try {\n// const cssLoaded = loadCSS(`${window.hlx.codeBasePath}/blocks/${blockName}/${blockName}.css`);\n// const decorationComplete = new Promise((resolve) => {\n// (async () => {\n// try {\n// const mod = await import(`${window.hlx.codeBasePath}/blocks/${blockName}/${blockName}.js`);\n// if (mod.default) {\n// await mod.default(block);\n// }\n// } catch (error) {\n// // eslint-disable-next-line no-console\n// console.log(`failed to load module for ${blockName}`, error);\n// }\n// resolve();\n// })();\n// });\n// await Promise.all([cssLoaded, decorationComplete]);\n// } catch (error) {\n// // eslint-disable-next-line no-console\n// console.log(`failed to load block ${blockName}`, error);\n// }\n// block.dataset.blockStatus = 'loaded';\n// }\n// return block;\n// }\n\ndeclare global {\n interface Window {\n hlx: {\n RUM_MASK_URL: string;\n codeBasePath: string;\n lighthouse: boolean;\n };\n }\n}\n"],"file":"main/main.js"} \ No newline at end of file +{"version":3,"mappings":"gOAAO,SAASA,EAAYC,EAAc,CACxC,OAAO,OAAOA,GAAS,SACnBA,EACG,cACA,QAAQ,cAAe,GAAG,EAC1B,QAAQ,MAAO,GAAG,EAClB,QAAQ,SAAU,EAAE,EACvB,EACN,CCNa,MAAAC,EAAa,CAACC,EAAsBC,IAAoB,CACnEA,EAAQ,MAAM,GAAG,EAAE,QAASC,GAAM,CAChCF,EAAQ,UAAU,IAAIH,EAAYK,EAAE,KAAM,EAAC,EAC5C,CACH,ECNgB,SAAAC,EAAYL,EAAcM,EAAM,SAAU,CACxD,MAAMC,EAAOP,GAAQA,EAAK,SAAS,GAAG,EAAI,WAAa,OAGjDQ,EADH,CAAC,GAAGF,EAAI,KAAK,iBAAiB,QAAQC,CAAI,KAAKP,CAAI,IAAI,CAAC,EAExD,IAAKS,GACGA,EAAE,OACV,EACA,KAAK,IAAI,EACL,OAAAD,EAAK,OAASA,EAAO,EAC9B,CCHO,SAASE,EAAYV,EAAc,CACjC,OAAAD,EAAYC,CAAI,EAAE,QAAQ,YAAcW,GAAMA,EAAE,CAAC,EAAE,YAAa,EACzE,CCRA;AAAA;AAAA;AAAA;AAAA,GAIG,SAASC,EAAEA,EAAE,CAAC,OAAOC,EAAE,CAAC,GAAGD,EAAE,MAAM,GAAG,UAAU,EAAE,CAAC,CAAC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AAQxE,EAAY,OAAO,EAC7BwE,GAAkB5E,EAAA,SAAS,KAAM4E,CAAK,CAC5C,CA+BF,EAEC,gBAAkB,CACX,MAAApB,EAAe,IAAIlB,EACnB2B,EAAiB,IAAIV,EAAeC,CAAY,EAEtD,MADa,IAAIQ,EAAKC,EAAgBT,CAAY,EACvC,MACb,GAAG","names":["toClassName","name","addClasses","element","classes","c","getMetadata","doc","attr","meta","m","toCamelCase","g","r","t","e","n","s","i","o","_a","decorators","debounce","SidebarNav","LitElement","entry","data","groups","item","firstLevelPath","group","sitemap","html","currentTarget","child","__decorateClass","state","customElement","SidebarComponent","query","BlockService","block","config","row","cols","col","value","as","a","imgs","img","ps","p","main","shortBlockName","blockWrapper","section","SectionService","blockService","container","sectionMeta","key","style","wrappers","defaultContent","wrapper","Main","sectionService","body","components","blocks","component","componentModule","scriptEl","error","sidebarContainer","children","template","theme"],"sources":["../../src/utils/toClassName.ts","../../src/utils/addClasses.ts","../../src/utils/getMetadata.ts","../../src/utils/toCamelCase.ts","../../node_modules/@lit/reactive-element/decorators/state.js","../../node_modules/@lit/reactive-element/decorators/base.js","../../node_modules/@lit/reactive-element/decorators/query.js","../../node_modules/@kluntje/js-utils/lib/function-helpers/decorators/index.js","../../src/components/sidebar/sidebarNav.ts","../../src/components/sidebar/sidebar.ts","../../src/main.ts"],"sourcesContent":["export function toClassName(name: string) {\n return typeof name === 'string'\n ? name\n .toLowerCase()\n .replace(/[^0-9a-z]/gi, '-')\n .replace(/-+/g, '-')\n .replace(/^-|-$/g, '')\n : '';\n}\n","import { toClassName } from './toClassName';\n\nexport const addClasses = (element: HTMLElement, classes: string) => {\n classes.split(',').forEach((c) => {\n element.classList.add(toClassName(c.trim()));\n });\n};\n","export function getMetadata(name: string, doc = document) {\n const attr = name && name.includes(':') ? 'property' : 'name';\n const metaTags: HTMLMetaElement[] =\n ([...doc.head.querySelectorAll(`meta[${attr}=\"${name}\"]`)] as HTMLMetaElement[]) || [];\n const meta = metaTags\n .map((m) => {\n return m.content;\n })\n .join(', ');\n return meta.length ? meta : '';\n}\n","import { toClassName } from './toClassName';\n\n/**\n * Sanitizes a string for use as a js property name.\n * @param {string} name The unsanitized string\n * @returns {string} The camelCased name\n */\nexport function toCamelCase(name: string) {\n return toClassName(name).replace(/-([a-z])/g, (g) => g[1].toUpperCase());\n}\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst e=(e,t,c)=>(c.configurable=!0,c.enumerable=!0,Reflect.decorate&&\"object\"!=typeof t&&Object.defineProperty(e,t,c),c);export{e as desc};\n//# sourceMappingURL=base.js.map\n","import{desc as t}from\"./base.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function e(e,r){return(n,s,i)=>{const o=t=>t.renderRoot?.querySelector(e)??null;if(r){const{get:e,set:r}=\"object\"==typeof s?n:i??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return t(n,s,{get(){let t=e.call(this);return void 0===t&&(t=o(this),(null!==t||this.hasUpdated)&&r.call(this,t)),t}})}return t(n,s,{get(){return o(this)}})}}export{e as query};\n//# sourceMappingURL=query.js.map\n","\"use strict\";function t(t){return function(...e){return function(n,o,c){return Object.assign(Object.assign({},c),{value:t(c.value,...e)})}}}Object.defineProperty(exports,\"__esModule\",{value:!0});const e=t((function(t,e=0){let n=-1;const o=function(...o){clearTimeout(n),n=window.setTimeout((()=>{t.call(this,...o)}),e)};return o.cancel=function(){clearTimeout(n)},o})),n=t((function(t,e=0){let n,o=[];const c=function(...c){o=c,void 0===n&&(n=window.setTimeout((()=>{n=void 0,t.call(this,...o)}),e))};return c.cancel=function(){clearTimeout(n),n=void 0},c}));exports.debounce=e,exports.throttle=n;\n//# sourceMappingURL=index.js.map\n","import { html, LitElement } from 'lit';\nimport { customElement, state } from 'lit/decorators.js';\n\nimport '../icon';\n\ntype SiteMapEntry = {\n path: string;\n title: string;\n description: string;\n lastModified: string; // Assuming this is a string representing a timestamp\n image: string;\n imagealt: string;\n navtitle: string;\n 'nav-test': string;\n imageAlt: string;\n};\n\ninterface SubMenuItem {\n path: string;\n navtitle: string;\n}\n\ninterface MenuItem {\n path: string;\n navtitle: string;\n children?: SubMenuItem[];\n}\n\ntype Sitemap = SiteMapEntry[];\n\n@customElement('sidebar-nav')\nexport class SidebarNav extends LitElement {\n @state()\n items: MenuItem[];\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n async firstUpdated() {\n const sitemap = await this.fetchSitemap();\n this.items = this.groupByFirstLevelPath(sitemap);\n }\n\n render() {\n if (!this.items) return;\n return html` `;\n }\n\n private toggleSubmenu({ currentTarget }: Event) {\n if (!(currentTarget instanceof HTMLElement) || !currentTarget.classList.contains('opener')) return;\n currentTarget.classList.toggle('active');\n }\n\n private renderSubMenu(item) {\n return html`\n ${item.navtitle} \n \n \n `;\n }\n\n private renderMenuItem(item) {\n return html`
  • \n ${item.children !== undefined ? this.renderSubMenu(item) : html`${item.navtitle}`}\n
  • `;\n }\n\n private renderMenuItems() {\n return html`
      \n ${this.items.map((item) => this.renderMenuItem(item))}\n
    `;\n }\n\n private async fetchSitemap(): Promise {\n const response = await fetch(`${window.hlx.codeBasePath}/query-index.json`);\n const json = await response.json();\n return json.data;\n }\n\n private getSubmenuName = (entry: SiteMapEntry) => {\n return entry.path.split('/')[1];\n };\n\n private getNavTitle(item: SiteMapEntry) {\n if (item.path === '/') return 'Homepage';\n return item.navtitle || item.title;\n }\n\n groupByFirstLevelPath = (data: Sitemap) => {\n const groups = {};\n data.forEach((item) => {\n const firstLevelPath = this.getSubmenuName(item); // Extracting the first level of the path\n if (!groups[firstLevelPath]) {\n groups[firstLevelPath] = [];\n }\n groups[firstLevelPath].push({\n path: item.path,\n navtitle: this.getNavTitle(item),\n });\n });\n\n const groupedData = Object.values(groups);\n\n return groupedData.map((group: MenuItem[]) => {\n if (group.length === 1) {\n return group[0];\n }\n\n return {\n navtitle: group[0].path.split('/')[1],\n path: group[0].path,\n children: group,\n };\n });\n };\n}\n","import { LitElement, html } from 'lit';\nimport { customElement, query } from 'lit/decorators.js';\nimport { debounce } from '@kluntje/js-utils/lib/function-helpers/decorators';\n\nimport './sidebarNav.ts';\n\n@customElement('sidebar-component')\nexport class SidebarComponent extends LitElement {\n @query('.toggle')\n toggle: HTMLAnchorElement;\n\n protected createRenderRoot(): HTMLElement | DocumentFragment {\n return this;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.setInitialVisibility();\n window.addEventListener('resize', this.setInitialVisibility.bind(this));\n }\n\n @debounce(100)\n private setInitialVisibility() {\n window.innerWidth <= 1280 ? this.classList.add('inactive') : this.classList.remove('inactive');\n }\n\n firstUpdated(): void {\n this.toggle.addEventListener('click', this.handleToggleClick);\n }\n\n handleToggleClick = (e: Event) => {\n e.preventDefault();\n this.classList.toggle('inactive');\n };\n\n render() {\n return html`\n
    \n \n
    \n \n `;\n }\n}\n","// const LCP_BLOCKS: string[] = []; // add your LCP blocks to the list\n\nimport { addClasses } from '../src/utils/addClasses';\nimport { getMetadata } from '../src/utils/getMetadata';\nimport { toCamelCase } from '../src/utils/toCamelCase';\nimport { toClassName } from '../src/utils/toClassName';\nimport './components/sidebar/sidebar.ts';\n\ntype ComponentMapping = {\n name: string;\n element: HTMLDivElement;\n};\n\nclass BlockService {\n //TODO: Provider for fetch data\n\n /**\n * Extracts the config from a block.\n * @param {Element} block The block element\n * @returns {object} The block config\n */\n readBlockConfig(block: Element): Record {\n const config: Record = {};\n block.querySelectorAll(':scope > div').forEach((row) => {\n if (row.children) {\n const cols = [...row.children];\n if (cols[1]) {\n const col = cols[1];\n const name = toClassName(cols[0].textContent ?? '');\n let value: any = '';\n if (col.querySelector('a')) {\n const as = [...col.querySelectorAll('a')];\n if (as.length === 1) {\n value = as[0].href;\n } else {\n value = as.map((a) => a.href);\n }\n } else if (col.querySelector('img')) {\n const imgs = [...col.querySelectorAll('img')];\n if (imgs.length === 1) {\n value = imgs[0].src;\n } else {\n value = imgs.map((img) => img.src);\n }\n } else if (col.querySelector('p')) {\n const ps = [...col.querySelectorAll('p')];\n if (ps.length === 1) {\n value = ps[0].textContent;\n } else {\n value = ps.map((p) => p.textContent);\n }\n } else value = row.children[1].textContent;\n config[name] = value;\n }\n }\n });\n return config;\n }\n\n /**\n * Decorates all blocks in a container element.\n * @param {Element} main The container element\n */\n decorateBlocks(main: HTMLElement) {\n main.querySelectorAll('div.section > div > div').forEach(this.decorateBlock);\n }\n\n /**\n * Decorates a block.\n * @param {Element} block The block element\n */\n private decorateBlock(block: HTMLElement) {\n const shortBlockName = block.classList[0];\n if (shortBlockName) {\n block.classList.add('block');\n block.dataset.blockName = shortBlockName;\n const blockWrapper = block.parentElement;\n blockWrapper?.classList.add(`${shortBlockName}-wrapper`);\n const section = block.closest('.section');\n if (section) section.classList.add(`${shortBlockName}-container`);\n }\n }\n}\n\nclass SectionService {\n constructor(private blockService: BlockService) {}\n\n init(container: HTMLElement) {\n this.transformSection(container);\n }\n\n /**\n * Decorates all sections in a container element.\n * @param {Element} main The container element\n */\n private transformSection(main: HTMLElement) {\n main.querySelectorAll(':scope > div').forEach((section) => {\n this.adjustMarkup(section);\n this.processSectionMetaData(section);\n });\n }\n\n private processSectionMetaData(section: HTMLElement) {\n // Process section metadata\n const sectionMeta = section.querySelector('div.section-metadata');\n if (sectionMeta) {\n const meta = this.blockService.readBlockConfig(sectionMeta);\n Object.keys(meta).forEach((key) => {\n if (key === 'style') {\n const styles = meta.style\n .split(',')\n .filter((style: string) => style)\n .map((style: string) => toClassName(style.trim()));\n styles.forEach((style: string) => section.classList.add(style));\n } else {\n section.dataset[toCamelCase(key)] = meta[key];\n }\n });\n if (sectionMeta.parentElement) sectionMeta.parentElement.remove();\n }\n }\n\n private adjustMarkup(section: HTMLDivElement) {\n const wrappers: HTMLDivElement[] = [];\n let defaultContent = false;\n [...section.children].forEach((e) => {\n if (e.tagName === 'DIV' || !defaultContent) {\n const wrapper = document.createElement('div');\n wrappers.push(wrapper);\n defaultContent = e.tagName !== 'DIV';\n if (defaultContent) wrapper.classList.add('default-content-wrapper');\n }\n wrappers[wrappers.length - 1].append(e);\n });\n wrappers.forEach((wrapper) => section.append(wrapper));\n section.classList.add('section');\n section.dataset.sectionStatus = 'initialized';\n section.style.display = 'none';\n }\n}\n\nclass Main {\n constructor(\n private sectionService: SectionService,\n private blockService: BlockService\n ) {}\n\n init = async () => {\n this.setup();\n await this.loadEager();\n };\n\n /**\n * Setup block utils.\n */\n private setup() {\n window.hlx = window.hlx || {};\n window.hlx.RUM_MASK_URL = 'full';\n window.hlx.codeBasePath = '';\n window.hlx.lighthouse = new URLSearchParams(window.location.search).get('lighthouse') === 'on';\n\n const scriptEl = document.querySelector('script[src$=\"/scripts/scripts.js\"]') as HTMLScriptElement;\n if (scriptEl) {\n try {\n [window.hlx.codeBasePath] = new URL(scriptEl.src).pathname.split('/scripts/scripts.js');\n } catch (error) {\n // eslint-disable-next-line no-console\n console.log(error);\n }\n }\n }\n\n private loadEager = async () => {\n // TODO: how to support different languages here\n document.documentElement.lang = 'en';\n this.decorateTemplateAndTheme();\n if (document) {\n const body = document.querySelector('body');\n if (body) {\n body.style.display = 'none';\n }\n }\n const main = document.querySelector('main');\n if (main) {\n main.setAttribute('id', 'main');\n this.addSidebarContainer(main);\n this.sectionService.init(main);\n this.addInnerContainer(main); // TODO refactor initializing\n this.blockService.decorateBlocks(main);\n await this.loadComponents();\n // TODO: Performace adjustment\n setTimeout(() => {\n document.body.removeAttribute('style');\n }, 200);\n\n // await this.waitForLCP(LCP_BLOCKS);\n }\n };\n\n private addSidebarContainer(main: HTMLElement) {\n const sidebarContainer = document.createElement('sidebar-component');\n sidebarContainer.setAttribute('id', 'sidebar');\n main.after(sidebarContainer);\n }\n\n private addInnerContainer(main: HTMLElement) {\n const children = main.innerHTML;\n main.innerHTML = `
    ${children}
    `;\n }\n\n // private loadLazy = async () => {};\n\n private decorateTemplateAndTheme() {\n const template = getMetadata('template');\n if (template) addClasses(document.body, template);\n const theme = getMetadata('theme');\n if (theme) addClasses(document.body, theme);\n }\n\n private loadComponents = async () => {\n const sections = document.querySelectorAll('.section');\n sections.forEach((section) => {\n const components: ComponentMapping[] = [];\n const blocks = section.querySelectorAll('[data-block-name]');\n if (!blocks.length) {\n section.style.removeProperty('display');\n return;\n }\n blocks.forEach((block: HTMLDivElement) => {\n block.style.display = 'none';\n components.push({\n name: block.dataset['blockName'] as string,\n element: block,\n });\n });\n if (components.length) {\n components.forEach(async (component) => {\n const componentModule = await import(\n `${window.hlx.codeBasePath}/dist/${component.name}/${component.name}.js`\n );\n if (componentModule.default) {\n await componentModule.default(component.element);\n }\n });\n }\n section.style.removeProperty('display');\n });\n };\n}\n\n(async function () {\n const blockService = new BlockService();\n const sectionService = new SectionService(blockService);\n const main = new Main(sectionService, blockService);\n await main.init();\n})();\n\n// /**\n// * Loads JS and CSS for a block.\n// * @param {Element} block The block element\n// */\n// async function loadBlock(block) {\n// const status = block.dataset.blockStatus;\n// if (status !== 'loading' && status !== 'loaded') {\n// block.dataset.blockStatus = 'loading';\n// const { blockName } = block.dataset;\n// try {\n// const cssLoaded = loadCSS(`${window.hlx.codeBasePath}/blocks/${blockName}/${blockName}.css`);\n// const decorationComplete = new Promise((resolve) => {\n// (async () => {\n// try {\n// const mod = await import(`${window.hlx.codeBasePath}/blocks/${blockName}/${blockName}.js`);\n// if (mod.default) {\n// await mod.default(block);\n// }\n// } catch (error) {\n// // eslint-disable-next-line no-console\n// console.log(`failed to load module for ${blockName}`, error);\n// }\n// resolve();\n// })();\n// });\n// await Promise.all([cssLoaded, decorationComplete]);\n// } catch (error) {\n// // eslint-disable-next-line no-console\n// console.log(`failed to load block ${blockName}`, error);\n// }\n// block.dataset.blockStatus = 'loaded';\n// }\n// return block;\n// }\n\ndeclare global {\n interface Window {\n hlx: {\n RUM_MASK_URL: string;\n codeBasePath: string;\n lighthouse: boolean;\n };\n }\n}\n"],"file":"main/main.js"} \ No newline at end of file diff --git a/src/components/icon.ts b/src/components/icon.ts index 8caf09d0..152c83e3 100644 --- a/src/components/icon.ts +++ b/src/components/icon.ts @@ -13,6 +13,7 @@ export class Icon extends LitElement { async getSvg(name: string) { const key = modules[`/src/icons/${name}.svg`]; const iconMarkupFunc = key !== undefined ? key : modules[`/src/icons/cross.svg`]; + console.log('🚀 ~ Icon ~ getSvg ~ key:', key); const iconMarkup = await iconMarkupFunc().catch((e: Error) => console.error(`SVG icon: ${e.message}`)); return unsafeSVG(iconMarkup as string); } diff --git a/src/components/sidebar/sidebarNav.ts b/src/components/sidebar/sidebarNav.ts index 19dbb0d3..41434915 100644 --- a/src/components/sidebar/sidebarNav.ts +++ b/src/components/sidebar/sidebarNav.ts @@ -1,5 +1,7 @@ import { html, LitElement } from 'lit'; -import { customElement, query, state } from 'lit/decorators.js'; +import { customElement, state } from 'lit/decorators.js'; + +import '../icon'; type SiteMapEntry = { path: string; diff --git a/types/components/sidebar/sidebarNav.d.ts b/types/components/sidebar/sidebarNav.d.ts index f0960d76..c66cafa4 100644 --- a/types/components/sidebar/sidebarNav.d.ts +++ b/types/components/sidebar/sidebarNav.d.ts @@ -1,4 +1,5 @@ import { LitElement } from 'lit'; +import '../icon'; type SiteMapEntry = { path: string; title: string;