@limetech/lime-elements 39.4.0 → 39.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,4 +4,4 @@ import{g as e}from"./p-BFTU3MAI.js";import{s as t,v as n,e as r,f as i,E as o,g
4
4
  * @version v0.2.1
5
5
  * @link http://github.com/noeldelgado/parse-css-color/
6
6
  * @license MIT
7
- */const Ul=["background-color","color","font-style","font-weight","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-decoration","width","height","min-width","min-height"];function Hl(e){var t;e.tagName&&(null===(t=e.properties)||void 0===t?void 0:t.style)&&(e.properties.style=function(e){try{const t=function(e){const t=Object.assign({},e);return delete t.background,"background"in e&&null!==(e=>{if("string"!=typeof e)return null;const t=bl.exec(e);if(t)return function(e){const[t,n,r,i]=ml(e,{format:"array"});return Bl([null,t,n,r,i])}(t[0]);const n=Tl.exec(e)||xl.exec(e);if(n)return function([,e,t,n,r=1]){let i=e;return i=i.endsWith("turn")?360*parseFloat(i)/1:i.endsWith("rad")?Math.round(180*parseFloat(i)/Math.PI):parseFloat(i),{type:"hsl",values:[i,ql(t),ql(n)],alpha:Fl(null===r?1:r)}}(n);const r=Ll.exec(e)||Il.exec(e)||Al.exec(e)||Rl.exec(e);if(r)return Bl(r);if(Ol.exec(e))return Bl([null,0,0,0,0]);const i=pl[e.toLowerCase()];return i?Bl([null,i[0],i[1],i[2],1]):null})(e.background)&&(t["background-color"]=e.background),t}(dl(e));return Object.entries(t).filter((([e])=>Ul.includes(e))).map((([e,t])=>`${e}: ${t}`)).join("; ")}catch(t){return console.error("Failed to parse style value",e,t),""}}(e.properties.style))}const zl=/\u00A0/g,jl=["200B","200C","200D","FEFF"],Vl=new Set(["audio","canvas","embed","iframe","img","input","object","svg","video"]),Gl=new Set(["br"]),$l=(e,t)=>{if(e&&"object"==typeof e){if("element"===e.type&&"p"===e.tagName&&t&&Yl(e)&&Array.isArray(t.children)){const n=t.children.indexOf(e);if(-1!==n)return void t.children.splice(n,1)}if(Array.isArray(e.children)&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)$l(e.children[t],e)}},Yl=e=>!Array.isArray(e.children)||0===e.children.length||e.children.every((e=>Wl(e))),Wl=e=>{if(!e)return!0;if("text"===e.type)return Ql("string"==typeof e.value?e.value:"");if("comment"===e.type)return!0;if("element"===e.type){const t=e,n=t.tagName;return"string"!=typeof n||!Vl.has(n)&&(!!Gl.has(n)||!Array.isArray(t.children)||0===t.children.length||t.children.every((e=>Wl(e))))}return!0},Ql=e=>{if(!e)return!0;const t=(e=>{let t=e;for(const e of jl){const n=String.fromCodePoint(Number.parseInt(e,16));t=t.split(n).join("")}return t})(e.replaceAll(zl," "));return""===t.trim()};async function Xl(e,t){var r;(null==t?void 0:t.forceHardLineBreaks)&&(e=e.replaceAll(/(?<!\\)([\n\r])/g," $1"));return(await c().use(at).use(Or).use(Ct,{allowDangerousHtml:!0}).use(nl).use((()=>e=>(n(e,"element",(e=>{var t,n;if("a"===e.tagName){const r=null===(t=e.properties)||void 0===t?void 0:t.href,i=null===(n=e.properties)||void 0===n?void 0:n.title;if(!r)return;const o=p(r,i);e.properties.target=o.target,e.properties.rel=o.rel,e.properties.referrerpolicy=o.referrerpolicy}})),e))).use(u,Object.assign({},Zl(null!==(r=null==t?void 0:t.whitelist)&&void 0!==r?r:[]))).use((()=>e=>{n(e,"element",Hl)})).use(((e=!1)=>()=>e?e=>($l(e,null),e):e=>e)(null==t?void 0:t.removeEmptyParagraphs)).use(function(e=!1){return()=>e?e=>(n(e,"element",(e=>{"img"===e.tagName&&(e.properties=e.properties||{},e.properties.loading="lazy",e.properties.src&&(e.properties["data-src"]=e.properties.src,e.properties.src=void 0))})),e):e=>e}(null==t?void 0:t.lazyLoadImages)).use(h).process(e)).toString()}async function Kl(e,t){return(await c().use(f).use(u,Object.assign({},Zl(null!=t?t:[]))).use((()=>e=>{n(e,"element",Hl)})).use(h).process(e)).toString()}function Zl(e){var t,n,r,i;const o=[...null!==(t=d.attributes["*"])&&void 0!==t?t:[]].filter((e=>"height"!==e));o.push("style");const a=Object.assign(Object.assign({},d),{strip:[...null!==(n=d.strip)&&void 0!==n?n:[],"style"],tagNames:[...d.tagNames||[],...e.map((e=>e.tagName))],attributes:Object.assign(Object.assign({},d.attributes),{p:[...null!==(r=d.attributes.p)&&void 0!==r?r:[],["className","MsoNormal"]],a:[...null!==(i=d.attributes.a)&&void 0!==i?i:[],"referrerpolicy"],"*":o})});for(const t of e)a.attributes[t.tagName]=t.attributes;return a}export{p as g,Xl as m,Kl as s}
7
+ */const Ul=["background-color","color","font-style","font-weight","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-decoration","width","height","min-width","min-height"];function Hl(e){var t;e.tagName&&(null===(t=e.properties)||void 0===t?void 0:t.style)&&(e.properties.style=function(e){try{const t=function(e){const t=Object.assign({},e);return delete t.background,"background"in e&&null!==(e=>{if("string"!=typeof e)return null;const t=bl.exec(e);if(t)return function(e){const[t,n,r,i]=ml(e,{format:"array"});return Bl([null,t,n,r,i])}(t[0]);const n=Tl.exec(e)||xl.exec(e);if(n)return function([,e,t,n,r=1]){let i=e;return i=i.endsWith("turn")?360*parseFloat(i)/1:i.endsWith("rad")?Math.round(180*parseFloat(i)/Math.PI):parseFloat(i),{type:"hsl",values:[i,ql(t),ql(n)],alpha:Fl(null===r?1:r)}}(n);const r=Ll.exec(e)||Il.exec(e)||Al.exec(e)||Rl.exec(e);if(r)return Bl(r);if(Ol.exec(e))return Bl([null,0,0,0,0]);const i=pl[e.toLowerCase()];return i?Bl([null,i[0],i[1],i[2],1]):null})(e.background)&&(t["background-color"]=e.background),t}(dl(e));return Object.entries(t).filter((([e])=>Ul.includes(e))).map((([e,t])=>`${e}: ${t}`)).join("; ")}catch(t){return console.error("Failed to parse style value",e,t),""}}(e.properties.style))}const zl=/\u00A0/g,jl=["200B","200C","200D","FEFF"],Vl=new Set(["audio","canvas","embed","iframe","img","input","object","svg","video"]),Gl=new Set(["br"]),$l=(e,t)=>{if(e&&"object"==typeof e){if("element"===e.type&&"p"===e.tagName&&t&&Yl(e)&&Array.isArray(t.children)){const n=t.children.indexOf(e);if(-1!==n)return void t.children.splice(n,1)}if(Array.isArray(e.children)&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)$l(e.children[t],e)}},Yl=e=>!Array.isArray(e.children)||0===e.children.length||e.children.every((e=>Wl(e))),Wl=e=>{if(!e)return!0;if("text"===e.type)return Xl("string"==typeof e.value?e.value:"");if("comment"===e.type)return!0;if("element"===e.type){const t=e,n=t.tagName;return"string"!=typeof n||!Ql(n)&&(!!Gl.has(n)||!Array.isArray(t.children)||0===t.children.length||t.children.every((e=>Wl(e))))}return!0},Ql=e=>Vl.has(e)||(e=>e.includes("-"))(e),Xl=e=>{if(!e)return!0;const t=(e=>{let t=e;for(const e of jl){const n=String.fromCodePoint(Number.parseInt(e,16));t=t.split(n).join("")}return t})(e.replaceAll(zl," "));return""===t.trim()};async function Kl(e,t){var r;(null==t?void 0:t.forceHardLineBreaks)&&(e=e.replaceAll(/(?<!\\)([\n\r])/g," $1"));return(await c().use(at).use(Or).use(Ct,{allowDangerousHtml:!0}).use(nl).use((()=>e=>(n(e,"element",(e=>{var t,n;if("a"===e.tagName){const r=null===(t=e.properties)||void 0===t?void 0:t.href,i=null===(n=e.properties)||void 0===n?void 0:n.title;if(!r)return;const o=p(r,i);e.properties.target=o.target,e.properties.rel=o.rel,e.properties.referrerpolicy=o.referrerpolicy}})),e))).use(u,Object.assign({},Jl(null!==(r=null==t?void 0:t.whitelist)&&void 0!==r?r:[]))).use((()=>e=>{n(e,"element",Hl)})).use(((e=!1)=>()=>e?e=>($l(e,null),e):e=>e)(null==t?void 0:t.removeEmptyParagraphs)).use(function(e=!1){return()=>e?e=>(n(e,"element",(e=>{"img"===e.tagName&&(e.properties=e.properties||{},e.properties.loading="lazy",e.properties.src&&(e.properties["data-src"]=e.properties.src,e.properties.src=void 0))})),e):e=>e}(null==t?void 0:t.lazyLoadImages)).use(h).process(e)).toString()}async function Zl(e,t){return(await c().use(f).use(u,Object.assign({},Jl(null!=t?t:[]))).use((()=>e=>{n(e,"element",Hl)})).use(h).process(e)).toString()}function Jl(e){var t,n,r,i;const o=[...null!==(t=d.attributes["*"])&&void 0!==t?t:[]].filter((e=>"height"!==e));o.push("style");const a=Object.assign(Object.assign({},d),{strip:[...null!==(n=d.strip)&&void 0!==n?n:[],"style"],tagNames:[...d.tagNames||[],...e.map((e=>e.tagName))],attributes:Object.assign(Object.assign({},d.attributes),{p:[...null!==(r=d.attributes.p)&&void 0!==r?r:[],["className","MsoNormal"]],a:[...null!==(i=d.attributes.a)&&void 0!==i?i:[],"referrerpolicy"],"*":o})});for(const t of e)a.attributes[t.tagName]=t.attributes;return a}export{p as g,Kl as m,Zl as s}
@@ -1 +1 @@
1
- import{r as e,h as t,H as o}from"./p-DBTJNfo7.js";import{m as r}from"./p-BRCcjfVu.js";import{g as a}from"./p-Dnt5w_Bp.js";import{d as l}from"./p-2kcqdtMr.js";import"./p-BFTU3MAI.js";class n{constructor(e){this.handleIntersection=e=>{for(const t of e)if(t.isIntersecting){const e=t.target,o=e.dataset.src;o&&(e.setAttribute("src",o),delete e.dataset.src),this.observer.unobserve(e)}},this.observer=new IntersectionObserver(this.handleIntersection);const t=e.querySelectorAll("img");for(const e of t)this.observer.observe(e)}disconnect(){this.observer.disconnect()}}var i;const s=new Map(Object.entries(null!==(i=l.protocols)&&void 0!==i?i:{}).map((([e,t])=>[e,new Set(t)])));function d(e,t){for(const o of t){const t=e.getAttribute(o);if(!t)continue;const r=m(t);if(void 0!==r){const t=h(r);e[b(o)]=t}}}function m(e){const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t)}catch(e){try{const e=t.replaceAll("&#x22;",'"').replaceAll("&#34;",'"').replaceAll("&quot;",'"').replaceAll("&#x27;","'").replaceAll("&#39;","'").replaceAll("&apos;","'").replaceAll("&amp;","&");return JSON.parse(e)}catch(e){return}}}function c(e,t){const o=e.trim(),r=o.indexOf(":");if(-1===r||/[?#/]/.test(o.slice(0,r)))return!0;const a=o.slice(0,r).toLowerCase();return t.has(a)}function h(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(h);const t=Object.assign({},e);for(const e of Object.keys(t)){const o=s.get(e);o&&"string"==typeof t[e]&&!c(t[e],o)?(console.warn(`limel-markdown: Removed unsafe URL from "${e}" during sanitization.`),delete t[e]):"object"==typeof t[e]&&null!==t[e]&&(t[e]=h(t[e]))}return t}function b(e){return e.replaceAll(/-([a-z])/g,((e,t)=>t.toUpperCase()))}const f=[{tagName:"limel-chip",attributes:["text","icon","link","badge","disabled","readonly","selected","type","size"]},{tagName:"limel-icon",attributes:["name","size","badge"]},{tagName:"limel-badge",attributes:["label"]},{tagName:"limel-callout",attributes:["heading","icon","type"]},{tagName:"limel-linear-progress",attributes:["value","indeterminate"]},{tagName:"limel-circular-progress",attributes:["value","max-value","prefix","suffix","size","display-percentage-colors"]},{tagName:"limel-spinner",attributes:["size"]},{tagName:"limel-info-tile",attributes:["value","icon","label","prefix","suffix","badge"]}],g=class{constructor(t){e(this,t),this.value="",this.whitelist=a.markdownWhitelist,this.lazyLoadImages=!1,this.removeEmptyParagraphs=!0,this.imageIntersectionObserver=null}async textChanged(){try{this.cleanupImageIntersectionObserver(),this.cachedCombinedWhitelist&&this.whitelist===this.cachedConsumerWhitelist||(this.cachedConsumerWhitelist=this.whitelist,this.cachedCombinedWhitelist=function(e,t){if(!(null==t?void 0:t.length))return e.map((e=>Object.assign(Object.assign({},e),{attributes:[...e.attributes]})));const o=new Map;for(const r of[...e,...t]){const e=o.get(r.tagName);if(e)for(const t of r.attributes)e.add(t);else o.set(r.tagName,new Set(r.attributes))}return[...o.entries()].map((([e,t])=>({tagName:e,attributes:[...t]})))}(f,this.whitelist));const e=this.cachedCombinedWhitelist,t=await r(this.value,{forceHardLineBreaks:!0,whitelist:e,lazyLoadImages:this.lazyLoadImages,removeEmptyParagraphs:this.removeEmptyParagraphs});this.rootElement.innerHTML=t,function(e,t){if(e&&(null==t?void 0:t.length))for(const o of t){const t=e.querySelectorAll(o.tagName);for(const e of t)d(e,o.attributes)}}(this.rootElement,e),this.setupImageIntersectionObserver()}catch(e){console.error(e)}}handleWhitelistChange(){return this.textChanged()}handleRemoveEmptyParagraphsChange(){return this.textChanged()}async componentDidLoad(){this.textChanged()}disconnectedCallback(){this.cleanupImageIntersectionObserver()}render(){return t(o,{key:"61ca61192c4d1141494ced2b431770cccb623581"},t("div",{key:"b0ebadbc5b2ee426df9f1a0c77d88cf162a43bcc",id:"markdown",ref:e=>this.rootElement=e}))}setupImageIntersectionObserver(){this.lazyLoadImages&&(this.imageIntersectionObserver=new n(this.rootElement))}cleanupImageIntersectionObserver(){this.imageIntersectionObserver&&(this.imageIntersectionObserver.disconnect(),this.imageIntersectionObserver=null)}static get watchers(){return{value:[{textChanged:0}],whitelist:[{handleWhitelistChange:0}],removeEmptyParagraphs:[{handleRemoveEmptyParagraphsChange:0}]}}};g.style='@charset "UTF-8";code{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:var(--limel-theme-default-small-font-size);letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:var(--limel-theme-default-font-size)}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:var(--limel-theme-default-font-size);word-break:break-word}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:"";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0}:host(limel-markdown:not(.no-table-styles)) tbody{border:1px solid rgb(var(--contrast-400));border-radius:0.25rem}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:var(--limel-theme-default-font-size)}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}table{display:block;box-sizing:border-box;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}blockquote{position:relative;max-width:100%;margin:0.75rem 0;padding:0.5rem;border-left:0.25rem solid rgb(var(--contrast-500));background-color:rgb(var(--contrast-200))}blockquote:before,blockquote:after{position:absolute;line-height:0;font-size:2rem;opacity:0.4}blockquote:before{content:"“";left:-0.5rem;top:0.5rem}blockquote:after{content:"”";right:-0.25rem;bottom:-0.25rem}blockquote blockquote{padding-top:0;padding-right:0;padding-bottom:0;padding-left:0.25rem;border-color:rgb(var(--contrast-700));border-left-width:1px}blockquote blockquote:before,blockquote blockquote:after{display:none}blockquote:has(>blockquote){padding-left:0.25rem;padding-bottom:0}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:var(--limel-theme-default-font-size);margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}img{max-width:100%;border-radius:0.25rem}kbd{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-weight:600;color:rgb(var(--contrast-1100));background-color:rgb(var(--contrast-200));white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:normal;padding:0.125rem 0.5rem;margin:0 0.25rem;box-shadow:var(--button-shadow-normal), 0 0.03125rem 0.21875rem 0 rgba(var(--contrast-100), 0.5) inset;border-radius:0.125rem;border-style:solid;border-color:rgba(var(--contrast-600), 0.8);border-width:0 1px 0.125rem 1px}:host(limel-markdown.adjust-for-table-cell) img{max-height:1.25rem;vertical-align:middle}:host(limel-markdown.adjust-for-table-cell) p{display:inline}:host(limel-markdown.adjust-for-table-cell) h1,:host(limel-markdown.adjust-for-table-cell) h2,:host(limel-markdown.adjust-for-table-cell) h3,:host(limel-markdown.adjust-for-table-cell) h4,:host(limel-markdown.adjust-for-table-cell) h5,:host(limel-markdown.adjust-for-table-cell) h6{display:inline-block;vertical-align:bottom;font-size:var(--limel-theme-default-font-size);margin:0 0.25rem 0 0;letter-spacing:normal;font-weight:500}:host(limel-markdown.adjust-for-table-cell) h1:before,:host(limel-markdown.adjust-for-table-cell) h2:before,:host(limel-markdown.adjust-for-table-cell) h3:before,:host(limel-markdown.adjust-for-table-cell) h4:before,:host(limel-markdown.adjust-for-table-cell) h5:before,:host(limel-markdown.adjust-for-table-cell) h6:before{opacity:0.6;vertical-align:middle;font-size:0.5rem;border-radius:0.25rem 0 0 0.25rem;padding:0.25rem;padding-right:2rem;margin-right:-1.75rem;background:linear-gradient(to right, rgb(var(--contrast-800), 0.6), rgb(var(--contrast-800), 0))}:host(limel-markdown.adjust-for-table-cell) h1:before{content:"H1"}:host(limel-markdown.adjust-for-table-cell) h2:before{content:"H2"}:host(limel-markdown.adjust-for-table-cell) h3:before{content:"H3"}:host(limel-markdown.adjust-for-table-cell) h4:before{content:"H4"}:host(limel-markdown.adjust-for-table-cell) h5:before{content:"H5"}:host(limel-markdown.adjust-for-table-cell) h6:before{content:"H6"}:host(limel-markdown.adjust-for-table-cell) pre{margin:0}:host(limel-markdown.adjust-for-table-cell) pre>code{padding:0.125rem;margin:0}:host(limel-markdown.adjust-for-table-cell) dl{margin:0}:host(limel-markdown.adjust-for-table-cell) dl dt,:host(limel-markdown.adjust-for-table-cell) dl dd{padding:0.00625rem 0.125rem}*,*::before,*::after{box-sizing:border-box}* :where(:not(img,video,svg,canvas,iframe)),*::before :where(:not(img,video,svg,canvas,iframe)),*::after :where(:not(img,video,svg,canvas,iframe)){min-width:0;min-height:0}hr{border-top:1px solid rgb(var(--contrast-700))}.MsoNormal{margin:0}:host(limel-markdown.reset-img-height) #markdown img{height:auto}';export{g as limel_markdown}
1
+ import{r as e,h as t,H as o}from"./p-DBTJNfo7.js";import{m as r}from"./p-CfUOv15O.js";import{g as a}from"./p-Dnt5w_Bp.js";import{d as l}from"./p-2kcqdtMr.js";import"./p-BFTU3MAI.js";class n{constructor(e){this.handleIntersection=e=>{for(const t of e)if(t.isIntersecting){const e=t.target,o=e.dataset.src;o&&(e.setAttribute("src",o),delete e.dataset.src),this.observer.unobserve(e)}},this.observer=new IntersectionObserver(this.handleIntersection);const t=e.querySelectorAll("img");for(const e of t)this.observer.observe(e)}disconnect(){this.observer.disconnect()}}var i;const s=new Map(Object.entries(null!==(i=l.protocols)&&void 0!==i?i:{}).map((([e,t])=>[e,new Set(t)])));function d(e,t){for(const o of t){const t=e.getAttribute(o);if(!t)continue;const r=m(t);if(void 0!==r){const t=h(r);e[b(o)]=t}}}function m(e){const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.parse(t)}catch(e){try{const e=t.replaceAll("&#x22;",'"').replaceAll("&#34;",'"').replaceAll("&quot;",'"').replaceAll("&#x27;","'").replaceAll("&#39;","'").replaceAll("&apos;","'").replaceAll("&amp;","&");return JSON.parse(e)}catch(e){return}}}function c(e,t){const o=e.trim(),r=o.indexOf(":");if(-1===r||/[?#/]/.test(o.slice(0,r)))return!0;const a=o.slice(0,r).toLowerCase();return t.has(a)}function h(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(h);const t=Object.assign({},e);for(const e of Object.keys(t)){const o=s.get(e);o&&"string"==typeof t[e]&&!c(t[e],o)?(console.warn(`limel-markdown: Removed unsafe URL from "${e}" during sanitization.`),delete t[e]):"object"==typeof t[e]&&null!==t[e]&&(t[e]=h(t[e]))}return t}function b(e){return e.replaceAll(/-([a-z])/g,((e,t)=>t.toUpperCase()))}const f=[{tagName:"limel-chip",attributes:["text","icon","link","badge","disabled","readonly","selected","type","size"]},{tagName:"limel-icon",attributes:["name","size","badge"]},{tagName:"limel-badge",attributes:["label"]},{tagName:"limel-callout",attributes:["heading","icon","type"]},{tagName:"limel-linear-progress",attributes:["value","indeterminate"]},{tagName:"limel-circular-progress",attributes:["value","max-value","prefix","suffix","size","display-percentage-colors"]},{tagName:"limel-spinner",attributes:["size"]},{tagName:"limel-info-tile",attributes:["value","icon","label","prefix","suffix","badge"]}],g=class{constructor(t){e(this,t),this.value="",this.whitelist=a.markdownWhitelist,this.lazyLoadImages=!1,this.removeEmptyParagraphs=!0,this.imageIntersectionObserver=null}async textChanged(){try{this.cleanupImageIntersectionObserver(),this.cachedCombinedWhitelist&&this.whitelist===this.cachedConsumerWhitelist||(this.cachedConsumerWhitelist=this.whitelist,this.cachedCombinedWhitelist=function(e,t){if(!(null==t?void 0:t.length))return e.map((e=>Object.assign(Object.assign({},e),{attributes:[...e.attributes]})));const o=new Map;for(const r of[...e,...t]){const e=o.get(r.tagName);if(e)for(const t of r.attributes)e.add(t);else o.set(r.tagName,new Set(r.attributes))}return[...o.entries()].map((([e,t])=>({tagName:e,attributes:[...t]})))}(f,this.whitelist));const e=this.cachedCombinedWhitelist,t=await r(this.value,{forceHardLineBreaks:!0,whitelist:e,lazyLoadImages:this.lazyLoadImages,removeEmptyParagraphs:this.removeEmptyParagraphs});this.rootElement.innerHTML=t,function(e,t){if(e&&(null==t?void 0:t.length))for(const o of t){const t=e.querySelectorAll(o.tagName);for(const e of t)d(e,o.attributes)}}(this.rootElement,e),this.setupImageIntersectionObserver()}catch(e){console.error(e)}}handleWhitelistChange(){return this.textChanged()}handleRemoveEmptyParagraphsChange(){return this.textChanged()}async componentDidLoad(){this.textChanged()}disconnectedCallback(){this.cleanupImageIntersectionObserver()}render(){return t(o,{key:"61ca61192c4d1141494ced2b431770cccb623581"},t("div",{key:"b0ebadbc5b2ee426df9f1a0c77d88cf162a43bcc",id:"markdown",ref:e=>this.rootElement=e}))}setupImageIntersectionObserver(){this.lazyLoadImages&&(this.imageIntersectionObserver=new n(this.rootElement))}cleanupImageIntersectionObserver(){this.imageIntersectionObserver&&(this.imageIntersectionObserver.disconnect(),this.imageIntersectionObserver=null)}static get watchers(){return{value:[{textChanged:0}],whitelist:[{handleWhitelistChange:0}],removeEmptyParagraphs:[{handleRemoveEmptyParagraphsChange:0}]}}};g.style='@charset "UTF-8";code{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-size:var(--limel-theme-default-small-font-size);letter-spacing:-0.0125rem;color:rgb(var(--contrast-1300));-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;display:inline-block;border-radius:0.25rem;padding:0.03125rem 0.25rem;background-color:rgb(var(--contrast-600))}pre>code{display:block;margin:0.5rem 0;padding:0.5rem 0.75rem;overflow:auto;white-space:pre-wrap}h1{font-size:1.5rem}h2{font-size:1.25rem}h3{font-size:1.125rem}h4{font-size:1rem}h5{font-size:var(--limel-theme-default-font-size)}h6{font-size:0.75rem}h1,h2{margin-top:0.5rem;margin-bottom:0.5rem;letter-spacing:-0.03125rem;font-weight:500}h3,h4{margin-top:0.75rem;margin-bottom:0.25rem;font-weight:600}h5,h6{margin-top:0.5rem;margin-bottom:0.125rem;font-weight:600}h1,h2,h3,h4,h5,h6{word-break:break-word;hyphens:auto;-webkit-hyphens:auto}:not([contenteditable=true]) h1,:not([contenteditable=true]) h2,:not([contenteditable=true]) h3,:not([contenteditable=true]) h4,:not([contenteditable=true]) h5,:not([contenteditable=true]) h6{text-wrap:balance}[contenteditable=true] h1,[contenteditable=true] h2,[contenteditable=true] h3,[contenteditable=true] h4,[contenteditable=true] h5,[contenteditable=true] h6{text-wrap:initial}:host(limel-markdown.truncate-paragraphs) p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}p,li{font-size:var(--limel-theme-default-font-size);word-break:break-word}a{word-break:break-all}p{margin-top:0;margin-bottom:0.5rem}p:only-child{margin-bottom:0}a{transition:color 0.2s ease;color:var(--markdown-hyperlink-color, rgb(var(--color-blue-dark)));text-decoration:none}a:hover{color:var(--markdown-hyperlink-color--hovered, rgb(var(--color-blue-default)))}hr{margin:1.75rem 0 2rem 0;border-width:0;border-top:1px solid rgb(var(--contrast-500))}ul{list-style:none}ul li{position:relative;margin-left:0.75rem}ul li:before{content:"";position:absolute;left:-0.5rem;top:0.5rem;width:0.25rem;height:0.25rem;border-radius:50%;background-color:rgb(var(--contrast-700));display:block}ol{margin-top:0.25rem;padding-left:1rem}ul{margin-top:0.25rem;padding-left:0}ul ul,ul ol,ol ol,ol ul{margin-left:0}li{margin-bottom:0.25rem}:host(limel-markdown:not(.no-table-styles)) table{table-layout:auto;min-width:100%;border-collapse:collapse;border-spacing:0;background:transparent;margin:0.75rem 0}:host(limel-markdown:not(.no-table-styles)) tbody{border:1px solid rgb(var(--contrast-400));border-radius:0.25rem}:host(limel-markdown:not(.no-table-styles)) th,:host(limel-markdown:not(.no-table-styles)) td{text-align:left;vertical-align:top;transition:background-color 0.2s ease;font-size:var(--limel-theme-default-font-size)}:host(limel-markdown:not(.no-table-styles)) td{padding:0.5rem 0.375rem 0.75rem 0.375rem}:host(limel-markdown:not(.no-table-styles)) tr th{background-color:rgb(var(--contrast-400));padding:0.25rem 0.375rem;font-weight:normal}:host(limel-markdown:not(.no-table-styles)) tr th:only-child{text-align:center}:host(limel-markdown:not(.no-table-styles)) tbody tr:nth-child(odd) td{background-color:rgb(var(--contrast-200))}:host(limel-markdown:not(.no-table-styles)) tbody tr:hover td{background-color:rgb(var(--contrast-300))}table{display:block;box-sizing:border-box;overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}blockquote{position:relative;max-width:100%;margin:0.75rem 0;padding:0.5rem;border-left:0.25rem solid rgb(var(--contrast-500));background-color:rgb(var(--contrast-200))}blockquote:before,blockquote:after{position:absolute;line-height:0;font-size:2rem;opacity:0.4}blockquote:before{content:"“";left:-0.5rem;top:0.5rem}blockquote:after{content:"”";right:-0.25rem;bottom:-0.25rem}blockquote blockquote{padding-top:0;padding-right:0;padding-bottom:0;padding-left:0.25rem;border-color:rgb(var(--contrast-700));border-left-width:1px}blockquote blockquote:before,blockquote blockquote:after{display:none}blockquote:has(>blockquote){padding-left:0.25rem;padding-bottom:0}dl{display:grid;grid-template-columns:1fr 2fr;grid-template-rows:1fr;margin-bottom:2rem;border:1px solid rgb(var(--contrast-400));border-radius:0.375rem;background-color:rgb(var(--contrast-200))}dl dt,dl dd{padding:0.375rem 0.5rem;font-size:var(--limel-theme-default-font-size);margin:0}dl dt:nth-of-type(even),dl dd:nth-of-type(even){background-color:rgb(var(--contrast-300))}dl dt:first-child{border-top-left-radius:0.375rem}dl dt:last-child{border-bottom-left-radius:0.375rem}dl dd:first-child{border-top-right-radius:0.375rem}dl dd:last-child{border-bottom-right-radius:0.375rem}img{max-width:100%;border-radius:0.25rem}kbd{font-family:ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;font-weight:600;color:rgb(var(--contrast-1100));background-color:rgb(var(--contrast-200));white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:normal;padding:0.125rem 0.5rem;margin:0 0.25rem;box-shadow:var(--button-shadow-normal), 0 0.03125rem 0.21875rem 0 rgba(var(--contrast-100), 0.5) inset;border-radius:0.125rem;border-style:solid;border-color:rgba(var(--contrast-600), 0.8);border-width:0 1px 0.125rem 1px}:host(limel-markdown.adjust-for-table-cell) img{max-height:1.25rem;vertical-align:middle}:host(limel-markdown.adjust-for-table-cell) p{display:inline}:host(limel-markdown.adjust-for-table-cell) h1,:host(limel-markdown.adjust-for-table-cell) h2,:host(limel-markdown.adjust-for-table-cell) h3,:host(limel-markdown.adjust-for-table-cell) h4,:host(limel-markdown.adjust-for-table-cell) h5,:host(limel-markdown.adjust-for-table-cell) h6{display:inline-block;vertical-align:bottom;font-size:var(--limel-theme-default-font-size);margin:0 0.25rem 0 0;letter-spacing:normal;font-weight:500}:host(limel-markdown.adjust-for-table-cell) h1:before,:host(limel-markdown.adjust-for-table-cell) h2:before,:host(limel-markdown.adjust-for-table-cell) h3:before,:host(limel-markdown.adjust-for-table-cell) h4:before,:host(limel-markdown.adjust-for-table-cell) h5:before,:host(limel-markdown.adjust-for-table-cell) h6:before{opacity:0.6;vertical-align:middle;font-size:0.5rem;border-radius:0.25rem 0 0 0.25rem;padding:0.25rem;padding-right:2rem;margin-right:-1.75rem;background:linear-gradient(to right, rgb(var(--contrast-800), 0.6), rgb(var(--contrast-800), 0))}:host(limel-markdown.adjust-for-table-cell) h1:before{content:"H1"}:host(limel-markdown.adjust-for-table-cell) h2:before{content:"H2"}:host(limel-markdown.adjust-for-table-cell) h3:before{content:"H3"}:host(limel-markdown.adjust-for-table-cell) h4:before{content:"H4"}:host(limel-markdown.adjust-for-table-cell) h5:before{content:"H5"}:host(limel-markdown.adjust-for-table-cell) h6:before{content:"H6"}:host(limel-markdown.adjust-for-table-cell) pre{margin:0}:host(limel-markdown.adjust-for-table-cell) pre>code{padding:0.125rem;margin:0}:host(limel-markdown.adjust-for-table-cell) dl{margin:0}:host(limel-markdown.adjust-for-table-cell) dl dt,:host(limel-markdown.adjust-for-table-cell) dl dd{padding:0.00625rem 0.125rem}*,*::before,*::after{box-sizing:border-box}* :where(:not(img,video,svg,canvas,iframe)),*::before :where(:not(img,video,svg,canvas,iframe)),*::after :where(:not(img,video,svg,canvas,iframe)){min-width:0;min-height:0}hr{border-top:1px solid rgb(var(--contrast-700))}.MsoNormal{margin:0}:host(limel-markdown.reset-img-height) #markdown img{height:auto}';export{g as limel_markdown}
@@ -0,0 +1 @@
1
+ import{r as e,c as r,h as i,H as t,a as o}from"./p-DBTJNfo7.js";import{i as a}from"./p-CrvUOVvg.js";import{g as s}from"./p-CgNJbSP4.js";import{g as n}from"./p-5eP2N9QI.js";const d=class{constructor(i){e(this,i),this.actionSelected=r(this,"actionSelected"),this.actions=[],this.clickable=!1,this.orientation="portrait",this.selected=!1,this.canScrollUp=!1,this.canScrollDown=!1,this.setMarkdownElement=e=>{var r;e!==this.markdownElement&&(this.markdownElement&&(null===(r=this.markdownResizeObserver)||void 0===r||r.disconnect(),this.markdownElement.removeEventListener("scroll",this.checkIfScrollable)),this.markdownElement=e,this.markdownElement&&(this.markdownResizeObserver=new ResizeObserver(this.checkIfScrollable),this.markdownResizeObserver.observe(this.markdownElement),this.markdownElement.addEventListener("scroll",this.checkIfScrollable,{passive:!0}),this.checkIfScrollable()))},this.checkIfScrollable=()=>{if(!this.markdownElement)return;const e=this.markdownElement.scrollHeight,r=this.markdownElement.clientHeight,i=this.markdownElement.scrollTop,t=e>r,o=t&&!(i+r>=e-2),a=t&&!(i<=1);this.canScrollDown!==o&&(this.canScrollDown=o),this.canScrollUp!==a&&(this.canScrollUp=a)},this.handleActionSelect=e=>{e.stopPropagation(),a(e.detail)&&this.actionSelected.emit(e.detail)},this.handleKeyDown=e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.host.click()))}}componentWillLoad(){const{handleMouseEnter:e,handleMouseLeave:r}=n(this.host);this.handleMouseEnter=e,this.handleMouseLeave=r}disconnectedCallback(){var e,r;null===(e=this.markdownResizeObserver)||void 0===e||e.disconnect(),null===(r=this.markdownElement)||void 0===r||r.removeEventListener("scroll",this.checkIfScrollable)}componentDidLoad(){this.setMarkdownElement(this.markdownElement)}render(){return i(t,{key:"a2dafb50c62b195eaa6e113c9fe19d86469e9a50",onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},i("section",{key:"a49f867517ad28fd7a2cdfc4c55310c2efac8e11",tabindex:this.clickable?0:void 0,role:this.clickable?"button":void 0,"aria-pressed":this.clickable?String(this.selected):void 0,onKeyDown:this.clickable?this.handleKeyDown:void 0},this.renderImage(),i("div",{key:"349b4d6fee7d71c67143298e8fcff4b833d38357",class:"body"},this.renderHeader(),this.renderSlot(),this.renderValue(),this.renderActionBar()),i("limel-3d-hover-effect-glow",{key:"252edc2030a277a808ea5cd200b0c54c7eb9c8a6"})))}renderImage(){var e;if(null===(e=this.image)||void 0===e?void 0:e.src)return i("div",{class:"image-wrapper"},i("img",{src:this.image.src,alt:this.image.alt,loading:"lazy"}))}renderHeader(){if(this.heading||this.subheading||this.icon)return i("header",null,this.renderIcon(),i("div",{class:"headings"},this.renderHeading(),this.renderSubheading()))}renderIcon(){var e;const r=s(this.icon),t="string"==typeof this.icon||null===(e=this.icon)||void 0===e?void 0:e.color;if(r)return i("limel-icon",{style:{color:`${t}`},badge:!0,name:r})}renderHeading(){if(this.heading)return i("h1",{class:"title"},this.heading)}renderSubheading(){if(this.subheading)return i("h2",null,this.subheading)}renderSlot(){return i("slot",{name:"component"})}renderValue(){if(this.value)return i("div",{class:{"markdown-wrapper":!0,"can-scroll-up":this.canScrollUp,"can-scroll-down":this.canScrollDown}},i("limel-markdown",{class:"body-text",ref:this.setMarkdownElement,value:this.value}))}renderActionBar(){if(0!==this.actions.length)return i("limel-action-bar",{actions:this.actions,onItemSelected:this.handleActionSelect})}get host(){return o(this)}};d.style='@charset "UTF-8";*{box-sizing:border-box;min-width:0;min-height:0}:host(limel-card){display:flex;border-radius:var(--card-border-radius, 0.95rem)}section{box-sizing:border-box;display:flex;gap:0.5rem;flex-direction:column}:host(limel-card[orientation=landscape]) section{flex-direction:row}section{width:100%;border-radius:var(--card-border-radius, 0.95rem);border:1px solid rgb(var(--contrast-500));padding:0.25rem;background-color:var(--card-background-color, rgb(var(--contrast-300)))}section:hover{border-color:transparent;background-color:var(--card-background-color--hovered, var(--card-background-color, rgb(var(--contrast-200))))}.body{flex-grow:1;display:flex;flex-direction:column;gap:0.5rem}.image-wrapper{flex-shrink:0;display:flex;align-items:center;justify-content:center}:host(limel-card[orientation=portrait]) .image-wrapper{width:100%}:host(limel-card[orientation=landscape]) .image-wrapper{flex-shrink:0;max-width:40%;height:100%}:host(limel-card[orientation=landscape]) .image-wrapper img{height:100%}img{transition:filter 0.6s ease;object-fit:cover;border-radius:calc(var(--card-border-radius, 0.95rem) / 1.4);min-width:0.5rem;min-height:0.5rem;max-width:100%;max-height:100%}section:hover img,section:focus-visible img{transition-duration:0.2s;filter:saturate(1.3)}.markdown-wrapper{position:relative;flex-grow:1;display:flex;flex-direction:column}.markdown-wrapper limel-markdown{overflow-y:auto;flex-grow:1;padding:0.5rem 0.75rem}.markdown-wrapper::before{top:0;background:radial-gradient(farthest-side at 50% 0%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0))}.markdown-wrapper::after{bottom:0;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0))}.markdown-wrapper::before,.markdown-wrapper::after{content:"";pointer-events:none;position:absolute;right:0;left:0;height:0.75rem;opacity:0;transition:opacity 0.6s ease;background-repeat:no-repeat}.markdown-wrapper.can-scroll-up::before,.markdown-wrapper.can-scroll-down::after{opacity:1}header{flex-shrink:0;display:flex;justify-content:center;gap:0.5rem;padding:0.25rem 0.75rem}:host(limel-card[orientation=landscape]) header{padding-top:0.5rem}header:has(limel-icon){padding-left:0.25rem}header .headings{flex-grow:1;display:flex;flex-direction:column;gap:0.125rem}header .title{padding-right:1.25rem}header limel-icon{flex-shrink:0;width:2rem}header h1{font-size:1.125rem;font-weight:500;color:var(--card-heading-color, rgb(var(--contrast-1100)));letter-spacing:-0.03125rem}header h2{font-size:var(--limel-theme-default-font-size);font-weight:400;color:var(--card-subheading-color, rgb(var(--contrast-1000)))}header h1,header h2{word-break:break-word;hyphens:auto;-webkit-hyphens:auto;margin:0}limel-action-bar{flex-shrink:0;--action-bar-background-color:transparent;margin-left:auto}limel-3d-hover-effect-glow{border-radius:var(--card-border-radius, 0.95rem)}:host(limel-card){isolation:isolate;transform-style:preserve-3d;perspective:1000px}@media (prefers-reduced-motion){:host(limel-card){perspective:2000px}}section{position:relative;transition-duration:0.8s;transition-property:transform, box-shadow, background-color;transition-timing-function:ease-out;transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg)}section:focus{outline:none}section:hover,section:focus,section:focus-visible,section:focus-within{will-change:background-color, box-shadow, transform}section:hover,section:focus,section:focus-visible,section:active{transition-duration:0.2s}section:hover,section:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}section:hover{transform:scale3d(1.01, 1.01, 1.01) rotate3d(var(--limel-3d-hover-effect-rotate3d))}section:focus-visible{outline:none;transform:scale3d(1.01, 1.01, 1.01)}section:hover limel-3d-hover-effect-glow{--limel-3d-hover-effect-glow-opacity:0.5}@media (prefers-reduced-motion){section:hover limel-3d-hover-effect-glow{--limel-3d-hover-effect-glow-opacity:0.2}}:host(limel-card[clickable]) section{cursor:pointer;box-shadow:var(--button-shadow-normal)}:host(limel-card[clickable]) section:hover,:host(limel-card[clickable]) section:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}:host(limel-card[clickable]) section:active{transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);box-shadow:var(--button-shadow-pressed)}:host(limel-card[clickable]) section:focus-visible{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-hovered)}:host(limel-card[clickable]) section:focus-visible:active{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-pressed)}:host(limel-card[selected]) section,:host(limel-card[selected]) section:hover,:host(limel-card[selected]) section:focus-visible,:host(limel-card[selected]) section:active{box-shadow:var(--shadow-focused-state)}';export{d as limel_card}
@@ -12,6 +12,7 @@ import { ActionBarItem } from '../action-bar/action-bar.types';
12
12
  * @exampleComponent limel-example-card-image
13
13
  * @exampleComponent limel-example-card-actions
14
14
  * @exampleComponent limel-example-card-clickable
15
+ * @exampleComponent limel-example-card-selected
15
16
  * @exampleComponent limel-example-card-orientation
16
17
  * @exampleComponent limel-example-card-slot
17
18
  * @exampleComponent limel-example-card-styling
@@ -57,6 +58,11 @@ export declare class Card {
57
58
  * specially useful when the card has an image.
58
59
  */
59
60
  orientation: 'landscape' | 'portrait';
61
+ /**
62
+ * When `true`, the card displays a visual selected state (highlighted border shadow).
63
+ * Should be used together with `clickable` to let users toggle selection.
64
+ */
65
+ selected: boolean;
60
66
  /**
61
67
  * Fired when a action bar item has been clicked.
62
68
  */
@@ -82,6 +88,7 @@ export declare class Card {
82
88
  private renderSlot;
83
89
  private renderValue;
84
90
  private handleActionSelect;
91
+ private handleKeyDown;
85
92
  private renderActionBar;
86
93
  }
87
94
  //# sourceMappingURL=card.d.ts.map
@@ -432,6 +432,7 @@ export namespace Components {
432
432
  * @exampleComponent limel-example-card-image
433
433
  * @exampleComponent limel-example-card-actions
434
434
  * @exampleComponent limel-example-card-clickable
435
+ * @exampleComponent limel-example-card-selected
435
436
  * @exampleComponent limel-example-card-orientation
436
437
  * @exampleComponent limel-example-card-slot
437
438
  * @exampleComponent limel-example-card-styling
@@ -465,6 +466,11 @@ export namespace Components {
465
466
  * @default 'portrait'
466
467
  */
467
468
  "orientation": 'landscape' | 'portrait';
469
+ /**
470
+ * When `true`, the card displays a visual selected state (highlighted border shadow). Should be used together with `clickable` to let users toggle selection.
471
+ * @default false
472
+ */
473
+ "selected": boolean;
468
474
  /**
469
475
  * Subheading of the card to provide a short description of the context.
470
476
  */
@@ -4234,6 +4240,7 @@ declare global {
4234
4240
  * @exampleComponent limel-example-card-image
4235
4241
  * @exampleComponent limel-example-card-actions
4236
4242
  * @exampleComponent limel-example-card-clickable
4243
+ * @exampleComponent limel-example-card-selected
4237
4244
  * @exampleComponent limel-example-card-orientation
4238
4245
  * @exampleComponent limel-example-card-slot
4239
4246
  * @exampleComponent limel-example-card-styling
@@ -6617,6 +6624,7 @@ declare namespace LocalJSX {
6617
6624
  * @exampleComponent limel-example-card-image
6618
6625
  * @exampleComponent limel-example-card-actions
6619
6626
  * @exampleComponent limel-example-card-clickable
6627
+ * @exampleComponent limel-example-card-selected
6620
6628
  * @exampleComponent limel-example-card-orientation
6621
6629
  * @exampleComponent limel-example-card-slot
6622
6630
  * @exampleComponent limel-example-card-styling
@@ -6654,6 +6662,11 @@ declare namespace LocalJSX {
6654
6662
  * @default 'portrait'
6655
6663
  */
6656
6664
  "orientation"?: 'landscape' | 'portrait';
6665
+ /**
6666
+ * When `true`, the card displays a visual selected state (highlighted border shadow). Should be used together with `clickable` to let users toggle selection.
6667
+ * @default false
6668
+ */
6669
+ "selected"?: boolean;
6657
6670
  /**
6658
6671
  * Subheading of the card to provide a short description of the context.
6659
6672
  */
@@ -10311,6 +10324,7 @@ declare namespace LocalJSX {
10311
10324
  "value": string;
10312
10325
  "clickable": boolean;
10313
10326
  "orientation": 'landscape' | 'portrait';
10327
+ "selected": boolean;
10314
10328
  }
10315
10329
  interface LimelChartAttributes {
10316
10330
  "language": Languages;
@@ -11077,6 +11091,7 @@ declare module "@stencil/core" {
11077
11091
  * @exampleComponent limel-example-card-image
11078
11092
  * @exampleComponent limel-example-card-actions
11079
11093
  * @exampleComponent limel-example-card-clickable
11094
+ * @exampleComponent limel-example-card-selected
11080
11095
  * @exampleComponent limel-example-card-orientation
11081
11096
  * @exampleComponent limel-example-card-slot
11082
11097
  * @exampleComponent limel-example-card-styling
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "39.4.0",
3
+ "version": "39.5.0",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -1 +0,0 @@
1
- import{r as e,c as r,h as i,H as t,a as o}from"./p-DBTJNfo7.js";import{i as a}from"./p-CrvUOVvg.js";import{g as s}from"./p-CgNJbSP4.js";import{g as n}from"./p-5eP2N9QI.js";const d=class{constructor(i){e(this,i),this.actionSelected=r(this,"actionSelected"),this.actions=[],this.clickable=!1,this.orientation="portrait",this.canScrollUp=!1,this.canScrollDown=!1,this.setMarkdownElement=e=>{var r;e!==this.markdownElement&&(this.markdownElement&&(null===(r=this.markdownResizeObserver)||void 0===r||r.disconnect(),this.markdownElement.removeEventListener("scroll",this.checkIfScrollable)),this.markdownElement=e,this.markdownElement&&(this.markdownResizeObserver=new ResizeObserver(this.checkIfScrollable),this.markdownResizeObserver.observe(this.markdownElement),this.markdownElement.addEventListener("scroll",this.checkIfScrollable,{passive:!0}),this.checkIfScrollable()))},this.checkIfScrollable=()=>{if(!this.markdownElement)return;const e=this.markdownElement.scrollHeight,r=this.markdownElement.clientHeight,i=this.markdownElement.scrollTop,t=e>r,o=t&&!(i+r>=e-2),a=t&&!(i<=1);this.canScrollDown!==o&&(this.canScrollDown=o),this.canScrollUp!==a&&(this.canScrollUp=a)},this.handleActionSelect=e=>{e.stopPropagation(),a(e.detail)&&this.actionSelected.emit(e.detail)}}componentWillLoad(){const{handleMouseEnter:e,handleMouseLeave:r}=n(this.host);this.handleMouseEnter=e,this.handleMouseLeave=r}disconnectedCallback(){var e,r;null===(e=this.markdownResizeObserver)||void 0===e||e.disconnect(),null===(r=this.markdownElement)||void 0===r||r.removeEventListener("scroll",this.checkIfScrollable)}componentDidLoad(){this.setMarkdownElement(this.markdownElement)}render(){return i(t,{key:"a5b8b7c2bead5c54c7970b6d382704922c066e73",onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},i("section",{key:"cb7c4392b7d92bc47ee533c24a1ca92818aa7076",tabindex:this.clickable?0:""},this.renderImage(),i("div",{key:"484d033da40562d5a460d629ba7cfa6116d9461d",class:"body"},this.renderHeader(),this.renderSlot(),this.renderValue(),this.renderActionBar()),i("limel-3d-hover-effect-glow",{key:"e86f33835e34306ec046d7c5fcf7fdb0f667fa86"})))}renderImage(){var e;if(null===(e=this.image)||void 0===e?void 0:e.src)return i("div",{class:"image-wrapper"},i("img",{src:this.image.src,alt:this.image.alt,loading:"lazy"}))}renderHeader(){if(this.heading||this.subheading||this.icon)return i("header",null,this.renderIcon(),i("div",{class:"headings"},this.renderHeading(),this.renderSubheading()))}renderIcon(){var e;const r=s(this.icon),t="string"==typeof this.icon||null===(e=this.icon)||void 0===e?void 0:e.color;if(r)return i("limel-icon",{style:{color:`${t}`},badge:!0,name:r})}renderHeading(){if(this.heading)return i("h1",{class:"title"},this.heading)}renderSubheading(){if(this.subheading)return i("h2",null,this.subheading)}renderSlot(){return i("slot",{name:"component"})}renderValue(){if(this.value)return i("div",{class:{"markdown-wrapper":!0,"can-scroll-up":this.canScrollUp,"can-scroll-down":this.canScrollDown}},i("limel-markdown",{class:"body-text",ref:this.setMarkdownElement,value:this.value}))}renderActionBar(){if(0!==this.actions.length)return i("limel-action-bar",{actions:this.actions,onItemSelected:this.handleActionSelect})}get host(){return o(this)}};d.style='@charset "UTF-8";*{box-sizing:border-box;min-width:0;min-height:0}:host(limel-card){display:flex;border-radius:var(--card-border-radius, 0.95rem)}section{box-sizing:border-box;display:flex;gap:0.5rem;flex-direction:column}:host(limel-card[orientation=landscape]) section{flex-direction:row}section{width:100%;border-radius:var(--card-border-radius, 0.95rem);border:1px solid rgb(var(--contrast-500));padding:0.25rem;background-color:var(--card-background-color, rgb(var(--contrast-300)))}section:hover{border-color:transparent;background-color:var(--card-background-color--hovered, var(--card-background-color, rgb(var(--contrast-200))))}.body{flex-grow:1;display:flex;flex-direction:column;gap:0.5rem}.image-wrapper{flex-shrink:0;display:flex;align-items:center;justify-content:center}:host(limel-card[orientation=portrait]) .image-wrapper{width:100%}:host(limel-card[orientation=landscape]) .image-wrapper{flex-shrink:0;max-width:40%;height:100%}:host(limel-card[orientation=landscape]) .image-wrapper img{height:100%}img{transition:filter 0.6s ease;object-fit:cover;border-radius:calc(var(--card-border-radius, 0.95rem) / 1.4);min-width:0.5rem;min-height:0.5rem;max-width:100%;max-height:100%}section:hover img,section:focus-visible img{transition-duration:0.2s;filter:saturate(1.3)}.markdown-wrapper{position:relative;flex-grow:1;display:flex;flex-direction:column}.markdown-wrapper limel-markdown{overflow-y:auto;flex-grow:1;padding:0.5rem 0.75rem}.markdown-wrapper::before{top:0;background:radial-gradient(farthest-side at 50% 0%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0))}.markdown-wrapper::after{bottom:0;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0))}.markdown-wrapper::before,.markdown-wrapper::after{content:"";pointer-events:none;position:absolute;right:0;left:0;height:0.75rem;opacity:0;transition:opacity 0.6s ease;background-repeat:no-repeat}.markdown-wrapper.can-scroll-up::before,.markdown-wrapper.can-scroll-down::after{opacity:1}header{flex-shrink:0;display:flex;justify-content:center;gap:0.5rem;padding:0.25rem 0.75rem}:host(limel-card[orientation=landscape]) header{padding-top:0.5rem}header:has(limel-icon){padding-left:0.25rem}header .headings{flex-grow:1;display:flex;flex-direction:column;gap:0.125rem}header .title{padding-right:1.25rem}header limel-icon{flex-shrink:0;width:2rem}header h1{font-size:1.125rem;font-weight:500;color:var(--card-heading-color, rgb(var(--contrast-1100)));letter-spacing:-0.03125rem}header h2{font-size:var(--limel-theme-default-font-size);font-weight:400;color:var(--card-subheading-color, rgb(var(--contrast-1000)))}header h1,header h2{word-break:break-word;hyphens:auto;-webkit-hyphens:auto;margin:0}limel-action-bar{flex-shrink:0;--action-bar-background-color:transparent;margin-left:auto}limel-3d-hover-effect-glow{border-radius:var(--card-border-radius, 0.95rem)}:host(limel-card){isolation:isolate;transform-style:preserve-3d;perspective:1000px}@media (prefers-reduced-motion){:host(limel-card){perspective:2000px}}section{position:relative;transition-duration:0.8s;transition-property:transform, box-shadow, background-color;transition-timing-function:ease-out;transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg)}section:focus{outline:none}section:hover,section:focus,section:focus-visible,section:focus-within{will-change:background-color, box-shadow, transform}section:hover,section:focus,section:focus-visible,section:active{transition-duration:0.2s}section:hover,section:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}section:hover{transform:scale3d(1.01, 1.01, 1.01) rotate3d(var(--limel-3d-hover-effect-rotate3d))}section:focus-visible{outline:none;transform:scale3d(1.01, 1.01, 1.01)}section:hover limel-3d-hover-effect-glow{--limel-3d-hover-effect-glow-opacity:0.5}@media (prefers-reduced-motion){section:hover limel-3d-hover-effect-glow{--limel-3d-hover-effect-glow-opacity:0.2}}:host(limel-card[clickable]) section{cursor:pointer;box-shadow:var(--button-shadow-normal)}:host(limel-card[clickable]) section:hover,:host(limel-card[clickable]) section:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}:host(limel-card[clickable]) section:active{transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);box-shadow:var(--button-shadow-pressed)}:host(limel-card[clickable]) section:focus-visible{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-hovered)}:host(limel-card[clickable]) section:focus-visible:active{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-pressed)}';export{d as limel_card}