@descope/web-components-ui 1.110.0 → 1.111.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.
Files changed (69) hide show
  1. package/dist/cjs/index.cjs.js +2029 -1782
  2. package/dist/cjs/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +2341 -2093
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/umd/1995.js +7 -22
  6. package/dist/umd/1995.js.LICENSE.txt +0 -6
  7. package/dist/umd/1995.js.map +1 -1
  8. package/dist/umd/8961.js +1 -1
  9. package/dist/umd/8961.js.map +1 -1
  10. package/dist/umd/DescopeDev.js +1 -1
  11. package/dist/umd/DescopeDev.js.map +1 -1
  12. package/dist/umd/descope-alert-index-js.js +1 -1
  13. package/dist/umd/descope-alert-index-js.js.map +1 -1
  14. package/dist/umd/descope-apps-list.js +18 -0
  15. package/dist/umd/descope-apps-list.js.LICENSE.txt +23 -0
  16. package/dist/umd/descope-apps-list.js.map +1 -0
  17. package/dist/umd/descope-avatar.js +17 -1
  18. package/dist/umd/descope-avatar.js.LICENSE.txt +23 -0
  19. package/dist/umd/descope-avatar.js.map +1 -1
  20. package/dist/umd/descope-collapsible-container.js +1 -1
  21. package/dist/umd/descope-collapsible-container.js.map +1 -1
  22. package/dist/umd/descope-divider-index-js.js +1 -1
  23. package/dist/umd/descope-divider-index-js.js.map +1 -1
  24. package/dist/umd/descope-enriched-text.js +1 -1
  25. package/dist/umd/descope-enriched-text.js.map +1 -1
  26. package/dist/umd/descope-link.js +1 -1
  27. package/dist/umd/descope-link.js.map +1 -1
  28. package/dist/umd/descope-list-item.js +2 -0
  29. package/dist/umd/descope-list-item.js.map +1 -0
  30. package/dist/umd/descope-list.js +2 -0
  31. package/dist/umd/descope-list.js.map +1 -0
  32. package/dist/umd/descope-outbound-apps.js +339 -0
  33. package/dist/umd/descope-outbound-apps.js.LICENSE.txt +5 -0
  34. package/dist/umd/descope-outbound-apps.js.map +1 -0
  35. package/dist/umd/descope-recovery-codes.js +1 -1
  36. package/dist/umd/descope-recovery-codes.js.map +1 -1
  37. package/dist/umd/descope-scopes-list-index-js.js +1 -1
  38. package/dist/umd/descope-scopes-list-index-js.js.map +1 -1
  39. package/dist/umd/descope-security-questions-verify-index-js.js +1 -1
  40. package/dist/umd/descope-security-questions-verify-index-js.js.map +1 -1
  41. package/dist/umd/descope-text.js +1 -1
  42. package/dist/umd/descope-text.js.map +1 -1
  43. package/dist/umd/descope-user-attribute-index-js.js +1 -1
  44. package/dist/umd/descope-user-attribute-index-js.js.map +1 -1
  45. package/dist/umd/descope-user-auth-method-index-js.js +1 -1
  46. package/dist/umd/descope-user-auth-method-index-js.js.map +1 -1
  47. package/dist/umd/index.js +1 -1
  48. package/dist/umd/index.js.map +1 -1
  49. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
  50. package/dist/umd/mapping-fields-descope-mappings-field-index-js.js.map +1 -1
  51. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
  52. package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js.map +1 -1
  53. package/package.json +21 -17
  54. package/src/components/descope-scopes-list/index.js +2 -1
  55. package/src/index.cjs.js +0 -3
  56. package/src/index.js +0 -2
  57. package/src/theme/components/index.js +5 -3
  58. package/dist/umd/descope-apps-list-index-js.js +0 -2
  59. package/dist/umd/descope-apps-list-index-js.js.map +0 -1
  60. package/dist/umd/descope-list-index-js.js +0 -2
  61. package/dist/umd/descope-list-index-js.js.map +0 -1
  62. package/src/components/descope-apps-list/AppsListClass.js +0 -97
  63. package/src/components/descope-apps-list/index.js +0 -8
  64. package/src/components/descope-list/ListClass.js +0 -156
  65. package/src/components/descope-list/ListItemClass.js +0 -58
  66. package/src/components/descope-list/index.js +0 -7
  67. package/src/theme/components/appsList.js +0 -36
  68. package/src/theme/components/list/list.js +0 -56
  69. package/src/theme/components/list/listItem.js +0 -41
@@ -1,2 +1,2 @@
1
- (self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1202,2294,6367,6724],{8512:(t,e,n)=>{"use strict";n.d(e,{T:()=>l,q:()=>d});var s=n(88961),r=n(72270),i=n(63200),o=n(25964),a=n(18782);const l=(0,o.xE)("image"),c=["src","src-dark"];class p extends((0,r.qu)({componentName:l,baseSelector:"slot"})){static get observedAttributes(){return c}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,o.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n ",this)}init(){super.init?.(),this.toggleVisibility(this.src)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get src(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach((t=>{t.setAttribute("fill",`var(${d.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)}))}renderImage(){this.toggleVisibility(this.src),(0,a.m)(this.src,this.altText).then((t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))}))}shouldRender(t){const e=this.getAttribute(t);return this.src===e}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&this.shouldRender(t)&&this.renderImage()}}const d=(0,i.Zz)((0,s.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),s.VO,s.tQ)(p)},18782:(t,e,n)=>{"use strict";n.d(e,{m:()=>i});var s=n(25414);const r=t=>{const e=s.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},i=async(t,e)=>{try{let n;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));n=r(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),s=await e.text();n=r(s)}else n=((t,e)=>{const n=document.createElement("img");return n.setAttribute("src",t),n.setAttribute("alt",e),n})(t,e);return n.style.setProperty("max-width","100%"),n.style.setProperty("max-height","100%"),n}catch{return null}}},53455:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ImageClass:()=>s.q,componentName:()=>s.T});var s=n(8512);customElements.define(s.T,s.q)},56737:(t,e,n)=>{"use strict";n.r(e),n.d(e,{IconClass:()=>s.S,componentName:()=>s.T}),n(53455);var s=n(98538);customElements.define(s.T,s.S)},63595:(t,e,n)=>{"use strict";n.r(e),n.d(e,{TextClass:()=>s.s,componentName:()=>s.T});var s=n(66434);customElements.define(s.T,s.s)},66434:(t,e,n)=>{"use strict";n.d(e,{T:()=>a,s:()=>p});var s=n(88961),r=n(63200),i=n(25964),o=n(72270);const a=(0,i.xE)("text");class l extends((0,o.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,i.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,i.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:c}={host:{selector:()=>":host"}},p=(0,r.Zz)((0,s.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),s.VO,s.tQ)(l)},96945:(t,e,n)=>{"use strict";n.r(e),n.d(e,{CollapsibleContainerClass:()=>u,componentName:()=>p}),n(63595),n(56737);var s=n(88961),r=n(72270),i=n(63200),o=n(25964),a=n(97376),l=n.n(a),c=n(66434);const p=(0,o.xE)("collapsible-container");class d extends((0,r.qu)({componentName:p,baseSelector:"slot"})){static get observedAttributes(){return["collapsed","collapsible","text"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div class="wrapper">\n <descope-text st-host-direction="ltr">\n <div class="header">\n <div class="icon">\n <descope-icon st-fill="currentcolor" src=${l()}></descope-icon>\n </div>\n <span></span>\n </div>\n </descope-text>\n <div class="content">\n <slot></slot>\n </div>\n </div>\n\t`,(0,o.fz)(`\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${c.s.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n .rotate {\n transform: rotate(-180deg);\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,this),this.header=this.shadowRoot.querySelector(".header"),this.content=this.shadowRoot.querySelector("div.content"),this.icon=this.header.querySelector("descope-icon"),this.headerText=this.header.querySelector("span"),this.textComponent=this.shadowRoot.querySelector("descope-text")}get isCollapsible(){return"true"===this.getAttribute("collapsible")}calcContentHeight(){return this.content.offsetHeight||this.content.scrollHeight}get isCollapsed(){return"true"===this.getAttribute("collapsed")}toggle(){this.setAttribute("collapsed",this.isCollapsed?"false":"true")}collapse(t=!1){const e=()=>{this.content.style.maxHeight="0px"};if(this.icon.classList.add("rotate"),!t)return e();this.content.style.maxHeight=this.calcContentHeight()+"px",setTimeout(e)}expand(t=!1){const e=()=>{this.content.style.maxHeight=""};if(this.icon.classList.remove("rotate"),!t)return e();this.content.addEventListener("transitionend",e,{once:!0}),this.content.style.maxHeight=this.calcContentHeight()+"px"}#t=!1;init(){super.init?.(),this.#t=!0,this.header.addEventListener("click",(()=>{this.isCollapsible&&this.toggle()})),(0,o.EA)(this,this.textComponent,{includeAttrs:["text-align","text-variant","text-mode"],mapAttrs:{"text-mode":"mode","text-variant":"variant"}})}updateHeaderText(){const t=this.getAttribute("text")||"";this.headerText.innerText=t}attributeChangedCallback(t,e,n){"text"!==t?this.isCollapsed&&this.isCollapsible?this.collapse(this.#t):this.expand(this.#t):this.updateHeaderText()}}const h={host:()=>":host",icon:()=>"descope-icon",iconWrapper:()=>".icon",header:()=>".header",text:()=>"span",wrapper:()=>".wrapper",content:()=>"div.content"},u=(0,i.Zz)((0,s.RF)({mappings:{hostWidth:{selector:h.host,property:"width"},hostDirection:{selector:h.host,property:"direction"},verticalPadding:[{selector:h.wrapper,property:"padding-top"},{selector:h.wrapper,property:"padding-bottom"}],horizontalPadding:[{selector:h.wrapper,property:"padding-left"},{selector:h.wrapper,property:"padding-right"}],flexDirection:{},justifyContent:{},alignItems:{},gap:[{},{property:"margin-top"}],backgroundColor:{selector:h.wrapper},backgroundImage:{selector:h.wrapper},backgroundPositionX:{selector:h.wrapper},backgroundPositionY:{selector:h.wrapper},backgroundSize:{selector:h.wrapper},backgroundRepeat:{selector:h.wrapper},borderRadius:{selector:h.wrapper},borderColor:{selector:h.wrapper},borderStyle:{selector:h.wrapper},borderWidth:{selector:h.wrapper},boxShadow:{selector:h.wrapper},headerIconOrder:{selector:h.iconWrapper,property:"order"},headerCursor:{selector:h.header,property:"cursor"},headerGap:{selector:h.header,property:"gap"},textGrow:{selector:h.text,property:"flex-grow"},textDirection:{selector:h.text,property:"direction"},iconAnimationDuration:{selector:h.icon,property:"transition-duration"},contentAnimationDuration:{selector:h.content,property:"transition-duration"}}}),s.VO,s.tQ)(d);customElements.define(p,u)},97376:t=>{t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik0xNy4yMTkzIDkuMjcyODNDMTcuNjU4NCA4Ljg3OTEyIDE4LjMzMzQgOC45MTU4NyAxOC43MjcyIDkuMzU0OTJDMTkuMTIwOSA5Ljc5Mzk3IDE5LjA4NDEgMTAuNDY5MSAxOC42NDUxIDEwLjg2MjhDMTguNjQ1MSAxMC44NjI4IDEzLjA0NTcgMTYuMDAyMiAxMi42NCAxNi4zNjZDMTIuMjM0MyAxNi43Mjk4IDExLjc2MDggMTYuNzI5OCAxMS4zNTUyIDE2LjM2Nkw1LjM1NDkyIDEwLjg2MjhDNC45MTU4NyAxMC40NjkxIDQuODc5MTIgOS43OTM5NyA1LjI3MjgzIDkuMzU0OTJDNS42NjY1NSA4LjkxNTg3IDYuMzQxNjQgOC44NzkxMiA2Ljc4MDY5IDkuMjcyODNMMTIgMTQuMTM2OEwxNy4yMTkzIDkuMjcyODNaIi8+IDwvc3ZnPiA="},98538:(t,e,n)=>{"use strict";n.d(e,{S:()=>l,T:()=>a});var s=n(88961),r=n(25964),i=n(8512),o=n(63200);const a=(0,r.xE)("icon"),l=(0,o.Zz)((0,s.RF)({mappings:{fill:[{},{property:i.q.cssVarList.fill}]}}),s.VO,s.tQ)((0,s.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n }\n ",excludeAttrsSync:["tabindex","class"],componentName:a}))}}]);
1
+ (self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1202,2294,6367,6724],{8512:(t,e,n)=>{"use strict";n.d(e,{T:()=>l,q:()=>d});var s=n(88961),r=n(72270),i=n(63200),o=n(25964),a=n(18782);const l=(0,o.xE)("image"),c=["src","src-dark"];class p extends((0,r.qu)({componentName:l,baseSelector:"slot"})){static get observedAttributes(){return c}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<slot></slot>\n\t",(0,o.fz)("\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n ",this)}init(){super.init?.(),this.toggleVisibility(this.src)}onThemeChange(){this.renderImage()}toggleVisibility(t){t?this.classList.remove("hidden"):this.classList.add("hidden")}get altText(){return this.getAttribute("alt")||""}get legacySrc(){return this.getAttribute("src")}get themeSrc(){return this.getAttribute(`src-${this.currentThemeName}`)}get src(){return this.themeSrc||this.legacySrc}updateFillColor(t){[t,...t.querySelectorAll("*[fill]")].forEach((t=>{t.setAttribute("fill",`var(${d.cssVarList.fill}, ${t.getAttribute("fill")||"''"})`)}))}renderImage(){this.toggleVisibility(this.src),(0,a.m)(this.src,this.altText).then((t=>{this.innerHTML="",t&&(this.updateFillColor(t),this.appendChild(t))}))}shouldRender(t){const e=this.getAttribute(t);return this.src===e}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),e!==n&&this.shouldRender(t)&&this.renderImage()}}const d=(0,i.Zz)((0,s.RF)({mappings:{fill:{},height:{selector:()=>":host"},width:{selector:()=>":host"}}}),s.VO,s.tQ)(p)},18782:(t,e,n)=>{"use strict";n.d(e,{m:()=>i});var s=n(25414);const r=t=>{const e=s.A.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},ADD_TAGS:["image"],FORBID_TAGS:["defs"]});return(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("svg")},i=async(t,e)=>{try{let n;if((t=>t.startsWith("data:image/svg+xml;base64,"))(t)){const e=atob(t.slice(26));n=r(e)}else if("svg"===(t=>{const e=t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i);return e?e[1]:null})(t)){const e=await fetch(t),s=await e.text();n=r(s)}else n=((t,e)=>{const n=document.createElement("img");return n.setAttribute("src",t),n.setAttribute("alt",e),n})(t,e);return n.style.setProperty("max-width","100%"),n.style.setProperty("max-height","100%"),n}catch{return null}}},53455:(t,e,n)=>{"use strict";n.r(e),n.d(e,{ImageClass:()=>s.q,componentName:()=>s.T});var s=n(8512);customElements.define(s.T,s.q)},56737:(t,e,n)=>{"use strict";n.r(e),n.d(e,{IconClass:()=>s.S,componentName:()=>s.T}),n(53455);var s=n(98538);customElements.define(s.T,s.S)},63595:(t,e,n)=>{"use strict";n.r(e),n.d(e,{TextClass:()=>s.s,componentName:()=>s.T});var s=n(66434);customElements.define(s.T,s.s)},66434:(t,e,n)=>{"use strict";n.d(e,{T:()=>a,s:()=>p});var s=n(88961),r=n(63200),i=n(25964),o=n(72270);const a=(0,i.xE)("text");class l extends((0,o.qu)({componentName:a,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,i.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,i.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:c}={host:{selector:()=>":host"}},p=(0,r.Zz)((0,s.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),s.VO,s.tQ)(l)},96945:(t,e,n)=>{"use strict";n.r(e),n.d(e,{CollapsibleContainerClass:()=>u,componentName:()=>p}),n(63595),n(56737);var s=n(88961),r=n(72270),i=n(63200),o=n(25964),a=n(97376),l=n.n(a),c=n(66434);const p=(0,o.xE)("collapsible-container");class d extends((0,r.qu)({componentName:p,baseSelector:"slot"})){static get observedAttributes(){return["collapsed","collapsible","text"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML=`\n <div class="wrapper">\n <descope-text st-host-direction="ltr">\n <div class="header">\n <div class="icon">\n <descope-icon st-fill="currentcolor" src=${l()}></descope-icon>\n </div>\n <span></span>\n </div>\n </descope-text>\n <div class="content">\n <slot></slot>\n </div>\n </div>\n\t`,(0,o.fz)(`\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${c.s.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n .rotate {\n transform: rotate(-180deg);\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,this),this.header=this.shadowRoot.querySelector(".header"),this.content=this.shadowRoot.querySelector("div.content"),this.icon=this.header.querySelector("descope-icon"),this.headerText=this.header.querySelector("span"),this.textComponent=this.shadowRoot.querySelector("descope-text")}get isCollapsible(){return"true"===this.getAttribute("collapsible")}calcContentHeight(){return this.content.offsetHeight||this.content.scrollHeight}get isCollapsed(){return"true"===this.getAttribute("collapsed")}toggle(){this.setAttribute("collapsed",this.isCollapsed?"false":"true")}collapse(t=!1){const e=()=>{this.content.style.maxHeight="0px"};if(this.icon.classList.add("rotate"),!t)return e();this.content.style.maxHeight=this.calcContentHeight()+"px",setTimeout(e)}expand(t=!1){const e=()=>{this.content.style.maxHeight=""};if(this.icon.classList.remove("rotate"),!t)return e();this.content.addEventListener("transitionend",e,{once:!0}),this.content.style.maxHeight=this.calcContentHeight()+"px"}#t=!1;init(){super.init?.(),this.#t=!0,this.header.addEventListener("click",(()=>{this.isCollapsible&&this.toggle()})),(0,o.EA)(this,this.textComponent,{includeAttrs:["text-align","text-variant","text-mode"],mapAttrs:{"text-mode":"mode","text-variant":"variant"}})}updateHeaderText(){const t=this.getAttribute("text")||"";this.headerText.innerText=t}attributeChangedCallback(t,e,n){"text"!==t?this.isCollapsed&&this.isCollapsible?this.collapse(this.#t):this.expand(this.#t):this.updateHeaderText()}}const h={host:()=>":host",icon:()=>"descope-icon",iconWrapper:()=>".icon",header:()=>".header",text:()=>"span",wrapper:()=>".wrapper",content:()=>"div.content"},u=(0,i.Zz)((0,s.RF)({mappings:{hostWidth:{selector:h.host,property:"width"},hostDirection:{selector:h.host,property:"direction"},verticalPadding:[{selector:h.wrapper,property:"padding-top"},{selector:h.wrapper,property:"padding-bottom"}],horizontalPadding:[{selector:h.wrapper,property:"padding-left"},{selector:h.wrapper,property:"padding-right"}],flexDirection:{},justifyContent:{},alignItems:{},gap:[{},{property:"margin-top"}],backgroundColor:{selector:h.wrapper},backgroundImage:{selector:h.wrapper},backgroundPositionX:{selector:h.wrapper},backgroundPositionY:{selector:h.wrapper},backgroundSize:{selector:h.wrapper},backgroundRepeat:{selector:h.wrapper},borderRadius:{selector:h.wrapper},borderColor:{selector:h.wrapper},borderStyle:{selector:h.wrapper},borderWidth:{selector:h.wrapper},boxShadow:{selector:h.wrapper},headerIconOrder:{selector:h.iconWrapper,property:"order"},headerCursor:{selector:h.header,property:"cursor"},headerGap:{selector:h.header,property:"gap"},textGrow:{selector:h.text,property:"flex-grow"},textDirection:{selector:h.text,property:"direction"},iconAnimationDuration:{selector:h.icon,property:"transition-duration"},contentAnimationDuration:{selector:h.content,property:"transition-duration"}}}),s.VO,s.tQ)(d);customElements.define(p,u)},97376:t=>{t.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik0xNy4yMTkzIDkuMjcyODNDMTcuNjU4NCA4Ljg3OTEyIDE4LjMzMzQgOC45MTU4NyAxOC43MjcyIDkuMzU0OTJDMTkuMTIwOSA5Ljc5Mzk3IDE5LjA4NDEgMTAuNDY5MSAxOC42NDUxIDEwLjg2MjhDMTguNjQ1MSAxMC44NjI4IDEzLjA0NTcgMTYuMDAyMiAxMi42NCAxNi4zNjZDMTIuMjM0MyAxNi43Mjk4IDExLjc2MDggMTYuNzI5OCAxMS4zNTUyIDE2LjM2Nkw1LjM1NDkyIDEwLjg2MjhDNC45MTU4NyAxMC40NjkxIDQuODc5MTIgOS43OTM5NyA1LjI3MjgzIDkuMzU0OTJDNS42NjY1NSA4LjkxNTg3IDYuMzQxNjQgOC44NzkxMiA2Ljc4MDY5IDkuMjcyODNMMTIgMTQuMTM2OEwxNy4yMTkzIDkuMjcyODNaIi8+IDwvc3ZnPiA="},98538:(t,e,n)=>{"use strict";n.d(e,{S:()=>l,T:()=>a});var s=n(88961),r=n(25964),i=n(8512),o=n(63200);const a=(0,r.xE)("icon"),l=(0,o.Zz)((0,s.RF)({mappings:{fill:[{},{property:i.q.cssVarList.fill}]}}),s.VO,s.tQ)((0,s.tz)({slots:[],wrappedEleName:"descope-image",style:()=>"\n :host {\n display: inline-flex;\n }\n ",excludeAttrsSync:["tabindex","class"],componentName:a}))}}]);
2
2
  //# sourceMappingURL=descope-collapsible-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-collapsible-container.js","mappings":"2OAYO,MAAMA,GAAgB,QAAiB,SAExCC,EAAW,CAAC,MAAO,YAEzB,MAAMC,WAAiB,QAAgB,CACrCF,gBACAG,aAAc,UAEd,6BAAWC,GACT,OAAOH,CACT,CAEA,WAAAI,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,2BAIhD,QACE,6UAoBAH,KAEJ,CAEA,IAAAI,GACEL,MAAMK,SACNJ,KAAKK,iBAAiBL,KAAKM,IAC7B,CAEA,aAAAC,GACEP,KAAKQ,aACP,CAEA,gBAAAH,CAAiBI,GACXA,EACFT,KAAKU,UAAUC,OAAO,UAEtBX,KAAKU,UAAUE,IAAI,SAEvB,CAEA,WAAIC,GACF,OAAOb,KAAKc,aAAa,QAAU,EACrC,CAEA,aAAIC,GACF,OAAOf,KAAKc,aAAa,MAC3B,CAEA,YAAIE,GACF,OAAOhB,KAAKc,aAAa,OAAOd,KAAKiB,mBACvC,CAEA,OAAIX,GACF,OAAON,KAAKgB,UAAYhB,KAAKe,SAC/B,CAKA,eAAAG,CAAgBC,GAEY,CAACA,KAASA,EAAKC,iBAAiB,YAExCC,SAASC,IACzBA,EAAIC,aACF,OACA,OAAOC,EAAWC,WAAWC,SAASJ,EAAIR,aAAa,SAAW,QACnE,GAEL,CAEA,WAAAN,GACER,KAAKK,iBAAiBL,KAAKM,MAE3B,OAAYN,KAAKM,IAAKN,KAAKa,SAASc,MAAMC,IACxC5B,KAAKG,UAAY,GACbyB,IACF5B,KAAKkB,gBAAgBU,GACrB5B,KAAK6B,YAAYD,GACnB,GAEJ,C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B,CAAElG,SAAUoF,EAAUE,SACtCa,iBAAkB,CAAEnG,SAAUoF,EAAUE,SAExCc,aAAc,CAAEpG,SAAUoF,EAAUE,SACpC7B,YAAa,CAAEzD,SAAUoF,EAAUE,SACnC9B,YAAa,CAAExD,SAAUoF,EAAUE,SACnC/B,YAAa,CAAEvD,SAAUoF,EAAUE,SAEnCe,UAAW,CAAErG,SAAUoF,EAAUE,SAEjCgB,gBAAiB,CAAEtG,SAAUoF,EAAUC,YAAa1C,SAAU,SAC9D4D,aAAc,CAAEvG,SAAUoF,EAAUzB,OAAQhB,SAAU,UACtD6D,UAAW,CAAExG,SAAUoF,EAAUzB,OAAQhB,SAAU,OACnD8D,SAAU,CAAEzG,SAAUoF,EAAUjF,KAAMwC,SAAU,aAChD+D,cAAe,CAAE1G,SAAUoF,EAAUjF,KAAMwC,SAAU,aACrDgE,sBAAuB,CACrB3G,SAAUoF,EAAUtB,KACpBnB,SAAU,uBAEZiE,yBAA0B,CACxB5G,SAAUoF,EAAUvB,QACpBlB,SAAU,0BAIhB,KACA,KAjDuC,CAkDvCe,GC/OF1B,eAAeC,OAAO9E,EAAeoI,E,YCJrCsB,EAAOC,QAAU,ooB,uGCUV,MAAM3J,GAAgB,QAAiB,QAEjC4J,GAAY,SACvB,QAAiB,CACfjH,SAAU,CACRV,KAAM,CAAC,CAAC,EAAG,CAAEuD,SAAU,IAAWxD,WAAWC,UAGjD,KACA,KAPuB,EASvB,QAAY,CACV4H,MAAO,GACPC,eAAgB,gBAChBnF,MAAO,IAAM,kEAKboF,iBAAkB,CAAC,WAAY,SAC/B/J,kB","sources":["webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/CollapsibleContainerClass.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/chevron.svg","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.src);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get src() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n // eslint-disable-next-line class-methods-use-this\n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.src);\n\n createImage(this.src, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.src === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport chevronIcon from './chevron.svg';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('collapsible-container');\n\nclass RawCollapsibleContainer extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return ['collapsed', 'collapsible', 'text'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <descope-text st-host-direction=\"ltr\">\n <div class=\"header\">\n <div class=\"icon\">\n <descope-icon st-fill=\"currentcolor\" src=${chevronIcon}></descope-icon>\n </div>\n <span></span>\n </div>\n </descope-text>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n\t`;\n\n injectStyle(\n `\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${TextClass.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n .rotate {\n transform: rotate(-180deg);\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,\n this,\n );\n\n this.header = this.shadowRoot.querySelector('.header');\n this.content = this.shadowRoot.querySelector('div.content');\n this.icon = this.header.querySelector('descope-icon');\n this.headerText = this.header.querySelector('span');\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n }\n\n get isCollapsible() {\n return this.getAttribute('collapsible') === 'true';\n }\n\n calcContentHeight() {\n return this.content.offsetHeight || this.content.scrollHeight;\n }\n\n get isCollapsed() {\n return this.getAttribute('collapsed') === 'true';\n }\n\n toggle() {\n this.setAttribute('collapsed', this.isCollapsed ? 'false' : 'true');\n }\n\n collapse(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '0px';\n };\n this.icon.classList.add('rotate');\n if (!animated) return final();\n\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n setTimeout(final);\n }\n\n expand(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '';\n };\n this.icon.classList.remove('rotate');\n if (!animated) return final();\n\n this.content.addEventListener('transitionend', final, { once: true });\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n }\n\n #isComponentMounted = false;\n\n init() {\n super.init?.();\n // we want to animate the collapse/expand only after the first time the component is connected\n // so when setting a default value for the collapsed attribute, it will not animate\n this.#isComponentMounted = true;\n\n this.header.addEventListener('click', () => {\n if (!this.isCollapsible) return;\n this.toggle();\n });\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['text-align', 'text-variant', 'text-mode'],\n mapAttrs: { 'text-mode': 'mode', 'text-variant': 'variant' },\n });\n }\n\n updateHeaderText() {\n const text = this.getAttribute('text') || '';\n this.headerText.innerText = text;\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'text') {\n this.updateHeaderText();\n return;\n }\n const collapsed = this.isCollapsed && this.isCollapsible;\n if (collapsed) {\n this.collapse(this.#isComponentMounted);\n } else {\n this.expand(this.#isComponentMounted);\n }\n }\n}\n\nconst selectors = {\n host: () => ':host',\n icon: () => 'descope-icon',\n iconWrapper: () => '.icon',\n header: () => '.header',\n text: () => 'span',\n wrapper: () => '.wrapper',\n content: () => 'div.content',\n};\n\nexport const CollapsibleContainerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: selectors.host, property: 'width' },\n hostDirection: { selector: selectors.host, property: 'direction' },\n verticalPadding: [\n { selector: selectors.wrapper, property: 'padding-top' },\n { selector: selectors.wrapper, property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { selector: selectors.wrapper, property: 'padding-left' },\n { selector: selectors.wrapper, property: 'padding-right' },\n ],\n\n flexDirection: {},\n justifyContent: {},\n alignItems: {},\n gap: [{}, { property: 'margin-top' }],\n\n backgroundColor: { selector: selectors.wrapper },\n backgroundImage: { selector: selectors.wrapper },\n backgroundPositionX: { selector: selectors.wrapper },\n backgroundPositionY: { selector: selectors.wrapper },\n backgroundSize: { selector: selectors.wrapper },\n backgroundRepeat: { selector: selectors.wrapper },\n\n borderRadius: { selector: selectors.wrapper },\n borderColor: { selector: selectors.wrapper },\n borderStyle: { selector: selectors.wrapper },\n borderWidth: { selector: selectors.wrapper },\n\n boxShadow: { selector: selectors.wrapper },\n\n headerIconOrder: { selector: selectors.iconWrapper, property: 'order' },\n headerCursor: { selector: selectors.header, property: 'cursor' },\n headerGap: { selector: selectors.header, property: 'gap' },\n textGrow: { selector: selectors.text, property: 'flex-grow' },\n textDirection: { selector: selectors.text, property: 'direction' },\n iconAnimationDuration: {\n selector: selectors.icon,\n property: 'transition-duration',\n },\n contentAnimationDuration: {\n selector: selectors.content,\n property: 'transition-duration',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawCollapsibleContainer);\n","import '@descope-ui/descope-text'\nimport '@descope-ui/descope-icon'\nimport { componentName, CollapsibleContainerClass } from './CollapsibleContainerClass';\n\ncustomElements.define(componentName, CollapsibleContainerClass);\n\nexport { CollapsibleContainerClass, componentName };\n","module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik0xNy4yMTkzIDkuMjcyODNDMTcuNjU4NCA4Ljg3OTEyIDE4LjMzMzQgOC45MTU4NyAxOC43MjcyIDkuMzU0OTJDMTkuMTIwOSA5Ljc5Mzk3IDE5LjA4NDEgMTAuNDY5MSAxOC42NDUxIDEwLjg2MjhDMTguNjQ1MSAxMC44NjI4IDEzLjA0NTcgMTYuMDAyMiAxMi42NCAxNi4zNjZDMTIuMjM0MyAxNi43Mjk4IDExLjc2MDggMTYuNzI5OCAxMS4zNTUyIDE2LjM2Nkw1LjM1NDkyIDEwLjg2MjhDNC45MTU4NyAxMC40NjkxIDQuODc5MTIgOS43OTM5NyA1LjI3MjgzIDkuMzU0OTJDNS42NjY1NSA4LjkxNTg3IDYuMzQxNjQgOC44NzkxMiA2Ljc4MDY5IDkuMjcyODNMMTIgMTQuMTM2OEwxNy4yMTkzIDkuMjcyODNaIi8+IDwvc3ZnPiA=\"","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class'],\n componentName,\n }),\n);\n"],"names":["componentName","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","src","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","cssVarList","fill","then","res","appendChild","shouldRender","srcVal","attributeChangedCallback","attrName","oldValue","newValue","mappings","height","selector","width","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","style","setProperty","customElements","define","RawText","hideWhenEmpty","hasChildren","childNodes","length","display","host","TextClass","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","RawCollapsibleContainer","header","shadowRoot","content","icon","headerText","textComponent","isCollapsible","calcContentHeight","offsetHeight","scrollHeight","isCollapsed","toggle","collapse","animated","final","maxHeight","setTimeout","expand","addEventListener","once","includeAttrs","mapAttrs","updateHeaderText","innerText","name","selectors","iconWrapper","wrapper","CollapsibleContainerClass","verticalPadding","horizontalPadding","flexDirection","justifyContent","alignItems","gap","backgroundColor","backgroundImage","backgroundPositionX","backgroundPositionY","backgroundSize","backgroundRepeat","borderRadius","boxShadow","headerIconOrder","headerCursor","headerGap","textGrow","textDirection","iconAnimationDuration","contentAnimationDuration","module","exports","IconClass","slots","wrappedEleName","excludeAttrsSync"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-collapsible-container.js","mappings":"2OAYO,MAAMA,GAAgB,QAAiB,SAExCC,EAAW,CAAC,MAAO,YAEzB,MAAMC,WAAiB,QAAgB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6D,UAAW,CAAExG,SAAUoF,EAAUzB,OAAQhB,SAAU,OACnD8D,SAAU,CAAEzG,SAAUoF,EAAUjF,KAAMwC,SAAU,aAChD+D,cAAe,CAAE1G,SAAUoF,EAAUjF,KAAMwC,SAAU,aACrDgE,sBAAuB,CACrB3G,SAAUoF,EAAUtB,KACpBnB,SAAU,uBAEZiE,yBAA0B,CACxB5G,SAAUoF,EAAUvB,QACpBlB,SAAU,0BAIhB,KACA,KAjDuC,CAkDvCe,GC/OF1B,eAAeC,OAAO9E,EAAeoI,E,YCJrCsB,EAAOC,QAAU,ooB,uGCUV,MAAM3J,GAAgB,QAAiB,QAEjC4J,GAAY,SACvB,QAAiB,CACfjH,SAAU,CACRV,KAAM,CAAC,CAAC,EAAG,CAAEuD,SAAU,IAAWxD,WAAWC,UAGjD,KACA,KAPuB,EASvB,QAAY,CACV4H,MAAO,GACPC,eAAgB,gBAChBnF,MAAO,IAAM,kEAKboF,iBAAkB,CAAC,WAAY,SAC/B/J,kB","sources":["webpack://@descope/web-components-ui/../components/descope-image/src/component/ImageClass.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-image/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-icon/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/CollapsibleContainerClass.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-collapsible-container/src/component/chevron.svg","webpack://@descope/web-components-ui/../components/descope-icon/src/component/IconClass.js"],"sourcesContent":["/* eslint-disable no-use-before-define */\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { createImage } from './helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('image');\n\nconst srcAttrs = ['src', 'src-dark'];\n\nclass RawImage extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return srcAttrs;\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<slot></slot>\n\t`;\n\n injectStyle(\n `\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n :host > slot {\n width: 100%;\n height: 100%;\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\tdisplay: flex;\n\t\t\t\toverflow: hidden;\n\t\t\t}\n\n ::slotted(*) {\n width: 100%;\n\t\t\t}\n\n .hidden {\n display: none;\n }\n `,\n this,\n );\n }\n\n init() {\n super.init?.();\n this.toggleVisibility(this.src);\n }\n\n onThemeChange() {\n this.renderImage();\n }\n\n toggleVisibility(isVisible) {\n if (isVisible) {\n this.classList.remove('hidden');\n } else {\n this.classList.add('hidden');\n }\n }\n\n get altText() {\n return this.getAttribute('alt') || '';\n }\n\n get legacySrc() {\n return this.getAttribute('src');\n }\n\n get themeSrc() {\n return this.getAttribute(`src-${this.currentThemeName}`);\n }\n\n get src() {\n return this.themeSrc || this.legacySrc;\n }\n\n // in order to fill an SVG with `currentColor` override all of its `fill` and `path` nodes\n // with the value from the `st-fill` attribute\n // eslint-disable-next-line class-methods-use-this\n updateFillColor(node) {\n // set fill to root node and all its relevant selectors\n const elementsToReplace = [node, ...node.querySelectorAll('*[fill]')];\n\n elementsToReplace.forEach((ele) => {\n ele.setAttribute(\n 'fill',\n `var(${ImageClass.cssVarList.fill}, ${ele.getAttribute('fill') || \"''\"})`,\n );\n });\n }\n\n renderImage() {\n this.toggleVisibility(this.src);\n\n createImage(this.src, this.altText).then((res) => {\n this.innerHTML = '';\n if (res) {\n this.updateFillColor(res);\n this.appendChild(res);\n }\n });\n }\n\n // render only when src attribute matches current theme\n shouldRender(src) {\n const srcVal = this.getAttribute(src);\n return this.src === srcVal;\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (oldValue === newValue) return;\n\n if (this.shouldRender(attrName)) {\n this.renderImage();\n }\n }\n}\n\nexport const ImageClass = compose(\n createStyleMixin({\n mappings: {\n fill: {},\n height: { selector: () => ':host' },\n width: { selector: () => ':host' },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawImage);\n","import DOMPurify from 'dompurify';\n\nconst getFileExtension = (path) => {\n const match = path.match(/\\.([0-9a-z]+)(?:[\\\\?#]|$)/i);\n return match ? match[1] : null;\n};\n\nconst base64Prefix = 'data:image/svg+xml;base64,';\n\nconst isBase64Svg = (src) => src.startsWith(base64Prefix);\n\nconst createImgEle = (src, altText) => {\n const ele = document.createElement('img');\n ele.setAttribute('src', src);\n ele.setAttribute('alt', altText);\n return ele;\n};\n\nconst createSvgEle = (text) => {\n // we want to purify the SVG to avoid XSS attacks\n const clean = DOMPurify.sanitize(text, {\n USE_PROFILES: { svg: true, svgFilters: true },\n // allow image to render\n ADD_TAGS: ['image'],\n // forbid interactiviy via `use` tags (which are sanitized by default)\n FORBID_TAGS: ['defs']\n });\n\n const parser = new DOMParser();\n const ele = parser\n .parseFromString(clean, 'image/svg+xml')\n .querySelector('svg');\n return ele;\n};\n\nexport const createImage = async (src, altText) => {\n try {\n let ele;\n if (isBase64Svg(src)) {\n // handle base64 source\n const svgXml = atob(src.slice(base64Prefix.length));\n ele = createSvgEle(svgXml);\n } else if (getFileExtension(src) === 'svg') {\n // handle urls\n const fetchedSrc = await fetch(src);\n const text = await fetchedSrc.text();\n ele = createSvgEle(text);\n } else {\n // handle binary\n ele = createImgEle(src, altText);\n }\n\n ele.style.setProperty('max-width', '100%');\n ele.style.setProperty('max-height', '100%');\n\n return ele;\n } catch {\n return null;\n }\n};\n","import { componentName, ImageClass } from './ImageClass';\n\ncustomElements.define(componentName, ImageClass);\n\nexport { ImageClass, componentName };\n","import '@descope-ui/descope-image';\n\nimport { componentName, IconClass } from './IconClass';\n\ncustomElements.define(componentName, IconClass);\n\nexport { IconClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n forwardAttrs,\n getComponentName,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport chevronIcon from './chevron.svg';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('collapsible-container');\n\nclass RawCollapsibleContainer extends createBaseClass({\n componentName,\n baseSelector: 'slot',\n}) {\n static get observedAttributes() {\n return ['collapsed', 'collapsible', 'text'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <descope-text st-host-direction=\"ltr\">\n <div class=\"header\">\n <div class=\"icon\">\n <descope-icon st-fill=\"currentcolor\" src=${chevronIcon}></descope-icon>\n </div>\n <span></span>\n </div>\n </descope-text>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n\t`;\n\n injectStyle(\n `\n div.content {\n transition-property: max-height;\n overflow: auto;\n height: auto;\n\t\t\t}\n\t\t\tslot {\n\t\t\t\tbox-sizing: border-box;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t}\n slot:focus-visible {\n outline: none;\n }\n\t\t\t:host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t}\n .header {\n user-select: none;\n display: flex;\n align-items: baseline;\n }\n .icon {\n flex-shrink: 0;\n height: var(${TextClass.cssVarList.textLineHeight});\n min-height: 24px;\n display: flex;\n align-items: center;\n }\n descope-icon {\n transition-property: transform;\n }\n .rotate {\n transform: rotate(-180deg);\n }\n descope-text {\n width: 100%;\n display: flex;\n }\n span {\n align-self: center;\n word-break: break-word;\n }\n span:empty {\n display: none;\n }\n .wrapper {\n overflow: hidden;\n display: inline-flex;\n width: 100%;\n flex-direction: column;\n }\n `,\n this,\n );\n\n this.header = this.shadowRoot.querySelector('.header');\n this.content = this.shadowRoot.querySelector('div.content');\n this.icon = this.header.querySelector('descope-icon');\n this.headerText = this.header.querySelector('span');\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n }\n\n get isCollapsible() {\n return this.getAttribute('collapsible') === 'true';\n }\n\n calcContentHeight() {\n return this.content.offsetHeight || this.content.scrollHeight;\n }\n\n get isCollapsed() {\n return this.getAttribute('collapsed') === 'true';\n }\n\n toggle() {\n this.setAttribute('collapsed', this.isCollapsed ? 'false' : 'true');\n }\n\n collapse(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '0px';\n };\n this.icon.classList.add('rotate');\n if (!animated) return final();\n\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n setTimeout(final);\n }\n\n expand(animated = false) {\n const final = () => {\n this.content.style.maxHeight = '';\n };\n this.icon.classList.remove('rotate');\n if (!animated) return final();\n\n this.content.addEventListener('transitionend', final, { once: true });\n this.content.style.maxHeight = this.calcContentHeight() + 'px';\n }\n\n #isComponentMounted = false;\n\n init() {\n super.init?.();\n // we want to animate the collapse/expand only after the first time the component is connected\n // so when setting a default value for the collapsed attribute, it will not animate\n this.#isComponentMounted = true;\n\n this.header.addEventListener('click', () => {\n if (!this.isCollapsible) return;\n this.toggle();\n });\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['text-align', 'text-variant', 'text-mode'],\n mapAttrs: { 'text-mode': 'mode', 'text-variant': 'variant' },\n });\n }\n\n updateHeaderText() {\n const text = this.getAttribute('text') || '';\n this.headerText.innerText = text;\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'text') {\n this.updateHeaderText();\n return;\n }\n const collapsed = this.isCollapsed && this.isCollapsible;\n if (collapsed) {\n this.collapse(this.#isComponentMounted);\n } else {\n this.expand(this.#isComponentMounted);\n }\n }\n}\n\nconst selectors = {\n host: () => ':host',\n icon: () => 'descope-icon',\n iconWrapper: () => '.icon',\n header: () => '.header',\n text: () => 'span',\n wrapper: () => '.wrapper',\n content: () => 'div.content',\n};\n\nexport const CollapsibleContainerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: selectors.host, property: 'width' },\n hostDirection: { selector: selectors.host, property: 'direction' },\n verticalPadding: [\n { selector: selectors.wrapper, property: 'padding-top' },\n { selector: selectors.wrapper, property: 'padding-bottom' },\n ],\n horizontalPadding: [\n { selector: selectors.wrapper, property: 'padding-left' },\n { selector: selectors.wrapper, property: 'padding-right' },\n ],\n\n flexDirection: {},\n justifyContent: {},\n alignItems: {},\n gap: [{}, { property: 'margin-top' }],\n\n backgroundColor: { selector: selectors.wrapper },\n backgroundImage: { selector: selectors.wrapper },\n backgroundPositionX: { selector: selectors.wrapper },\n backgroundPositionY: { selector: selectors.wrapper },\n backgroundSize: { selector: selectors.wrapper },\n backgroundRepeat: { selector: selectors.wrapper },\n\n borderRadius: { selector: selectors.wrapper },\n borderColor: { selector: selectors.wrapper },\n borderStyle: { selector: selectors.wrapper },\n borderWidth: { selector: selectors.wrapper },\n\n boxShadow: { selector: selectors.wrapper },\n\n headerIconOrder: { selector: selectors.iconWrapper, property: 'order' },\n headerCursor: { selector: selectors.header, property: 'cursor' },\n headerGap: { selector: selectors.header, property: 'gap' },\n textGrow: { selector: selectors.text, property: 'flex-grow' },\n textDirection: { selector: selectors.text, property: 'direction' },\n iconAnimationDuration: {\n selector: selectors.icon,\n property: 'transition-duration',\n },\n contentAnimationDuration: {\n selector: selectors.content,\n property: 'transition-duration',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawCollapsibleContainer);\n","import '@descope-ui/descope-text'\nimport '@descope-ui/descope-icon'\nimport { componentName, CollapsibleContainerClass } from './CollapsibleContainerClass';\n\ncustomElements.define(componentName, CollapsibleContainerClass);\n\nexport { CollapsibleContainerClass, componentName };\n","module.exports = \"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iYmxhY2siIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+IDxwYXRoIGQ9Ik0xNy4yMTkzIDkuMjcyODNDMTcuNjU4NCA4Ljg3OTEyIDE4LjMzMzQgOC45MTU4NyAxOC43MjcyIDkuMzU0OTJDMTkuMTIwOSA5Ljc5Mzk3IDE5LjA4NDEgMTAuNDY5MSAxOC42NDUxIDEwLjg2MjhDMTguNjQ1MSAxMC44NjI4IDEzLjA0NTcgMTYuMDAyMiAxMi42NCAxNi4zNjZDMTIuMjM0MyAxNi43Mjk4IDExLjc2MDggMTYuNzI5OCAxMS4zNTUyIDE2LjM2Nkw1LjM1NDkyIDEwLjg2MjhDNC45MTU4NyAxMC40NjkxIDQuODc5MTIgOS43OTM5NyA1LjI3MjgzIDkuMzU0OTJDNS42NjY1NSA4LjkxNTg3IDYuMzQxNjQgOC44NzkxMiA2Ljc4MDY5IDkuMjcyODNMMTIgMTQuMTM2OEwxNy4yMTkzIDkuMjcyODNaIi8+IDwvc3ZnPiA=\"","import {\n componentNameValidationMixin,\n createProxy,\n createStyleMixin,\n draggableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { ImageClass } from '@descope-ui/descope-image/class';\nimport { compose } from '@descope-ui/common/utils';\n\nexport const componentName = getComponentName('icon');\n\nexport const IconClass = compose(\n createStyleMixin({\n mappings: {\n fill: [{}, { property: ImageClass.cssVarList.fill }],\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'descope-image',\n style: () => `\n :host {\n display: inline-flex;\n }\n `,\n excludeAttrsSync: ['tabindex', 'class'],\n componentName,\n }),\n);\n"],"names":["componentName","srcAttrs","RawImage","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","init","toggleVisibility","src","onThemeChange","renderImage","isVisible","classList","remove","add","altText","getAttribute","legacySrc","themeSrc","currentThemeName","updateFillColor","node","querySelectorAll","forEach","ele","setAttribute","ImageClass","cssVarList","fill","then","res","appendChild","shouldRender","srcVal","attributeChangedCallback","attrName","oldValue","newValue","mappings","height","selector","width","createSvgEle","text","clean","sanitize","USE_PROFILES","svg","svgFilters","ADD_TAGS","FORBID_TAGS","DOMParser","parseFromString","querySelector","createImage","async","startsWith","isBase64Svg","svgXml","atob","slice","base64Prefix","path","match","getFileExtension","fetchedSrc","fetch","document","createElement","createImgEle","style","setProperty","customElements","define","RawText","hideWhenEmpty","hasChildren","childNodes","length","display","host","TextClass","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","RawCollapsibleContainer","header","shadowRoot","content","icon","headerText","textComponent","isCollapsible","calcContentHeight","offsetHeight","scrollHeight","isCollapsed","toggle","collapse","animated","final","maxHeight","setTimeout","expand","addEventListener","once","includeAttrs","mapAttrs","updateHeaderText","innerText","name","selectors","iconWrapper","wrapper","CollapsibleContainerClass","verticalPadding","horizontalPadding","flexDirection","justifyContent","alignItems","gap","backgroundColor","backgroundImage","backgroundPositionX","backgroundPositionY","backgroundSize","backgroundRepeat","borderRadius","boxShadow","headerIconOrder","headerCursor","headerGap","textGrow","textDirection","iconAnimationDuration","contentAnimationDuration","module","exports","IconClass","slots","wrappedEleName","excludeAttrsSync"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,8819],{48995:(t,e,o)=>{o.r(e),o.d(e,{DividerClass:()=>m,componentName:()=>l});var n=o(79365),r=o(81365),i=o(9696),s=o(97810),p=o(66434),h=o(25964);const l=(0,s.xE)("divider");class d extends((0,r.q)({componentName:l,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t\t<div>\n\t\t\t\t<descope-text>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</descope-text>\n\t\t\t</div>\n\t\t",(0,h.fz)("\n \t:host {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t\t:host > div::before,\n\t\t\t\t:host > div::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t\tdescope-text {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t\tflex-shrink: 0;\n\t\t\t\t}\n\t\t\t\t:host(:empty) descope-text {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t:host([vertical=\"true\"]) div {\n\t\t\t\t\twidth: fit-content;\n\t\t\t\t}\n ",this),this.textComponent=this.shadowRoot.querySelector("descope-text"),(0,s.EA)(this,this.textComponent,{includeAttrs:["mode","variant","italic"]})}}const c=p.s.cssVarList,{host:a,before:y,after:x,text:g}={host:{selector:()=>":host"},before:{selector:"::before"},after:{selector:"::after"},text:{selector:"descope-text"}},m=(0,i.Zz)((0,n.RF)({mappings:{hostWidth:{...a,property:"width"},hostPadding:{...a,property:"padding"},hostDirection:{...g,property:"direction"},minHeight:{},alignItems:{},alignSelf:{},flexDirection:{},textAlign:{...g,property:c.textAlign},labelTextWidth:{...g,property:"width"},labelTextMaxWidth:{...g,property:"max-width"},labelTextVerticalSpacing:[{...g,property:"padding-top"},{...g,property:"padding-bottom"}],labelTextHorizontalSpacing:[{...g,property:"padding-right"},{...g,property:"padding-left"}],stripeColor:[{...y,property:"background-color"},{...x,property:"background-color"}],stripeHorizontalThickness:[{...y,property:"height"},{...x,property:"height"}],stripeVerticalThickness:[{...y,property:"width"},{...x,property:"width"}],stripeColorOpacity:[{...y,property:"opacity"},{...x,property:"opacity"}]}}),n.VO,n.tQ)(d);o(63595),customElements.define(l,m)},63595:(t,e,o)=>{o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},66434:(t,e,o)=>{o.d(e,{T:()=>p,s:()=>d});var n=o(88961),r=o(63200),i=o(25964),s=o(72270);const p=(0,i.xE)("text");class h extends((0,s.qu)({componentName:p,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,i.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,i.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:l}={host:{selector:()=>":host"}},d=(0,r.Zz)((0,n.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(h)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,8819],{48995:(t,e,o)=>{o.r(e),o.d(e,{DividerClass:()=>m,componentName:()=>d});var n=o(79365),i=o(81365),r=o(9696),s=o(97810),p=o(66434),h=o(25964);const d=(0,s.xE)("divider");class l extends((0,i.q)({componentName:d,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t\t<div>\n\t\t\t\t<descope-text>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</descope-text>\n\t\t\t</div>\n\t\t",(0,h.fz)("\n \t:host {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t\t:host > div::before,\n\t\t\t\t:host > div::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t\tdescope-text {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t\tflex-shrink: 0;\n\t\t\t\t}\n\t\t\t\t:host(:empty) descope-text {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t:host([vertical=\"true\"]) div {\n\t\t\t\t\twidth: fit-content;\n\t\t\t\t}\n ",this),this.textComponent=this.shadowRoot.querySelector("descope-text"),(0,s.EA)(this,this.textComponent,{includeAttrs:["mode","variant","italic"]})}}const a=p.s.cssVarList,{host:c,before:y,after:x,text:g}={host:{selector:()=>":host"},before:{selector:"::before"},after:{selector:"::after"},text:{selector:"descope-text"}},m=(0,r.Zz)((0,n.RF)({mappings:{hostWidth:{...c,property:"width"},hostPadding:{...c,property:"padding"},hostDirection:{...g,property:"direction"},minHeight:{},alignItems:{},alignSelf:{},flexDirection:{},textAlign:{...g,property:a.textAlign},labelTextWidth:{...g,property:"width"},labelTextMaxWidth:{...g,property:"max-width"},labelTextVerticalSpacing:[{...g,property:"padding-top"},{...g,property:"padding-bottom"}],labelTextHorizontalSpacing:[{...g,property:"padding-right"},{...g,property:"padding-left"}],stripeColor:[{...y,property:"background-color"},{...x,property:"background-color"}],stripeHorizontalThickness:[{...y,property:"height"},{...x,property:"height"}],stripeVerticalThickness:[{...y,property:"width"},{...x,property:"width"}],stripeColorOpacity:[{...y,property:"opacity"},{...x,property:"opacity"}]}}),n.VO,n.tQ)(l);o(63595),customElements.define(d,m)},63595:(t,e,o)=>{o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},66434:(t,e,o)=>{o.d(e,{T:()=>p,s:()=>l});var n=o(88961),i=o(63200),r=o(25964),s=o(72270);const p=(0,r.xE)("text");class h extends((0,s.qu)({componentName:p,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,r.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,r.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:d}={host:{selector:()=>":host"}},l=(0,i.Zz)((0,n.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(h)}}]);
2
2
  //# sourceMappingURL=descope-divider-index-js.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-divider-index-js.js","mappings":"0QAOO,MAAMA,GAAgB,QAAiB,WAC9C,MAAMC,WAAmB,EAAAC,EAAA,GAAgB,CAAEF,gBAAeG,aAAc,iBACtE,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,+GAQhD,QACE,wiBAyBAH,MAGFA,KAAKI,cAAgBJ,KAAKK,WAAWC,cAAc,iBAEnD,QAAaN,KAAMA,KAAKI,cAAe,CACrCG,aAAc,CAAC,OAAQ,UAAW,WAEtC,EAGF,MAAMC,EAAWC,EAAA,EAAUC,YACrB,KAAEC,EAAI,OAAEC,EAAM,MAAEC,EAAOC,KAAI,GAAK,CACpCH,KAAM,CAAEI,SAAU,IAAM,SACxBH,OAAQ,CAAEG,SAAU,YACpBF,MAAO,CAAEE,SAAU,WACnBD,KAAM,CAAEC,SAAU,iBAGPC,GAAe,SAC1B,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKP,EAAMQ,SAAU,SAChCC,YAAa,IAAKT,EAAMQ,SAAU,WAClCE,cAAe,IAAK,EAAMF,SAAU,aAEpCG,UAAW,CAAC,EACZC,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,cAAe,CAAC,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AAC,EACXC,UAAW,CACT,CAAE5B,SAAU,UAEd6B,eAAgB,CAAE7B,SAAU,eAC5B8B,kBAAmB,CAAE9B,SAAU,kBAC/B+B,WAAY,CAAC,EACbxB,UAAW,CAAC,EACZyB,cAAe,CAAC,EAChBC,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,WAAY,CAAC,EACbC,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,YAAa,CAAC,KAGlB,KACA,KAvBuB,CAwBvBpB,E","sources":["webpack://@descope/web-components-ui/./src/components/descope-divider/DividerClass.js","webpack://@descope/web-components-ui/./src/components/descope-divider/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js"],"sourcesContent":["import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { TextClass } from '@descope-ui/descope-text/class';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('divider');\nclass RawDivider extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t\t<div>\n\t\t\t\t<descope-text>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</descope-text>\n\t\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n \t:host {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t\t:host > div::before,\n\t\t\t\t:host > div::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t\tdescope-text {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t\tflex-shrink: 0;\n\t\t\t\t}\n\t\t\t\t:host(:empty) descope-text {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t:host([vertical=\"true\"]) div {\n\t\t\t\t\twidth: fit-content;\n\t\t\t\t}\n `,\n this\n );\n\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['mode', 'variant', 'italic'],\n });\n }\n}\n\nconst textVars = TextClass.cssVarList;\nconst { host, before, after, text } = {\n host: { selector: () => ':host' },\n before: { selector: '::before' },\n after: { selector: '::after' },\n text: { selector: 'descope-text' },\n};\n\nexport const DividerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostPadding: { ...host, property: 'padding' },\n hostDirection: { ...text, property: 'direction' },\n\n minHeight: {},\n alignItems: {},\n alignSelf: {},\n flexDirection: {},\n textAlign: { ...text, property: textVars.textAlign },\n\n labelTextWidth: { ...text, property: 'width' },\n labelTextMaxWidth: { ...text, property: 'max-width' },\n labelTextVerticalSpacing: [\n { ...text, property: 'padding-top' },\n { ...text, property: 'padding-bottom' },\n ],\n labelTextHorizontalSpacing: [\n { ...text, property: 'padding-right' },\n { ...text, property: 'padding-left' },\n ],\n\n stripeColor: [\n { ...before, property: 'background-color' },\n { ...after, property: 'background-color' },\n ],\n stripeHorizontalThickness: [\n { ...before, property: 'height' },\n { ...after, property: 'height' },\n ],\n stripeVerticalThickness: [\n { ...before, property: 'width' },\n { ...after, property: 'width' },\n ],\n stripeColorOpacity: [\n { ...before, property: 'opacity' },\n { ...after, property: 'opacity' },\n ],\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawDivider);\n","import { componentName, DividerClass } from './DividerClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, DividerClass);\n\nexport { DividerClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n"],"names":["componentName","RawDivider","createBaseClass","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","textComponent","shadowRoot","querySelector","includeAttrs","textVars","TextClass","cssVarList","host","before","after","text","selector","DividerClass","mappings","hostWidth","property","hostPadding","hostDirection","minHeight","alignItems","alignSelf","flexDirection","textAlign","labelTextWidth","labelTextMaxWidth","labelTextVerticalSpacing","labelTextHorizontalSpacing","stripeColor","stripeHorizontalThickness","stripeVerticalThickness","stripeColorOpacity","customElements","define","RawText","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-divider-index-js.js","mappings":"0QAOO,MAAMA,GAAgB,QAAiB,WAC9C,MAAMC,WAAmB,EAAAC,EAAA,GAAgB,CAAEF,gBAAeG,aAAc,iBACtE,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,+GAQhD,QACE,wiBAyBAH,MAGFA,KAAKI,cAAgBJ,KAAKK,WAAWC,cAAc,iBAEnD,QAAaN,KAAMA,KAAKI,cAAe,CACrCG,aAAc,CAAC,OAAQ,UAAW,WAEtC,EAGF,MAAMC,EAAWC,EAAA,EAAUC,YACrB,KAAEC,EAAI,OAAEC,EAAM,MAAEC,EAAOC,KAAI,GAAK,CACpCH,KAAM,CAAEI,SAAU,IAAM,SACxBH,OAAQ,CAAEG,SAAU,YACpBF,MAAO,CAAEE,SAAU,WACnBD,KAAM,CAAEC,SAAU,iBAGPC,GAAe,SAC1B,QAAiB,CACfC,SAAU,CACRC,UAAW,IAAKP,EAAMQ,SAAU,SAChCC,YAAa,IAAKT,EAAMQ,SAAU,WAClCE,cAAe,IAAK,EAAMF,SAAU,aAEpCG,UAAW,CAAC,EACZC,WAAY,CAAC,EACbC,UAAW,CAAC,EACZC,cAAe,CAAC,EAChBC,UAAW,IAAK,EAAMP,SAAUX,EAASkB,WAEzCC,eAAgB,IAAK,EAAMR,SAAU,SACrCS,kBAAmB,IAAK,EAAMT,SAAU,aACxCU,yBAA0B,CACxB,IAAK,EAAMV,SAAU,eACrB,IAAK,EAAMA,SAAU,mBAEvBW,2BAA4B,CAC1B,IAAK,EAAMX,SAAU,iBACrB,IAAK,EAAMA,SAAU,iBAGvBY,YAAa,CACX,IAAKnB,EAAQO,SAAU,oBACvB,IAAKN,EAAOM,SAAU,qBAEx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erClass.js","webpack://@descope/web-components-ui/./src/components/descope-divider/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js"],"sourcesContent":["import { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { TextClass } from '@descope-ui/descope-text/class';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('divider');\nclass RawDivider extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t\t<div>\n\t\t\t\t<descope-text>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</descope-text>\n\t\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n \t:host {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t}\n\t\t\t\t:host > div {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t\t:host > div::before,\n\t\t\t\t:host > div::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tflex-grow: 1;\n\t\t\t\t}\n\t\t\t\tdescope-text {\n\t\t\t\t\tflex-grow: 0;\n\t\t\t\t\tflex-shrink: 0;\n\t\t\t\t}\n\t\t\t\t:host(:empty) descope-text {\n\t\t\t\t\tdisplay: none;\n\t\t\t\t}\n\t\t\t\t:host([vertical=\"true\"]) div {\n\t\t\t\t\twidth: fit-content;\n\t\t\t\t}\n `,\n this\n );\n\n this.textComponent = this.shadowRoot.querySelector('descope-text');\n\n forwardAttrs(this, this.textComponent, {\n includeAttrs: ['mode', 'variant', 'italic'],\n });\n }\n}\n\nconst textVars = TextClass.cssVarList;\nconst { host, before, after, text } = {\n host: { selector: () => ':host' },\n before: { selector: '::before' },\n after: { selector: '::after' },\n text: { selector: 'descope-text' },\n};\n\nexport const DividerClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostPadding: { ...host, property: 'padding' },\n hostDirection: { ...text, property: 'direction' },\n\n minHeight: {},\n alignItems: {},\n alignSelf: {},\n flexDirection: {},\n textAlign: { ...text, property: textVars.textAlign },\n\n labelTextWidth: { ...text, property: 'width' },\n labelTextMaxWidth: { ...text, property: 'max-width' },\n labelTextVerticalSpacing: [\n { ...text, property: 'padding-top' },\n { ...text, property: 'padding-bottom' },\n ],\n labelTextHorizontalSpacing: [\n { ...text, property: 'padding-right' },\n { ...text, property: 'padding-left' },\n ],\n\n stripeColor: [\n { ...before, property: 'background-color' },\n { ...after, property: 'background-color' },\n ],\n stripeHorizontalThickness: [\n { ...before, property: 'height' },\n { ...after, property: 'height' },\n ],\n stripeVerticalThickness: [\n { ...before, property: 'width' },\n { ...after, property: 'width' },\n ],\n stripeColorOpacity: [\n { ...before, property: 'opacity' },\n { ...after, property: 'opacity' },\n ],\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawDivider);\n","import { componentName, DividerClass } from './DividerClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, DividerClass);\n\nexport { DividerClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n"],"names":["componentName","RawDivider","createBaseClass","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","textComponent","shadowRoot","querySelector","includeAttrs","textVars","TextClass","cssVarList","host","before","after","text","selector","DividerClass","mappings","hostWidth","property","hostPadding","hostDirection","minHeight","alignItems","alignSelf","flexDirection","textAlign","labelTextWidth","labelTextMaxWidth","labelTextVerticalSpacing","labelTextHorizontalSpacing","stripeColor","stripeHorizontalThickness","stripeVerticalThickness","stripeColorOpacity","customElements","define","RawText","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159,9261],{36976:(e,t,r)=>{r.d(t,{M:()=>o});const o=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847:(e,t,r)=>{r.d(t,{G:()=>o});const o=e=>{const t=document.createElement("textarea");return t.innerHTML=e,t.value}},55838:(e,t,r)=>{r.r(t),r.d(t,{EnrichedTextClass:()=>o.m,componentName:()=>o.T}),r(74778);var o=r(76231);customElements.define(o.T,o.m)},63595:(e,t,r)=>{r.r(t),r.d(t,{TextClass:()=>o.s,componentName:()=>o.T});var o=r(66434);customElements.define(o.T,o.s)},66434:(e,t,r)=>{r.d(t,{T:()=>l,s:()=>a});var o=r(88961),n=r(63200),s=r(25964),i=r(72270);const l=(0,s.xE)("text");class h extends((0,i.qu)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,s.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,s.Ge)(this,(()=>{const e=!!this.childNodes.length;this.style.display=!e&&this.hideWhenEmpty?"none":""}))}}const{host:c}={host:{selector:()=>":host"}},a=(0,n.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),o.VO,o.tQ)(h)},74778:(e,t,r)=>{r.r(t),r.d(t,{LinkClass:()=>k,componentName:()=>h});var o=r(88961),n=r(63200),s=r(25964),i=r(72270),l=r(66434);const h=(0,s.xE)("link");class c extends((0,i.qu)({componentName:h,baseSelector:":host a"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t",(0,s.fz)("\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n ",this),(0,s.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const a={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:d,text:p,host:m,wrapper:u,link:g}=a,k=(0,n.Zz)((0,o.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...p,property:"direction"},textAlign:u,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...d,property:"color"},{...p,property:l.s.cssVarList.textColor}],cursor:d}}),o.VO,o.tQ)(c);r(63595),customElements.define(h,k)},76231:(e,t,r)=>{r.d(t,{T:()=>a,m:()=>p});var o=r(92540),n=r(88961),s=r(63200),i=r(36976),l=r(72270),h=r(54847),c=r(25964);const a=(0,c.xE)("enriched-text");class d extends((0,l.qu)({componentName:a,baseSelector:":host > div"})){#e;#t;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,c.fz)("\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n ",this),this.#r(),(0,c.Ge)(this,this.#o.bind(this))}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),r!==t&&("readonly"===e&&this.onReadOnlyChange("true"===r),"link-target-blank"===e&&this.#r())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(e,t,r,o,n)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,o,n)),this.processor.renderer.rules.em_close=(e,t,r,o,n)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,o,n))}#n(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(e,t,r,o,n)=>(e[t].attrSet("target","_blank"),this.#e(e,t,r,o,n)):this.processor.renderer.rules.link_open=this.#e}#s(){this.processor&&this.processor.disable(i.M)}#i(){this.#s()}#l(){this.#e=this.processor.renderer.rules.link_open||((e,t,r,o,n)=>n.renderToken(e,t,r)),this.#t=this.processor.renderer.rules.em_open||((e,t,r,o,n)=>n.renderToken(e,t,r))}#r(){this.processor=new o.A("commonmark",{html:!0}),this.#l(),this.#i(),this.#n(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#o(){if(!this.processor)return;let e=(0,h.G)(this.innerHTML);!e?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const t=this.processor.parse(e,{references:void 0});e=this.processor.renderer.render(t,{html:!0,breaks:!0})}catch(e){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=e}onReadOnlyChange(e){e?this.contentNode.setAttribute("inert",e):this.contentNode.removeAttribute("inert")}}const p=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDisplay:{selector:()=>":host",property:"display",fallback:"inline-block"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},fontWeightBold:[{selector:()=>":host strong",property:"font-weight"},{selector:()=>":host b",property:"font-weight"}],textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"},linkTextDecoration:{selector:"a",property:"text-decoration"},linkHoverTextDecoration:{selector:"a:hover",property:"text-decoration"},minHeight:{},minWidth:{}}}),(0,n.RF)({componentNameOverride:(0,c.xE)("link")}),(0,n.RF)({componentNameOverride:(0,c.xE)("text")}),n.VO,n.tQ)(d)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159,9261],{36976:(e,t,r)=>{r.d(t,{M:()=>n});const n=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847:(e,t,r)=>{r.d(t,{G:()=>n});const n=e=>{const t=document.createElement("textarea");return t.innerHTML=e,t.value}},55838:(e,t,r)=>{r.r(t),r.d(t,{EnrichedTextClass:()=>n.m,componentName:()=>n.T}),r(74778);var n=r(76231);customElements.define(n.T,n.m)},63595:(e,t,r)=>{r.r(t),r.d(t,{TextClass:()=>n.s,componentName:()=>n.T});var n=r(66434);customElements.define(n.T,n.s)},66434:(e,t,r)=>{r.d(t,{T:()=>l,s:()=>a});var n=r(88961),o=r(63200),s=r(25964),i=r(72270);const l=(0,s.xE)("text");class h extends((0,i.qu)({componentName:l,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,s.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,s.Ge)(this,(()=>{const e=!!this.childNodes.length;this.style.display=!e&&this.hideWhenEmpty?"none":""}))}}const{host:c}={host:{selector:()=>":host"}},a=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...c,property:"width"},hostDirection:{...c,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(h)},74778:(e,t,r)=>{r.r(t),r.d(t,{LinkClass:()=>k,componentName:()=>h});var n=r(88961),o=r(63200),s=r(25964),i=r(72270),l=r(66434);const h=(0,s.xE)("link");class c extends((0,i.qu)({componentName:h,baseSelector:":host a"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t",(0,s.fz)("\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n ",this),(0,s.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const a={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:d,text:p,host:m,wrapper:u,link:g}=a,k=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...p,property:"direction"},textAlign:u,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...d,property:"color"},{...p,property:l.s.cssVarList.textColor}],cursor:d}}),n.VO,n.tQ)(c);r(63595),customElements.define(h,k)},76231:(e,t,r)=>{r.d(t,{T:()=>a,m:()=>p});var n=r(92540),o=r(88961),s=r(63200),i=r(36976),l=r(72270),h=r(54847),c=r(25964);const a=(0,c.xE)("enriched-text");class d extends((0,l.qu)({componentName:a,baseSelector:":host > div"})){#e;#t;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,c.fz)("\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n ",this),this.#r(),(0,c.Ge)(this,this.#n.bind(this))}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(e,t,r){super.attributeChangedCallback?.(e,t,r),r!==t&&("readonly"===e&&this.onReadOnlyChange("true"===r),"link-target-blank"===e&&this.#r())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(e,t,r,n,o)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,n,o)),this.processor.renderer.rules.em_close=(e,t,r,n,o)=>("_"===e[t].markup&&(e[t].tag="u"),this.#t(e,t,r,n,o))}#o(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(e,t,r,n,o)=>(e[t].attrSet("target","_blank"),this.#e(e,t,r,n,o)):this.processor.renderer.rules.link_open=this.#e}#s(){this.processor&&this.processor.disable(i.M)}#i(){this.#s()}#l(){this.#e=this.processor.renderer.rules.link_open||((e,t,r,n,o)=>o.renderToken(e,t,r)),this.#t=this.processor.renderer.rules.em_open||((e,t,r,n,o)=>o.renderToken(e,t,r))}#r(){this.processor=new n.A("commonmark",{html:!0}),this.#l(),this.#i(),this.#o(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#n(){if(!this.processor)return;let e=(0,h.G)(this.innerHTML);!e?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const t=this.processor.parse(e,{references:void 0});e=this.processor.renderer.render(t,{html:!0,breaks:!0})}catch(e){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=e}onReadOnlyChange(e){e?this.contentNode.setAttribute("inert",e):this.contentNode.removeAttribute("inert")}}const p=(0,s.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDisplay:{selector:()=>":host",property:"display",fallback:"inline-block"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},fontWeightBold:[{selector:()=>":host strong",property:"font-weight"},{selector:()=>":host b",property:"font-weight"}],textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"},linkTextDecoration:{selector:"a",property:"text-decoration"},linkHoverTextDecoration:{selector:"a:hover",property:"text-decoration"},minHeight:{},minWidth:{}}}),(0,o.RF)({componentNameOverride:(0,c.xE)("link")}),(0,o.RF)({componentNameOverride:(0,c.xE)("text")}),o.VO,o.tQ)(d)}}]);
2
2
  //# sourceMappingURL=descope-enriched-text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"descope-enriched-text.js","mappings":"oKAAO,MAAMA,EAAe,CAC1B,aACA,OACA,QACA,QACA,OACA,KACA,YACA,QACA,YACA,UACA,WACA,a,mCCZK,MAAMC,EAAcC,IACzB,MAAMC,EAAWC,SAASC,cAAc,YAExC,OADAF,EAASG,UAAYJ,EACdC,EAASI,KAAK,C,0GCCvBC,eAAeC,OAAO,IAAe,I,yFCFrCD,eAAeC,OAAO,IAAe,I,2FCW9B,MAAMC,GAAgB,QAAiB,QAE9C,MAAMC,WAAgB,QAAgB,CACpCD,gBACAE,aAAc,kBAEd,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUX,UAAY,iDAIhD,QAAY,iLASTS,KACL,CAEA,iBAAIG,GACF,MAAgD,SAAzCH,KAAKI,aAAa,kBAC3B,CAEA,IAAAC,GACEN,MAAMM,QAEN,QAAgBL,MAAM,KACpB,MAAMM,IAAgBN,KAAKO,WAAWC,OACtCR,KAAKS,MAAMC,SAAWJ,GAAeN,KAAKG,cAAgB,OAAS,EAAE,GAEzE,EAGF,MAAM,KAAEQ,GAAS,CACfA,KAAM,CAAEC,SAAU,IAAM,UAGbC,GAAY,SACvB,QAAiB,CACfC,SAAU,CACRC,UAAW,CAAEH,SAAU,IAAM,QAASI,SAAU,SAChDC,cAAe,CAAEL,SAAU,IAAM,QAASI,SAAU,aACpDE,SAAU,CAAC,EACXC,UAAW,CACT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AAE9E,SAAU,IAAM,eAAgBI,SAAU,eAC5C,CAAEJ,SAAU,IAAM,UAAWI,SAAU,gBAEzCG,UAAW,CAAEH,SAAU,SACvBI,eAAgB,CAAEJ,SAAU,eAC5BO,UAAW,CAAC,EACZoE,UAAW,CAAE/E,SAAU,IAAKI,SAAU,SACtC4E,mBAAoB,CAAEhF,SAAU,IAAKI,SAAU,mBAC/C6E,wBAAyB,CAAEjF,SAAU,UAAWI,SAAU,mBAC1D8E,UAAW,CAAC,EACZC,SAAU,CAAC,MAGf,QAAiB,CAAEC,uBAAuB,QAAiB,WAC3D,QAAiB,CAAEA,uBAAuB,QAAiB,UAC3D,KACA,KA1B+B,CA2B/BjD,E","sources":["webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/consts.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js"],"sourcesContent":["export const disableRules = [\n 'blockquote',\n 'list',\n 'image',\n 'table',\n 'code',\n 'hr',\n 'backticks',\n 'fence',\n 'reference',\n 'heading',\n 'lheading',\n 'html_block',\n];\n","export const decodeHTML = (html) => {\n const textArea = document.createElement('textarea');\n textArea.innerHTML = html;\n return textArea.value;\n};\n","import '@descope-ui/descope-link';\n\nimport { componentName, EnrichedTextClass } from './EnrichedTextClass';\n\ncustomElements.define(componentName, EnrichedTextClass);\n\nexport { EnrichedTextClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n `,\n this\n );\n\n forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n }\n\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n }\n\n onReadOnlyChange(isReadOnly) {\n if (isReadOnly) {\n this.contentNode.setAttribute('inert', isReadOnly);\n } else {\n this.contentNode.removeAttribute('inert');\n }\n }\n}\n\nexport const EnrichedTextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDisplay: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n"],"names":["disableRules","decodeHTML","html","textArea","document","createElement","innerHTML","value","customElements","define","componentName","RawText","baseSelector","constructor","super","this","attachShadow","mode","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","host","selector","TextClass","mappings","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","RawLink","shadowRoot","querySelector","includeAttrs","mapAttrs","tooltip","selectors","link","anchor","wrapper","text","LinkClass","textDecoration","fallback","cssVarList","cursor","EnrichedText","bind","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","contentNode","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","e","console","warn","isReadOnly","EnrichedTextClass","hostDisplay","fontWeightBold","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-enriched-text.js","mappings":"oKAAO,MAAMA,EAAe,CAC1B,aACA,OACA,QACA,QACA,OACA,KACA,YACA,QACA,YACA,UACA,WACA,a,mCCZK,MAAMC,EAAcC,IACzB,MAAMC,EAAWC,SAASC,cAAc,YAExC,OADAF,EAASG,UAAYJ,EACdC,EAASI,KAAK,C,0GCCvBC,eAAeC,OAAO,IAAe,I,yFCFrCD,eAAeC,OAAO,IAAe,I,2FCW9B,MAAMC,GAAgB,QAAiB,QAE9C,MAAMC,WAAg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KwD,UAAUC,SAASyB,OAAOtB,EAAQ,CAAEzE,MAAM,EAAMgG,QAAQ,GACtE,CAAE,MAAOC,GAEPC,QAAQC,KAAK,qCACf,CAEAtF,KAAK0E,YAAYnF,UAAYJ,CAC/B,CAEA,gBAAAmE,CAAiBiC,GACXA,EACFvF,KAAK0E,YAAYG,aAAa,QAASU,GAEvCvF,KAAK0E,YAAYI,gBAAgB,QAErC,EAGK,MAAMU,GAAoB,SAC/B,QAAiB,CACf1E,SAAU,CACRC,UAAW,CAAEH,SAAU,IAAM,QAASI,SAAU,SAChDyE,YAAa,CAAE7E,SAAU,IAAM,QAASI,SAAU,UAAW4B,SAAU,gBACvE3B,cAAe,CAAEL,SAAU,IAAM,QAASI,SAAU,aACpDE,SAAU,CAAC,EACXO,WAAY,CAAC,EACbE,WAAY,CAAC,EACb+D,eAAgB,CACd,CAAE9E,SAAU,IAAM,eAAgBI,SAAU,eAC5C,CAAEJ,SAAU,IAAM,UAAWI,SAAU,gBAEzCG,UAAW,CAAEH,SAAU,SACvBI,eAAgB,CAAEJ,SAAU,eAC5BO,UAAW,CAAC,EACZoE,UAAW,CAAE/E,SAAU,IAAKI,SAAU,SACtC4E,mBAAoB,CAAEhF,SAAU,IAAKI,SAAU,mBAC/C6E,wBAAyB,CAAEjF,SAAU,UAAWI,SAAU,mBAC1D8E,UAAW,CAAC,EACZC,SAAU,CAAC,MAGf,QAAiB,CAAEC,uBAAuB,QAAiB,WAC3D,QAAiB,CAAEA,uBAAuB,QAAiB,UAC3D,KACA,KA1B+B,CA2B/BjD,E","sources":["webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/consts.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/helpers.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js"],"sourcesContent":["export const disableRules = [\n 'blockquote',\n 'list',\n 'image',\n 'table',\n 'code',\n 'hr',\n 'backticks',\n 'fence',\n 'reference',\n 'heading',\n 'lheading',\n 'html_block',\n];\n","export const decodeHTML = (html) => {\n const textArea = document.createElement('textarea');\n textArea.innerHTML = html;\n return textArea.value;\n};\n","import '@descope-ui/descope-link';\n\nimport { componentName, EnrichedTextClass } from './EnrichedTextClass';\n\ncustomElements.define(componentName, EnrichedTextClass);\n\nexport { EnrichedTextClass, componentName };\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n `,\n this\n );\n\n forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n","/* eslint-disable no-param-reassign */\n\nimport MarkdownIt from 'markdown-it';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { disableRules } from './consts';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { decodeHTML } from './helpers';\nimport { getComponentName, injectStyle, observeChildren } from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n #origLinkRenderer;\n\n #origEmRenderer;\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"content\"></div>\n `;\n\n injectStyle(\n `\n :host {\n line-height: 1em;\n word-break: break-word;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n *, *:last-child {\n margin: 0;\n }\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p {\n margin-bottom: 1em;\n }\n a {\n cursor: pointer;\n }\n blockquote {\n padding: 0 2em;\n }\n u {\n text-decoration: underline\n }\n s {\n color: currentColor;\n }\n `,\n this\n );\n\n this.#initProcessor();\n\n observeChildren(this, this.#parseChildren.bind(this));\n }\n\n static get observedAttributes() {\n return ['readonly', 'link-target-blank'];\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (newValue !== oldValue) {\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue === 'true');\n }\n\n if (attrName === 'link-target-blank') {\n this.#initProcessor();\n }\n }\n }\n\n // We're overriding the rule for em with single underscore to perform as underline. (_underline_)\n customUnderlineRenderer() {\n this.processor.renderer.rules.em_open = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n this.processor.renderer.rules.em_close = (tokens, idx, options, env, self) => {\n if (tokens[idx].markup === '_') tokens[idx].tag = 'u';\n return this.#origEmRenderer(tokens, idx, options, env, self);\n };\n }\n\n #customizeLinkRenderer() {\n if (this.linkTargetBlank) {\n this.processor.renderer.rules.link_open = (tokens, idx, options, env, self) => {\n // Add a new `target` attribute, or replace the value of the existing one.\n tokens[idx].attrSet('target', '_blank');\n // Pass the token to the default renderer.\n return this.#origLinkRenderer(tokens, idx, options, env, self);\n };\n } else {\n this.processor.renderer.rules.link_open = this.#origLinkRenderer;\n }\n }\n\n #disableCustomRules() {\n if (!this.processor) {\n return;\n }\n this.processor.disable(disableRules);\n }\n\n #updateProcessorRules() {\n this.#disableCustomRules();\n }\n\n #storeOrigRenderers() {\n const defaultLinkRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origLinkRenderer = this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer = this.processor.renderer.rules.em_open || defaultStrongRenderer;\n }\n\n #initProcessor() {\n this.processor = new MarkdownIt('commonmark', { html: true });\n this.#storeOrigRenderers();\n this.#updateProcessorRules();\n this.#customizeLinkRenderer();\n this.customUnderlineRenderer();\n }\n\n get linkTargetBlank() {\n return this.getAttribute('link-target-blank') === 'true';\n }\n\n get contentNode() {\n return this.shadowRoot.querySelector('.content');\n }\n\n #parseChildren() {\n if (!this.processor) {\n return;\n }\n\n let html = decodeHTML(this.innerHTML);\n\n if (!html?.trim() && this.isConnected) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n\n try {\n const tokens = this.processor.parse(html, { references: undefined });\n html = this.processor.renderer.render(tokens, { html: true, breaks: true });\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n }\n\n onReadOnlyChange(isReadOnly) {\n if (isReadOnly) {\n this.contentNode.setAttribute('inert', isReadOnly);\n } else {\n this.contentNode.removeAttribute('inert');\n }\n }\n}\n\nexport const EnrichedTextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDisplay: { selector: () => ':host', property: 'display', fallback: 'inline-block' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n fontFamily: {},\n fontWeight: {},\n fontWeightBold: [\n { selector: () => ':host strong', property: 'font-weight' },\n { selector: () => ':host b', property: 'font-weight' },\n ],\n textColor: { property: 'color' },\n textLineHeight: { property: 'line-height' },\n textAlign: {},\n linkColor: { selector: 'a', property: 'color' },\n linkTextDecoration: { selector: 'a', property: 'text-decoration' },\n linkHoverTextDecoration: { selector: 'a:hover', property: 'text-decoration' },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(EnrichedText);\n"],"names":["disableRules","decodeHTML","html","textArea","document","createElement","innerHTML","value","customElements","define","componentName","RawText","baseSelector","constructor","super","this","attachShadow","mode","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","host","selector","TextClass","mappings","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","RawLink","shadowRoot","querySelector","includeAttrs","mapAttrs","tooltip","selectors","link","anchor","wrapper","text","LinkClass","textDecoration","fallback","cssVarList","cursor","EnrichedText","bind","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","linkTargetBlank","link_open","attrSet","disable","_","renderToken","contentNode","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","e","console","warn","isReadOnly","EnrichedTextClass","hostDisplay","fontWeightBold","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride"],"sourceRoot":""}
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159],{63595:(t,e,o)=>{o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},66434:(t,e,o)=>{o.d(e,{T:()=>h,s:()=>c});var n=o(88961),s=o(63200),r=o(25964),i=o(72270);const h=(0,r.xE)("text");class l extends((0,i.qu)({componentName:h,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,r.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,r.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:p}={host:{selector:()=>":host"}},c=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(l)},74778:(t,e,o)=>{o.r(e),o.d(e,{LinkClass:()=>x,componentName:()=>l});var n=o(88961),s=o(63200),r=o(25964),i=o(72270),h=o(66434);const l=(0,r.xE)("link");class p extends((0,i.qu)({componentName:l,baseSelector:":host a"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t",(0,r.fz)("\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n ",this),(0,r.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,r.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>h.s.componentName}},{anchor:a,text:d,host:m,wrapper:y,link:u}=c,x=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...d,property:"direction"},textAlign:y,textDecoration:{...u,property:"text-decoration",fallback:"none"},textColor:[{...a,property:"color"},{...d,property:h.s.cssVarList.textColor}],cursor:a}}),n.VO,n.tQ)(p);o(63595),customElements.define(l,x)}}]);
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159],{63595:(t,e,o)=>{o.r(e),o.d(e,{TextClass:()=>n.s,componentName:()=>n.T});var n=o(66434);customElements.define(n.T,n.s)},66434:(t,e,o)=>{o.d(e,{T:()=>h,s:()=>c});var n=o(88961),s=o(63200),r=o(25964),i=o(72270);const h=(0,r.xE)("text");class p extends((0,i.qu)({componentName:h,baseSelector:":host > slot"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <slot part="text-wrapper"></slot>\n ',(0,r.fz)("\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n ",this)}get hideWhenEmpty(){return"true"===this.getAttribute("hide-when-empty")}init(){super.init(),(0,r.Ge)(this,(()=>{const t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""}))}}const{host:l}={host:{selector:()=>":host"}},c=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...l,property:"width"},hostDirection:{...l,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),n.VO,n.tQ)(p)},74778:(t,e,o)=>{o.r(e),o.d(e,{LinkClass:()=>x,componentName:()=>p});var n=o(88961),s=o(63200),r=o(25964),i=o(72270),h=o(66434);const p=(0,r.xE)("link");class l extends((0,i.qu)({componentName:p,baseSelector:":host a"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t",(0,r.fz)("\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n ",this),(0,r.EA)(this,this.shadowRoot.querySelector("a"),{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,r.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]})}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>h.s.componentName}},{anchor:a,text:d,host:m,wrapper:y,link:u}=c,x=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...d,property:"direction"},textAlign:y,textDecoration:{...u,property:"text-decoration",fallback:"none"},textColor:[{...a,property:"color"},{...d,property:h.s.cssVarList.textColor}],cursor:a}}),n.VO,n.tQ)(l);o(63595),customElements.define(p,x)}}]);
2
2
  //# sourceMappingURL=descope-link.js.map
@@ -1 +1 @@
1
- {"version":3,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AWC,cAAc,gBAAiB,CAChEC,aAAc,CAAC,OAAQ,YAE3B,EAGF,MAAMG,EAAY,CAChB1B,KAAM,CAAEC,SAAU,IAAM,SACxB0B,KAAM,CAAE1B,SAAU,IAAM,WACxB2B,OAAQ,CAAC,EACTC,QAAS,CAAE5B,SAAU,IAAM,eAC3B6B,KAAM,CAAE7B,SAAU,IAAMC,EAAA,EAAUnB,iBAG5B6C,OAAM,OAAM,wBAAqB,GAAKF,EAEjCK,GAAY,SACvB,QAAiB,CACf5B,SAAU,CACRC,UAAW,IAAKJ,EAAMK,SAAU,SAChCC,cAAe,IAAK,EAAMD,SAAU,aACpCO,UAAWiB,EACXG,eAAgB,IAAK,EAAM3B,SAAU,kBAAmB4B,SAAU,QAClEzB,UAAW,CACT,IAAK,EAAQH,SAAU,SACvB,IAAK,EAAMA,SAAUH,EAAA,EAAUgC,WAAW1B,YAE5C2B,OAAQ,KAGZ,KACA,KAfuB,CAgBvBf,G,SC/EFvC,eAAeC,OAAOC,EAAegD,E","sources":["webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js"],"sourcesContent":["import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n `,\n this\n );\n\n forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n"],"names":["customElements","define","componentName","RawText","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","host","selector","TextClass","mappings","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","RawLink","shadowRoot","querySelector","includeAttrs","mapAttrs","tooltip","selectors","link","anchor","wrapper","text","LinkClass","textDecoration","fallback","cssVarList","cursor"],"sourceRoot":""}
1
+ {"version":3,"file":"descope-link.js","mappings":"qNAEAA,eAAeC,OAAO,IAAe,I,2FCW9B,MAAMC,GAAgB,QAAiB,QAE9C,MAAMC,WAAgB,QAAgB,CACpCD,gBACAE,aAAc,kBAEd,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,iDAIhD,QAAY,iLASTH,KACL,CAEA,iBAAII,GACF,MAAgD,SAAzCJ,KAAKK,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EAEjCK,GAAY,SACvB,QAAiB,CACf5B,SAAU,CACRC,UAAW,IAAKJ,EAAMK,SAAU,SAChCC,cAAe,IAAK,EAAMD,SAAU,aACpCO,UAAWiB,EACXG,eAAgB,IAAK,EAAM3B,SAAU,kBAAmB4B,SAAU,QAClEzB,UAAW,CACT,IAAK,EAAQH,SAAU,SACvB,IAAK,EAAMA,SAAUH,EAAA,EAAUgC,WAAW1B,YAE5C2B,OAAQ,KAGZ,KACA,KAfuB,CAgBvBf,G,SC/EFvC,eAAeC,OAAOC,EAAegD,E","sources":["webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js"],"sourcesContent":["import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('text');\n\nclass RawText extends createBaseClass({\n componentName,\n baseSelector: ':host > slot',\n}) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot part=\"text-wrapper\"></slot>\n `;\n\n injectStyle(`\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `, this);\n }\n\n get hideWhenEmpty() {\n return this.getAttribute('hide-when-empty') === 'true';\n }\n\n init() {\n super.init();\n\n observeChildren(this, () => {\n const hasChildren = !!this.childNodes.length;\n this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';\n });\n }\n}\n\nconst { host } = {\n host: { selector: () => ':host' }\n}\n\nexport const TextClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n fontSize: {},\n textColor: [\n { property: 'color' }\n ],\n textLineHeight: { property: 'line-height' },\n textLetterSpacing: { property: 'letter-spacing' },\n textShadow: {},\n textAlign: {},\n textTransform: {},\n fontFamily: {},\n fontStyle: {},\n fontWeight: {},\n borderWidth: {},\n borderStyle: {},\n borderColor: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n forwardAttrs,\n injectStyle,\n} from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\nimport { TextClass } from '@descope-ui/descope-text/class';\n\nexport const componentName = getComponentName('link');\n\nclass RawLink extends createBaseClass({ componentName, baseSelector: ':host a' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text>\n\t\t\t\t<a>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</a>\n\t\t\t</descope-text>\n\t\t</div>\n\t\t`;\n\n injectStyle(\n `\n :host {\n\t\t\tdisplay: inline-block;\n line-height: 1em;\n\t\t}\n\t\t:host a {\n\t\t\tdisplay: inline;\n\t\t}\n `,\n this\n );\n\n forwardAttrs(this, this.shadowRoot.querySelector('a'), {\n includeAttrs: ['href', 'target', 'tooltip'],\n mapAttrs: {\n tooltip: 'title',\n },\n });\n\n forwardAttrs(this, this.shadowRoot.querySelector('descope-text'), {\n includeAttrs: ['mode', 'variant'],\n });\n }\n}\n\nconst selectors = {\n host: { selector: () => ':host' },\n link: { selector: () => ':host a' },\n anchor: {},\n wrapper: { selector: () => ':host > div' },\n text: { selector: () => TextClass.componentName },\n};\n\nconst { anchor, text, host, wrapper, link } = selectors;\n\nexport const LinkClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...text, property: 'direction' },\n textAlign: wrapper,\n textDecoration: { ...link, property: 'text-decoration', fallback: 'none' },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawLink);\n","import { componentName, LinkClass } from './LinkClass';\nimport '@descope-ui/descope-text';\n\ncustomElements.define(componentName, LinkClass);\n\nexport { LinkClass, componentName };\n"],"names":["customElements","define","componentName","RawText","baseSelector","constructor","super","this","attachShadow","mode","innerHTML","hideWhenEmpty","getAttribute","init","hasChildren","childNodes","length","style","display","host","selector","TextClass","mappings","hostWidth","property","hostDirection","fontSize","textColor","textLineHeight","textLetterSpacing","textShadow","textAlign","textTransform","fontFamily","fontStyle","fontWeight","borderWidth","borderStyle","borderColor","RawLink","shadowRoot","querySelector","includeAttrs","mapAttrs","tooltip","selectors","link","anchor","wrapper","text","LinkClass","textDecoration","fallback","cssVarList","cursor"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[461],{24542:(e,o,n)=>{n.r(o),n.d(o,{ListItemClass:()=>s.O,componentName:()=>s.T});var s=n(93895);customElements.define(s.T,s.O)},93895:(e,o,n)=>{n.d(o,{O:()=>l,T:()=>d});var s=n(88961),t=n(63200),r=n(25964),i=n(72270);const d=(0,r.xE)("list-item"),l=(0,t.Zz)((0,s.RF)({mappings:{padding:{},backgroundColor:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},outline:{},cursor:{},gap:{},maxWidth:{selector:()=>":host"},alignItems:{},flexDirection:{},transition:{}}}),s.VO,s.tQ,(e=>class extends e{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <slot></slot>\n ",(0,r.fz)("\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n ",this)}}),s.y)((0,i.qu)({componentName:d,baseSelector:"slot"}))}}]);
2
+ //# sourceMappingURL=descope-list-item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descope-list-item.js","mappings":"mNAEAA,eAAeC,OAAO,IAAe,I,2FCS9B,MAAMC,GAAgB,QAAiB,aA4BjCC,GAAgB,SAC3B,QAAiB,CACfC,SAAU,CACRC,QAAS,CAAC,EACVC,gBAAiB,CAAC,EAClBC,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,YAAa,CAAC,EACdC,aAAc,CAAC,EACfC,QAAS,CAAC,EACVC,OAAQ,CAAC,EACTC,IAAK,CAAC,EACNC,SAAU,CAAEC,SAAU,IAAM,SAC5BC,WAAY,CAAC,EACbC,cAAe,CAAC,EAChBC,WAAY,CAAC,KAGjB,KACA,MA7CmBC,GACnB,cAAiCA,EAC/B,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,+BAIhD,QACE,uMAWAH,KAEJ,IAwBF,IArB2B,EAsB3B,QAAgB,CAAEpB,gBAAewB,aAAc,S","sources":["webpack://@descope/web-components-ui/../components/descope-list-item/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-list-item/src/component/ListItemClass.js"],"sourcesContent":["import { componentName, ListItemClass } from './ListItemClass';\n\ncustomElements.define(componentName, ListItemClass);\n\nexport { ListItemClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n activeableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('list-item');\n\nconst customMixin = (superclass) =>\n class ListItemMixinClass extends superclass {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot></slot>\n `;\n\n injectStyle(\n `\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n `,\n this\n );\n }\n };\n\nexport const ListItemClass = compose(\n createStyleMixin({\n mappings: {\n padding: {},\n backgroundColor: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n borderRadius: {},\n outline: {},\n cursor: {},\n gap: {},\n maxWidth: { selector: () => ':host' },\n alignItems: {},\n flexDirection: {},\n transition: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n customMixin,\n activeableMixin\n)(createBaseClass({ componentName, baseSelector: 'slot' }));\n"],"names":["customElements","define","componentName","ListItemClass","mappings","padding","backgroundColor","borderColor","borderStyle","borderWidth","borderRadius","outline","cursor","gap","maxWidth","selector","alignItems","flexDirection","transition","superclass","constructor","super","this","attachShadow","mode","innerHTML","baseSelector"],"sourceRoot":""}
@@ -0,0 +1,2 @@
1
+ "use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[461,4551],{7720:(t,e,n)=>{n.d(e,{T:()=>l,x:()=>p});var o=n(88961),s=n(63200),r=n(25964),i=n(93895),a=n(72270);const l=(0,r.xE)("list");class d extends((0,a.qu)({componentName:l,baseSelector:".wrapper"})){static get observedAttributes(){return["variant","readonly"]}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="wrapper">\n <slot></slot>\n <slot name="empty-state">\n No item...\n </slot>\n </div>\n\t',(0,r.fz)('\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name="empty-state"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name="empty-state"] {\n display: none;\n }\n :host([empty]) slot[name="empty-state"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n ',this)}get items(){return this.shadowRoot.querySelector("slot").assignedElements()}#t(){0===this.items.length?this.setAttribute("empty","true"):this.removeAttribute("empty")}get variant(){return this.getAttribute("variant")||"list"}#e(){this.items.forEach((t=>{let e=t;e.localName!==i.O.componentName&&(e=t.querySelector(i.O.componentName));const n="tiles"===this.variant?"tile":"row";e.setAttribute("variant",n)}))}init(){super.init?.(),(0,r.Ge)(this,(()=>{this.#t(),this.#e(),this.#n()}))}get isReadOnly(){return"true"===this.getAttribute("readonly")}#n(){this.items.forEach((t=>{this.isReadOnly?t.setAttribute("inert",""):t.removeAttribute("inert")}))}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("variant"===t?this.#e():"readonly"===t&&this.#n())}}const p=(0,s.Zz)((0,o.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},maxHeight:{selector:()=>":host"},minHeight:{},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],hostDirection:{selector:()=>":host",property:"direction"},fontFamily:{},gap:{},backgroundColor:{},borderRadius:{},borderColor:{},borderStyle:{},borderWidth:{},boxShadow:{},gridTemplateColumns:{},maxItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"max-width"},minItemsWidth:{selector:()=>"::slotted(:not([slot]))",property:"min-width"},itemsHorizontalAlign:{selector:()=>"::slotted(*)",property:"justify-self"},emptyStateTextColor:{selector:()=>'slot[name="empty-state"]',property:"color"},emptyStateTextFontFamily:{selector:()=>'slot[name="empty-state"]',property:"font-family"}}}),o.VO,o.tQ)(d)},24542:(t,e,n)=>{n.r(e),n.d(e,{ListItemClass:()=>o.O,componentName:()=>o.T});var o=n(93895);customElements.define(o.T,o.O)},45400:(t,e,n)=>{n.r(e),n.d(e,{ListClass:()=>o.x,componentName:()=>o.T}),n(24542);var o=n(7720);customElements.define(o.T,o.x)},93895:(t,e,n)=>{n.d(e,{O:()=>l,T:()=>a});var o=n(88961),s=n(63200),r=n(25964),i=n(72270);const a=(0,r.xE)("list-item"),l=(0,s.Zz)((0,o.RF)({mappings:{padding:{},backgroundColor:{},borderColor:{},borderStyle:{},borderWidth:{},borderRadius:{},outline:{},cursor:{},gap:{},maxWidth:{selector:()=>":host"},alignItems:{},flexDirection:{},transition:{}}}),o.VO,o.tQ,(t=>class extends t{constructor(){super(),this.attachShadow({mode:"open"}).innerHTML="\n <slot></slot>\n ",(0,r.fz)("\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n ",this)}}),o.y)((0,i.qu)({componentName:a,baseSelector:"slot"}))}}]);
2
+ //# sourceMappingURL=descope-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descope-list.js","mappings":"gOAcO,MAAMA,GAAgB,QAAiB,QAE9C,MAAMC,WAAgB,QAAgB,CAAED,gBAAeE,aAAc,cACnE,6BAAWC,GACT,MAAO,CAAC,UAAW,WACrB,CAEA,WAAAC,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,gIAShD,QACE,8kBA6BAH,KAEJ,CAEA,SAAII,GACF,OAAOJ,KAAKK,WAAWC,cAAc,QAAQC,kBAC/C,CAEA,KAC4B,IAAtBP,KAAKI,MAAMI,OACbR,KAAKS,aAAa,QAAS,QAE3BT,KAAKU,gBAAgB,QAEzB,CAEA,WAAIC,GACF,OAAOX,KAAKY,aAAa,YAAc,MACzC,CAEA,KACEZ,KAAKI,MAAMS,SAASC,IAClB,IAAIC,EAAWD,EACXC,EAASC,YAAc,IAActB,gBACvCqB,EAAWD,EAAKR,cAAc,IAAcZ,gBAG9C,MAAMuB,EAAmC,UAAjBjB,KAAKW,QAAsB,OAAS,MAC5DI,EAASN,aAAa,UAAWQ,EAAgB,GAErD,CAEA,IAAAC,GACEnB,MAAMmB,UAGN,QAAgBlB,MAAM,KACpBA,MAAK,IACLA,MAAK,IACLA,MAAK,GAAiB,GAE1B,CAEA,cAAImB,GACF,MAAyC,SAAlCnB,KAAKY,aAAa,WAC3B,CAEA,KACEZ,KAAKI,MAAMS,SAASC,IACdd,KAAKmB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AC,EACfe,QAAS,CAAC,EACVC,OAAQ,CAAC,EACTlB,IAAK,CAAC,EACNmB,SAAU,CAAE3B,SAAU,IAAM,SAC5B4B,WAAY,CAAC,EACbC,cAAe,CAAC,EAChBC,WAAY,CAAC,KAGjB,KACA,MA7CmBC,GACnB,cAAiCA,EAC/B,WAAA5D,GACEC,QAEAC,KAAKC,aAAa,CAAEC,KAAM,SAAUC,UAAY,+BAIhD,QACE,uMAWAH,KAEJ,IAwBF,IArB2B,EAsB3B,QAAgB,CAAEN,gBAAeE,aAAc,S","sources":["webpack://@descope/web-components-ui/../components/descope-list/src/component/ListClass.js","webpack://@descope/web-components-ui/../components/descope-list-item/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-list/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-list-item/src/component/ListItemClass.js"],"sourcesContent":["import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport {\n getComponentName,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { ListItemClass } from '@descope-ui/descope-list-item/class';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('list');\n\nclass RawList extends createBaseClass({ componentName, baseSelector: '.wrapper' }) {\n static get observedAttributes() {\n return ['variant', 'readonly'];\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div class=\"wrapper\">\n <slot></slot>\n <slot name=\"empty-state\">\n No item...\n </slot>\n </div>\n\t`;\n\n injectStyle(\n `\n .wrapper {\n overflow: auto;\n display: grid;\n max-height: 100%;\n width: 100%;\n }\n\n :host {\n display: inline-flex;\n width: 100%;\n }\n slot[name=\"empty-state\"] {\n justify-content: center;\n align-items: center;\n display: flex;\n flex-grow: 1;\n }\n\n :host slot[name=\"empty-state\"] {\n display: none;\n }\n :host([empty]) slot[name=\"empty-state\"] {\n display: flex;\n }\n ::slotted(:not([slot])) {\n width: 100%;\n }\n `,\n this\n );\n }\n\n get items() {\n return this.shadowRoot.querySelector('slot').assignedElements();\n }\n\n #handleEmptyState() {\n if (this.items.length === 0) {\n this.setAttribute('empty', 'true');\n } else {\n this.removeAttribute('empty');\n }\n }\n\n get variant() {\n return this.getAttribute('variant') || 'list';\n }\n\n #handleItemsVariant() {\n this.items.forEach((item) => {\n let listItem = item;\n if (listItem.localName !== ListItemClass.componentName) {\n listItem = item.querySelector(ListItemClass.componentName);\n }\n\n const listItemVariant = this.variant === 'tiles' ? 'tile' : 'row';\n listItem.setAttribute('variant', listItemVariant);\n });\n }\n\n init() {\n super.init?.();\n\n // we want new items to get the size\n observeChildren(this, () => {\n this.#handleEmptyState();\n this.#handleItemsVariant();\n this.#handleReadOnly();\n });\n }\n\n get isReadOnly() {\n return this.getAttribute('readonly') === 'true';\n }\n\n #handleReadOnly() {\n this.items.forEach((item) => {\n if (this.isReadOnly) item.setAttribute('inert', '');\n else item.removeAttribute('inert');\n });\n }\n\n attributeChangedCallback(name, oldValue, newValue) {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n if (newValue === oldValue) return;\n\n if (name === 'variant') {\n this.#handleItemsVariant();\n } else if (name === 'readonly') {\n this.#handleReadOnly();\n }\n }\n}\n\nexport const ListClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n maxHeight: { selector: () => ':host' },\n minHeight: {},\n verticalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],\n horizontalPadding: [{ property: 'padding-left' }, { property: 'padding-right' }],\n hostDirection: { selector: () => ':host', property: 'direction' },\n fontFamily: {},\n gap: {},\n\n backgroundColor: {},\n borderRadius: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n\n boxShadow: {},\n gridTemplateColumns: {},\n maxItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'max-width' },\n minItemsWidth: { selector: () => '::slotted(:not([slot]))', property: 'min-width' },\n itemsHorizontalAlign: { selector: () => '::slotted(*)', property: 'justify-self' },\n emptyStateTextColor: { selector: () => 'slot[name=\"empty-state\"]', property: 'color' },\n emptyStateTextFontFamily: {\n selector: () => 'slot[name=\"empty-state\"]',\n property: 'font-family',\n },\n },\n }),\n draggableMixin,\n componentNameValidationMixin\n)(RawList);\n","import { componentName, ListItemClass } from './ListItemClass';\n\ncustomElements.define(componentName, ListItemClass);\n\nexport { ListItemClass, componentName };\n","import '@descope-ui/descope-list-item';\n\nimport { componentName, ListClass } from './ListClass';\n\ncustomElements.define(componentName, ListClass);\n\nexport { ListClass, componentName };\n","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n activeableMixin,\n} from '@descope-ui/common/components-mixins';\nimport { compose } from '@descope-ui/common/utils';\nimport { getComponentName } from '@descope-ui/common/components-helpers';\nimport { injectStyle } from '@descope-ui/common/components-helpers';\nimport { createBaseClass } from '@descope-ui/common/base-classes';\n\nexport const componentName = getComponentName('list-item');\n\nconst customMixin = (superclass) =>\n class ListItemMixinClass extends superclass {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <slot></slot>\n `;\n\n injectStyle(\n `\n slot {\n width: 100%;\n display: flex;\n overflow: hidden;\n box-sizing: border-box;\n }\n :host {\n display: block;\n }\n `,\n this\n );\n }\n };\n\nexport const ListItemClass = compose(\n createStyleMixin({\n mappings: {\n padding: {},\n backgroundColor: {},\n borderColor: {},\n borderStyle: {},\n borderWidth: {},\n borderRadius: {},\n outline: {},\n cursor: {},\n gap: {},\n maxWidth: { selector: () => ':host' },\n alignItems: {},\n flexDirection: {},\n transition: {},\n },\n }),\n draggableMixin,\n componentNameValidationMixin,\n customMixin,\n activeableMixin\n)(createBaseClass({ componentName, baseSelector: 'slot' }));\n"],"names":["componentName","RawList","baseSelector","observedAttributes","constructor","super","this","attachShadow","mode","innerHTML","items","shadowRoot","querySelector","assignedElements","length","setAttribute","removeAttribute","variant","getAttribute","forEach","item","listItem","localName","listItemVariant","init","isReadOnly","attributeChangedCallback","name","oldValue","newValue","ListClass","mappings","hostWidth","selector","property","maxHeight","minHeight","verticalPadding","horizontalPadding","hostDirection","fontFamily","gap","backgroundColor","borderRadius","borderColor","borderStyle","borderWidth","boxShadow","gridTemplateColumns","maxItemsWidth","minItemsWidth","itemsHorizontalAlign","emptyStateTextColor","emptyStateTextFontFamily","customElements","define","ListItemClass","padding","outline","cursor","maxWidth","alignItems","flexDirection","transition","superclass"],"sourceRoot":""}