From 7b485c54b3a17147e715eda4d619abe49df6305f Mon Sep 17 00:00:00 2001 From: mbehzad Date: Fri, 17 May 2024 12:25:45 +0200 Subject: [PATCH] (fix #71) instead of html as text, render the dom nodes directly to prevent any issues by rendering escaped html --- dist/banner/banner.js | 2 +- dist/banner/banner.js.map | 2 +- documentation.md | 2 +- src/blocks/banner/banner.ts | 8 ++++---- .../sidekick/extractSidekickLibraryId.spec.ts | 9 +++++---- src/helpers/sidekick/extractSidekickLibraryId.ts | 16 ++++++++-------- .../sidekick/extractSidekickLibraryId.d.ts | 12 ++++++------ 7 files changed, 26 insertions(+), 25 deletions(-) diff --git a/dist/banner/banner.js b/dist/banner/banner.js index 7069175a..5d5ea5d0 100644 --- a/dist/banner/banner.js +++ b/dist/banner/banner.js @@ -1,2 +1,2 @@ -import{T as p,j as L,x as h}from"../__chunks__/lit-element.CH8ciVnL.js";import{e as b,i as S,o as $}from"../__chunks__/unsafe-html.C_rT9aKG.js";import{i as y}from"../__chunks__/isSidekickLibraryActive.U-fJCMMj.js";const d=r=>{const t={dataLibraryId:void 0,innerHTML:"",href:""};if(!r)return t;t.innerHTML=r.innerHTML,r instanceof HTMLAnchorElement&&r.href!==""&&(t.href=r.href);const e=r.getAttribute("data-library-id");return y()&&e!==null&&(t.dataLibraryId=e),t};class A extends S{update(t,e){this.part=t;const i=e[0];return this.render(i)}render(t){var c;if(y()===!1)return p;const e=(c=this.part)==null?void 0:c.element,{dataLibraryId:i,href:n}=t;return i&&(e==null||e.setAttribute("data-library-id",i)),i&&(e==null||e.setAttribute("contenteditable","true")),n&&e instanceof HTMLAnchorElement&&(e==null||e.setAttribute("href",n)),p}}const o=b(A),T=r=>{const{headline:t,subline:e,texts:i,buttons:n,picture:c}=r;return h``};function M(r){const t=r.querySelector("img");t&&t.setAttribute("loading","eager");const e=r.querySelector("div"),i=r.children[1],n=d(e==null?void 0:e.querySelector("h1")),c=d(e==null?void 0:e.querySelector("h3")),a=e?[...e.querySelectorAll("p")].map(l=>d(l)):[],f=i?[...i.querySelectorAll("a")].map(l=>d(l)):[],s=(e==null?void 0:e.querySelector("picture"))||void 0,u=s==null?void 0:s.querySelector("img");u==null||u.setAttribute("loading","eager"),r.innerHTML="",r.style.removeProperty("display"),L(T({headline:n,subline:c,texts:a,buttons:f,picture:s}),r)}export{M as default}; +import{T as p,j as b,x as h}from"../__chunks__/lit-element.CH8ciVnL.js";import{e as S,i as m,o as $}from"../__chunks__/unsafe-html.C_rT9aKG.js";import{i as y}from"../__chunks__/isSidekickLibraryActive.U-fJCMMj.js";const d=t=>{const r={dataLibraryId:void 0,content:new DocumentFragment,href:""};if(!t)return r;r.content.append(...t.cloneNode(!0).childNodes),t instanceof HTMLAnchorElement&&t.href!==""&&(r.href=t.href);const e=t.getAttribute("data-library-id");return y()&&e!==null&&(r.dataLibraryId=e),r};class g extends m{update(r,e){this.part=r;const i=e[0];return this.render(i)}render(r){var c;if(y()===!1)return p;const e=(c=this.part)==null?void 0:c.element,{dataLibraryId:i,href:n}=r;return i&&(e==null||e.setAttribute("data-library-id",i)),i&&(e==null||e.setAttribute("contenteditable","true")),n&&e instanceof HTMLAnchorElement&&(e==null||e.setAttribute("href",n)),p}}const s=S(g),v=t=>{const{headline:r,subline:e,texts:i,buttons:n,picture:c}=t;return h``};function k(t){const r=t.querySelector("img");r&&r.setAttribute("loading","eager");const e=t.querySelector("div"),i=t.children[1],n=d(e==null?void 0:e.querySelector("h1")),c=d(e==null?void 0:e.querySelector("h3")),a=e?[...e.querySelectorAll("p")].map(l=>d(l)):[],f=i?[...i.querySelectorAll("a")].map(l=>d(l)):[],o=(e==null?void 0:e.querySelector("picture"))||void 0,u=o==null?void 0:o.querySelector("img");u==null||u.setAttribute("loading","eager"),t.innerHTML="",t.style.removeProperty("display"),b(v({headline:n,subline:c,texts:a,buttons:f,picture:o}),t)}export{k as default}; //# sourceMappingURL=banner.js.map diff --git a/dist/banner/banner.js.map b/dist/banner/banner.js.map index 8ddfc094..27fa878e 100644 --- a/dist/banner/banner.js.map +++ b/dist/banner/banner.js.map @@ -1 +1 @@ -{"version":3,"file":"banner.js","sources":["../../src/helpers/sidekick/extractSidekickLibraryId.ts","../../src/directives/sidekickLibraryId.ts","../../src/blocks/banner/banner.ts"],"sourcesContent":["import { isSidekickLibraryActive } from './isSidekickLibraryActive.ts';\n\n/**\n * Represents the constructed Element.\n *\n * @interface ConstructedElement\n * @property {string} dataLibraryId - The data library id generated by the Sidekick Library Plugin.\n * @property {string} innerHTML - The innerHTML of a provided element.\n * @property {string} href - The href of a provided anchor element.\n */\nexport type SidekickElement = {\n dataLibraryId?: string;\n innerHTML: string;\n href?: string;\n};\n\n/**\n * Extracts the innerHTML, the href attribute (if defined) and\n * the data-library-id attribute (if the Sidekick Library Plugin is active) of a given HTML element.\n *\n * @param {HTMLElement | HTMLAnchorElement | null} element - The original HTMLElement or HTMLAnchorElement.\n * @returns {SidekickElement} - A constructed element object.\n *\n * @example\n * const button = extractSidekickLibraryId(document.querySelector('a'));\n * \n * ${button.text}\n * \n *\n * @remarks\n * The data-library-id is generated by the Sidekick Library Plugin\n * and is necessary to copy edited block content from the Sidekick Library.\n */\nexport const extractSidekickLibraryId = (element?: HTMLElement | HTMLAnchorElement | null): SidekickElement => {\n const constructedElement: SidekickElement = {\n dataLibraryId: undefined,\n innerHTML: '',\n href: '',\n };\n if (!element) return constructedElement;\n\n constructedElement.innerHTML = element.innerHTML;\n if (element instanceof HTMLAnchorElement && element.href !== '') {\n constructedElement.href = element.href;\n }\n\n const sidekickLibraryId: string | null = element.getAttribute('data-library-id');\n if (isSidekickLibraryActive() && sidekickLibraryId !== null) {\n constructedElement.dataLibraryId = sidekickLibraryId;\n }\n\n return constructedElement;\n};\n","import { Directive, directive } from 'lit/directive.js';\nimport { AttributePart, nothing } from 'lit';\nimport { SidekickElement } from 'Helpers/sidekick/extractSidekickLibraryId';\nimport { isSidekickLibraryActive } from 'Helpers/sidekick//isSidekickLibraryActive';\n\n/**\n * Represents a directive for managing a sidekick library id.\n * @extends Directive\n *\n * @example\n *
\n *

${headline.innerHTML}

\n *

${subline.innerHTML}

\n *
\n */\nclass SidekickLibraryId extends Directive {\n private part?: AttributePart;\n\n /**\n * Update method called when the directive is updated.\n * @param {AttributePart} part - The attribute part to be updated.\n * @param {unknown[]} props - Array of properties passed to the directive.\n * @returns {unknown} - Returns the result of the render function.\n */\n update(part: AttributePart, props: unknown[]) {\n this.part = part;\n const SidekickElement = props[0] as SidekickElement;\n return this.render(SidekickElement);\n }\n\n /**\n * Render method for managing Sidekick Library attributes.\n * @param {SidekickElement} sidekickElement - Information about the Sidekick Library.\n * @returns {unknown} - Returns the result of the render operation.\n */\n render(sidekickElement: SidekickElement) {\n if (isSidekickLibraryActive() === false) return nothing;\n\n const element = this.part?.element;\n const { dataLibraryId, href } = sidekickElement;\n if (dataLibraryId) element?.setAttribute('data-library-id', dataLibraryId);\n if (dataLibraryId) element?.setAttribute('contenteditable', 'true');\n if (href && element instanceof HTMLAnchorElement) element?.setAttribute('href', href);\n return nothing;\n }\n}\n\nexport const getSidekickLibraryId = directive(SidekickLibraryId);\n","import { html, render } from 'lit';\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js';\nimport './banner.scss';\nimport { extractSidekickLibraryId, SidekickElement } from 'Helpers/sidekick/extractSidekickLibraryId';\nimport { getSidekickLibraryId } from 'Directives/sidekickLibraryId.ts';\n\ninterface TemplateArgs {\n headline: SidekickElement;\n subline: SidekickElement;\n picture?: HTMLPictureElement;\n texts: SidekickElement[];\n buttons: SidekickElement[];\n}\n\nconst template = (args: TemplateArgs) => {\n const { headline, subline, texts, buttons, picture } = args;\n return html`\n
\n
\n
\n

${headline.innerHTML}

\n

${subline.innerHTML}

\n
\n ${texts?.map((text) => html`

${text.innerHTML}

`)}\n \n
\n ${picture ?? unsafeHTML(picture)} \n
\n `;\n};\n\nexport default function (block: HTMLElement) {\n const image = block.querySelector('img');\n if (image) {\n image.setAttribute('loading', 'eager');\n }\n const firstRow = block.querySelector('div');\n const secondRow = block.children[1];\n const headline = extractSidekickLibraryId(firstRow?.querySelector('h1'));\n const subline = extractSidekickLibraryId(firstRow?.querySelector('h3'));\n const texts = firstRow ? [...firstRow.querySelectorAll('p')].map((item) => extractSidekickLibraryId(item)) : [];\n const buttons = secondRow ? [...secondRow.querySelectorAll('a')].map((item) => extractSidekickLibraryId(item)) : [];\n const picture = firstRow?.querySelector('picture') || undefined;\n const img = picture?.querySelector('img');\n img?.setAttribute('loading', 'eager');\n\n block.innerHTML = '';\n block.style.removeProperty('display');\n render(template({ headline, subline, texts, buttons, picture }), block);\n}\n"],"names":["extractSidekickLibraryId","element","constructedElement","sidekickLibraryId","isSidekickLibraryActive","SidekickLibraryId","Directive","part","props","SidekickElement","sidekickElement","nothing","_a","dataLibraryId","href","getSidekickLibraryId","directive","template","args","headline","subline","texts","buttons","picture","html","text","button","unsafeHTML","banner","block","image","firstRow","secondRow","item","img","render"],"mappings":"sNAoCa,MAAAA,EAA4BC,GAAsE,CAC7G,MAAMC,EAAsC,CAC1C,cAAe,OACf,UAAW,GACX,KAAM,EAAA,EAER,GAAI,CAACD,EAAgB,OAAAC,EAErBA,EAAmB,UAAYD,EAAQ,UACnCA,aAAmB,mBAAqBA,EAAQ,OAAS,KAC3DC,EAAmB,KAAOD,EAAQ,MAG9B,MAAAE,EAAmCF,EAAQ,aAAa,iBAAiB,EAC3E,OAAAG,EAAA,GAA6BD,IAAsB,OACrDD,EAAmB,cAAgBC,GAG9BD,CACT,ECxCA,MAAMG,UAA0BC,CAAU,CASxC,OAAOC,EAAqBC,EAAkB,CAC5C,KAAK,KAAOD,EACNE,MAAAA,EAAkBD,EAAM,CAAC,EACxB,OAAA,KAAK,OAAOC,CAAe,CACpC,CAOA,OAAOC,EAAkC,OACvC,GAAIN,EAA8B,IAAA,GAAc,OAAAO,EAE1C,MAAAV,GAAUW,EAAA,KAAK,OAAL,YAAAA,EAAW,QACrB,CAAE,cAAAC,EAAe,KAAAC,CAAS,EAAAJ,EAC5B,OA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UQ,GAAA,YAAAA,EAAU,cAAc,aAAc,OAChDG,EAAMX,GAAA,YAAAA,EAAS,cAAc,OAC9BW,GAAA,MAAAA,EAAA,aAAa,UAAW,SAE7BL,EAAM,UAAY,GACZA,EAAA,MAAM,eAAe,SAAS,EAC7BM,EAAAlB,EAAS,CAAE,SAAAE,EAAU,QAAAC,EAAS,MAAAC,EAAO,QAAAC,EAAS,QAAAC,CAAA,CAAS,EAAGM,CAAK,CACxE"} \ No newline at end of file +{"version":3,"file":"banner.js","sources":["../../src/helpers/sidekick/extractSidekickLibraryId.ts","../../src/directives/sidekickLibraryId.ts","../../src/blocks/banner/banner.ts"],"sourcesContent":["import { isSidekickLibraryActive } from './isSidekickLibraryActive.ts';\n\n/**\n * Represents the constructed Element.\n *\n * @interface ConstructedElement\n * @property {string} dataLibraryId - The data library id generated by the Sidekick Library Plugin.\n * @property {string} innerHTML - The innerHTML of a provided element.\n * @property {string} href - The href of a provided anchor element.\n */\nexport type SidekickElement = {\n dataLibraryId?: string;\n content: DocumentFragment;\n href?: string;\n};\n\n/**\n * Extracts the innerHTML, the href attribute (if defined) and\n * the data-library-id attribute (if the Sidekick Library Plugin is active) of a given HTML element.\n *\n * @param {HTMLElement | HTMLAnchorElement | null} element - The original HTMLElement or HTMLAnchorElement.\n * @returns {SidekickElement} - A constructed element object.\n *\n * @example\n * const cta = extractSidekickLibraryId(document.querySelector('a'));\n * \n * ${cta.content}\n * \n *\n * @remarks\n * The data-library-id is generated by the Sidekick Library Plugin\n * and is necessary to copy edited block content from the Sidekick Library.\n */\nexport const extractSidekickLibraryId = (element?: HTMLElement | HTMLAnchorElement | null): SidekickElement => {\n const constructedElement: SidekickElement = {\n dataLibraryId: undefined,\n content: new DocumentFragment(),\n href: '',\n };\n if (!element) return constructedElement;\n\n constructedElement.content.append(...element.cloneNode(true).childNodes);\n if (element instanceof HTMLAnchorElement && element.href !== '') {\n constructedElement.href = element.href;\n }\n\n const sidekickLibraryId: string | null = element.getAttribute('data-library-id');\n if (isSidekickLibraryActive() && sidekickLibraryId !== null) {\n constructedElement.dataLibraryId = sidekickLibraryId;\n }\n\n return constructedElement;\n};\n","import { Directive, directive } from 'lit/directive.js';\nimport { AttributePart, nothing } from 'lit';\nimport { SidekickElement } from 'Helpers/sidekick/extractSidekickLibraryId';\nimport { isSidekickLibraryActive } from 'Helpers/sidekick//isSidekickLibraryActive';\n\n/**\n * Represents a directive for managing a sidekick library id.\n * @extends Directive\n *\n * @example\n *
\n *

${headline.innerHTML}

\n *

${subline.innerHTML}

\n *
\n */\nclass SidekickLibraryId extends Directive {\n private part?: AttributePart;\n\n /**\n * Update method called when the directive is updated.\n * @param {AttributePart} part - The attribute part to be updated.\n * @param {unknown[]} props - Array of properties passed to the directive.\n * @returns {unknown} - Returns the result of the render function.\n */\n update(part: AttributePart, props: unknown[]) {\n this.part = part;\n const SidekickElement = props[0] as SidekickElement;\n return this.render(SidekickElement);\n }\n\n /**\n * Render method for managing Sidekick Library attributes.\n * @param {SidekickElement} sidekickElement - Information about the Sidekick Library.\n * @returns {unknown} - Returns the result of the render operation.\n */\n render(sidekickElement: SidekickElement) {\n if (isSidekickLibraryActive() === false) return nothing;\n\n const element = this.part?.element;\n const { dataLibraryId, href } = sidekickElement;\n if (dataLibraryId) element?.setAttribute('data-library-id', dataLibraryId);\n if (dataLibraryId) element?.setAttribute('contenteditable', 'true');\n if (href && element instanceof HTMLAnchorElement) element?.setAttribute('href', href);\n return nothing;\n }\n}\n\nexport const getSidekickLibraryId = directive(SidekickLibraryId);\n","import { html, render } from 'lit';\nimport { unsafeHTML } from 'lit-html/directives/unsafe-html.js';\nimport './banner.scss';\nimport { extractSidekickLibraryId, SidekickElement } from 'Helpers/sidekick/extractSidekickLibraryId';\nimport { getSidekickLibraryId } from 'Directives/sidekickLibraryId.ts';\n\ninterface TemplateArgs {\n headline: SidekickElement;\n subline: SidekickElement;\n picture?: HTMLPictureElement;\n texts: SidekickElement[];\n buttons: SidekickElement[];\n}\n\nconst template = (args: TemplateArgs) => {\n const { headline, subline, texts, buttons, picture } = args;\n return html`\n
\n
\n
\n

${headline.content}

\n

${subline.content}

\n
\n ${texts?.map((text) => html`
${text.content}
`)}\n \n
\n ${picture ?? unsafeHTML(picture)} \n
\n `;\n};\n\nexport default function (block: HTMLElement) {\n const image = block.querySelector('img');\n if (image) {\n image.setAttribute('loading', 'eager');\n }\n const firstRow = block.querySelector('div');\n const secondRow = block.children[1];\n const headline = extractSidekickLibraryId(firstRow?.querySelector('h1'));\n const subline = extractSidekickLibraryId(firstRow?.querySelector('h3'));\n const texts = firstRow ? [...firstRow.querySelectorAll('p')].map((item) => extractSidekickLibraryId(item)) : [];\n const buttons = secondRow ? [...secondRow.querySelectorAll('a')].map((item) => extractSidekickLibraryId(item)) : [];\n const picture = firstRow?.querySelector('picture') || undefined;\n const img = picture?.querySelector('img');\n img?.setAttribute('loading', 'eager');\n\n block.innerHTML = '';\n block.style.removeProperty('display');\n render(template({ headline, subline, texts, buttons, picture }), block);\n}\n"],"names":["extractSidekickLibraryId","element","constructedElement","sidekickLibraryId","isSidekickLibraryActive","SidekickLibraryId","Directive","part","props","SidekickElement","sidekickElement","nothing","_a","dataLibraryId","href","getSidekickLibraryId","directive","template","args","headline","subline","texts","buttons","picture","html","text","button","unsafeHTML","banner","block","image","firstRow","secondRow","item","img","render"],"mappings":"sNAoCa,MAAAA,EAA4BC,GAAsE,CAC7G,MAAMC,EAAsC,CAC1C,cAAe,OACf,QAAS,IAAI,iBACb,KAAM,EAAA,EAER,GAAI,CAACD,EAAgB,OAAAC,EAErBA,EAAmB,QAAQ,OAAO,GAAGD,EAAQ,UAAU,EAAI,EAAE,UAAU,EACnEA,aAAmB,mBAAqBA,EAAQ,OAAS,KAC3DC,EAAmB,KAAOD,EAAQ,MAG9B,MAAAE,EAAmCF,EAAQ,aAAa,iBAAiB,EAC3E,OAAAG,EAAA,GAA6BD,IAAsB,OACrDD,EAAmB,cAAgBC,GAG9BD,CACT,ECxCA,MAAMG,UAA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,EACjEX,EAAUpB,EAAyB+B,GAAA,YAAAA,EAAU,cAAc,KAAK,EAChEV,EAAQU,EAAW,CAAC,GAAGA,EAAS,iBAAiB,GAAG,CAAC,EAAE,IAAKE,GAASjC,EAAyBiC,CAAI,CAAC,EAAI,CAAA,EACvGX,EAAUU,EAAY,CAAC,GAAGA,EAAU,iBAAiB,GAAG,CAAC,EAAE,IAAKC,GAASjC,EAAyBiC,CAAI,CAAC,EAAI,CAAA,EAC3GV,GAAUQ,GAAA,YAAAA,EAAU,cAAc,aAAc,OAChDG,EAAMX,GAAA,YAAAA,EAAS,cAAc,OAC9BW,GAAA,MAAAA,EAAA,aAAa,UAAW,SAE7BL,EAAM,UAAY,GACZA,EAAA,MAAM,eAAe,SAAS,EAC7BM,EAAAlB,EAAS,CAAE,SAAAE,EAAU,QAAAC,EAAS,MAAAC,EAAO,QAAAC,EAAS,QAAAC,CAAA,CAAS,EAAGM,CAAK,CACxE"} \ No newline at end of file diff --git a/documentation.md b/documentation.md index 82aa84f2..2d819a9d 100644 --- a/documentation.md +++ b/documentation.md @@ -283,7 +283,7 @@ Represents the constructed Element. | ---------- | ---------- | | `SidekickElement` | `{ dataLibraryId?: string; - innerHTML: string; + content: DocumentFragment; href?: string; }` | diff --git a/src/blocks/banner/banner.ts b/src/blocks/banner/banner.ts index f9bec2b1..659c814d 100644 --- a/src/blocks/banner/banner.ts +++ b/src/blocks/banner/banner.ts @@ -18,15 +18,15 @@ const template = (args: TemplateArgs) => {