@descope/web-components-ui 3.22.2 → 3.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +21 -3
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +21 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/9582.js +1 -1
- package/dist/umd/9582.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/DescopeDev.js.map +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js +1 -1
- package/dist/umd/boolean-fields-descope-switch-toggle-index-js.js.map +1 -1
- package/dist/umd/descope-alert-index-js.js +1 -1
- package/dist/umd/descope-alert-index-js.js.map +1 -1
- package/dist/umd/descope-enriched-text.js +1 -1
- package/dist/umd/descope-enriched-text.js.map +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js +1 -1
- package/dist/umd/descope-new-password-descope-new-password-internal-index-js.js.map +1 -1
- package/dist/umd/descope-new-password-index-js.js +1 -1
- package/dist/umd/descope-new-password-index-js.js.map +1 -1
- package/dist/umd/descope-password-index-js.js +1 -1
- package/dist/umd/descope-password-index-js.js.map +1 -1
- package/dist/umd/descope-tooltip.js +1 -1
- package/dist/umd/descope-tooltip.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/package.json +42 -42
- package/src/components/descope-password/PasswordClass.js +14 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see boolean-fields-descope-switch-toggle-index-js.js.LICENSE.txt */
|
|
2
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1448,2294,4159,4838,7362,9261],{76231(t,e,n){n.d(e,{T:()=>d,m:()=>p});var r=n(92540),o=n(88961),i=n(63200),s=n(36976),a=n(72270),l=n(54847),c=n(25964);const d=(0,c.xE)("enriched-text");class h extends((0,a.qu)({componentName:d,baseSelector:":host > div"})){#t;#e;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.#n(),(0,c.Ge)(this,this.#r.bind(this)),this.contentNode?.addEventListener("click",t=>{t.target instanceof HTMLAnchorElement&&t.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("readonly"===t&&this.onReadOnlyChange("true"===n),"link-target-blank"===t&&this.#n())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,n,r,o)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,r,o)),this.processor.renderer.rules.em_close=(t,e,n,r,o)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,r,o))}#o(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,n,r,o)=>(t[e].attrSet("target","_blank"),this.#t(t,e,n,r,o)):this.processor.renderer.rules.link_open=this.#t}#i(){this.processor&&this.processor.disable(s.M)}#s(){this.#i()}#a(){this.#t=this.processor.renderer.rules.link_open||((t,e,n,r,o)=>o.renderToken(t,e,n)),this.#e=this.processor.renderer.rules.em_open||((t,e,n,r,o)=>o.renderToken(t,e,n))}#n(){this.processor=new r.A("commonmark",{html:!0}),this.#a(),this.#s(),this.#o(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#r(){if(!this.processor)return;let t=(0,l.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch{console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,i.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")}),(0,o.DM)({triggers:[{attr:"full-width",value:"true"}]}),o.VO,o.tQ)(h)},36976(t,e,n){n.d(e,{M:()=>r});const r=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(t,e,n){n.d(e,{G:()=>r});const r=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838(t,e,n){n.r(e),n.d(e,{EnrichedTextClass:()=>r.m,componentName:()=>r.T}),n(90512);var r=n(76231);customElements.define(r.T,r.m)},75464(t,e,n){n.d(e,{J:()=>m,T:()=>l});var r=n(88961),o=n(63200),i=n(25964),s=n(72270),a=n(66434);const l=(0,i.xE)("link"),c=["href","readonly"];class d extends((0,s.qu)({componentName:l,baseSelector:":host a"})){static get observedAttributes(){return c.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\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,i.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\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,i.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,i.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const h={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>a.s.componentName}},{anchor:p,text:u,host:b,wrapper:k,link:g}=h,m=(0,o.Zz)((0,r.RF)({mappings:{hostWidth:{...b,property:"width"},hostDirection:{...u,property:"direction"},textAlign:k,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:a.s.cssVarList.textColor}],cursor:p}}),(0,r.DM)({triggers:[{attr:"full-width",value:"true"}]}),r.VO,r.tQ)(d)},90512(t,e,n){n.r(e),n.d(e,{LinkClass:()=>r.J,componentName:()=>r.T});var r=n(75464);n(63595),customElements.define(r.T,r.J)},66434(t,e,n){n.d(e,{T:()=>a,s:()=>d});var r=n(88961),o=n(63200),i=n(25964),s=n(72270);const a=(0,i.xE)("text");class l extends((0,s.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"}},d=(0,o.Zz)((0,r.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:{}}}),(0,r.DM)({triggers:[{attr:"full-width",value:"true"}]}),r.VO,r.tQ)(l)},63595(t,e,n){n.r(e),n.d(e,{TextClass:()=>r.s,componentName:()=>r.T});var r=n(66434);customElements.define(r.T,r.s)},3393(t,e,n){n.d(e,{y:()=>s});var r=n(9696),o=n(79365),i=n(81365);const s=(...t)=>(0,r.Zz)(o.XX,o._$,o.yF,o.jd)((0,i.q)(...t))},19847(t,e,n){n.d(e,{A:()=>i});var r=n(97810),o=n(41813);const i=t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,r.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,r.q)(this.inputElement,this,["checked"]),(0,r.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},47507(t,e,n){n.d(e,{A:()=>i});var r=n(76231),o=n(73551);const i=t=>`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,o.X6)()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot="label"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot="label"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n\ndescope-enriched-text[empty] {\n\t${r.m.cssVarList.hostDisplay}: none;\n}\n\ndescope-enriched-text {\n\t${r.m.cssVarList.hostDirection}: var(${t.hostDirection});\n}\n\n`},41813(t,e,n){n.d(e,{A:()=>l,T:()=>i});var r=n(3393),o=n(97810);const i=(0,o.xE)("boolean-field-internal"),s=["disabled","invalid","readonly"],a=(0,r.y)({componentName:i,baseSelector:"div"}),l=class extends a{static get observedAttributes(){return["readonly","label"]}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper">\n\t\t\t\t<vaadin-checkbox>\n\t\t\t\t\t<descope-enriched-text link-target-blank="true" class="label-content" slot="label"></descope-enriched-text>\n\t\t\t\t</vaadin-checkbox>\n\t\t\t</div>\n\t\t',this.wrapperEle=this.querySelector("div"),this.checkbox=this.querySelector("vaadin-checkbox"),this.labelContent=this.querySelector(".label-content")}get value(){return this.checkbox?.checked}set value(t){this.checkbox.checked=t}get checked(){return this.value}set checked(t){this.value=t}init(){this.addEventListener("focus",t=>{t.isTrusted&&this.checkbox.focus()}),super.init?.(),(0,o.EA)(this,this.checkbox,{includeAttrs:s}),(0,o.Gh)(this,this.checkbox,{includeAttrs:["checked"]}),this.labelContent.addEventListener("click",t=>{this.hasAttribute("disabled")||this.hasAttribute("readonly")||this.checkbox.click()}),this.handleFocusEventsDispatching([this.checkbox])}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"readonly"===t&&this.onReadOnlyChange(null!==n),"label"===t&&this.onLabelChange()}onLabelChange(){const t=this.getAttribute("label");this.labelContent.textContent=t||""}onReadOnlyChange(t){this.baseElement.setAttribute("inert",t)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}}},3274(t,e,n){n.r(e);var r=n(41813);customElements.define(r.T,r.A)},83150(t,e,n){n.d(e,{H:()=>y,T:()=>c}),n(76231);var r=n(97810),o=n(9696),i=n(79365),s=n(19847),a=n(47507),l=n(73551);const c=(0,r.xE)("switch-toggle"),{host:d,component:h,checkboxElement:p,checkboxSurface:u,checkboxLabel:b,requiredIndicator:k,helperText:g,errorMessage:m}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::part(content)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,o.Zz)((0,i.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:[h,b,b],fontFamily:[b,g,m],labelTextColor:[{...b,property:"color"},{...b,property:"-webkit-text-fill-color"}],labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...k,property:"content"},errorMessageTextColor:{...m,property:"color"},errorMessageIcon:{...m,property:"background-image"},errorMessageIconSize:{...m,property:"background-size"},errorMessageIconPadding:{...m,property:"padding-inline-start"},errorMessageIconRepeat:{...m,property:"background-repeat"},errorMessageIconPosition:{...m,property:"background-position"},errorMessageFontSize:{...m,property:"font-size"},trackBorderWidth:{...p,property:"border-width"},trackBorderStyle:{...p,property:"border-style"},trackBorderColor:{...p,property:"border-color"},trackBackgroundColor:{...p,property:"background-color"},trackBorderRadius:{...p,property:"border-radius"},trackWidth:[{...p,property:"width"}],trackHeight:[{...u,property:"font-size"},{...p,property:"height"}],knobSize:[{...u,property:"width"},{...u,property:"height"}],knobTextColor:{...u,property:"color"},knobRadius:{...u,property:"border-radius"},knobTransitionDuration:{...u,property:"transition"},knobColor:{...u,property:"background-color"},knobTopOffset:{...u,property:"top"},knobLeftOffset:{...u,property:"left"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineOffset:{...p,property:"outline-offset"},inputOutlineColor:{...p,property:"outline-color"},inputOutlineStyle:{...p,property:"outline-style"}}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,s.A)((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${(0,a.A)(y.cssVarList)}\n\t\t\t${(0,l.cy)(y.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot="label"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,excludeAttrsSync:["label","tabindex","style"],componentName:c}))},21934(t,e,n){n.r(e),n.d(e,{SwitchToggleClass:()=>r.H,componentName:()=>r.T});var r=n(83150);n(67468),n(11284),n(55838),n(3274),customElements.define(r.T,r.H)},18330(t,e,n){n.d(e,{f:()=>o});var r=n(44099);class o extends r.r{constructor(t,e){super(t,"input","input",{initializer:(t,n)=>{n.value&&(t.value=n.value),n.type&&t.setAttribute("type",n.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0})}}}}]);
|
|
2
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1448,2294,4159,4838,7362,9261],{76231(t,e,n){n.d(e,{T:()=>d,m:()=>p});var r=n(92540),o=n(88961),i=n(63200),s=n(36976),a=n(72270),l=n(54847),c=n(25964);const d=(0,c.xE)("enriched-text");class h extends((0,a.qu)({componentName:d,baseSelector:":host > div"})){#t;#e;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.#n(),(0,c.Ge)(this,this.#r.bind(this)),this.contentNode?.addEventListener("click",t=>{t.target instanceof HTMLAnchorElement&&t.stopPropagation()}),this.contentNode?.addEventListener("keydown",t=>{"Enter"===t.key&&t.target instanceof HTMLAnchorElement&&t.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("readonly"===t&&this.onReadOnlyChange("true"===n),"link-target-blank"===t&&this.#n())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,n,r,o)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,r,o)),this.processor.renderer.rules.em_close=(t,e,n,r,o)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,r,o))}#o(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,n,r,o)=>(t[e].attrSet("target","_blank"),this.#t(t,e,n,r,o)):this.processor.renderer.rules.link_open=this.#t}#i(){this.processor&&this.processor.disable(s.M)}#s(){this.#i()}#a(){this.#t=this.processor.renderer.rules.link_open||((t,e,n,r,o)=>o.renderToken(t,e,n)),this.#e=this.processor.renderer.rules.em_open||((t,e,n,r,o)=>o.renderToken(t,e,n))}#n(){this.processor=new r.A("commonmark",{html:!0}),this.#a(),this.#s(),this.#o(),this.customUnderlineRenderer()}get linkTargetBlank(){return"true"===this.getAttribute("link-target-blank")}get contentNode(){return this.shadowRoot.querySelector(".content")}#r(){if(!this.processor)return;let t=(0,l.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch{console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):this.contentNode.removeAttribute("inert")}}const p=(0,i.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")}),(0,o.DM)({triggers:[{attr:"full-width",value:"true"}]}),o.VO,o.tQ)(h)},36976(t,e,n){n.d(e,{M:()=>r});const r=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(t,e,n){n.d(e,{G:()=>r});const r=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838(t,e,n){n.r(e),n.d(e,{EnrichedTextClass:()=>r.m,componentName:()=>r.T}),n(90512);var r=n(76231);customElements.define(r.T,r.m)},75464(t,e,n){n.d(e,{J:()=>m,T:()=>l});var r=n(88961),o=n(63200),i=n(25964),s=n(72270),a=n(66434);const l=(0,i.xE)("link"),c=["href","readonly"];class d extends((0,s.qu)({componentName:l,baseSelector:":host a"})){static get observedAttributes(){return c.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\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,i.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\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,i.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,i.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const h={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>a.s.componentName}},{anchor:p,text:u,host:b,wrapper:k,link:g}=h,m=(0,o.Zz)((0,r.RF)({mappings:{hostWidth:{...b,property:"width"},hostDirection:{...u,property:"direction"},textAlign:k,textDecoration:{...g,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:a.s.cssVarList.textColor}],cursor:p}}),(0,r.DM)({triggers:[{attr:"full-width",value:"true"}]}),r.VO,r.tQ)(d)},90512(t,e,n){n.r(e),n.d(e,{LinkClass:()=>r.J,componentName:()=>r.T});var r=n(75464);n(63595),customElements.define(r.T,r.J)},66434(t,e,n){n.d(e,{T:()=>a,s:()=>d});var r=n(88961),o=n(63200),i=n(25964),s=n(72270);const a=(0,i.xE)("text");class l extends((0,s.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"}},d=(0,o.Zz)((0,r.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:{}}}),(0,r.DM)({triggers:[{attr:"full-width",value:"true"}]}),r.VO,r.tQ)(l)},63595(t,e,n){n.r(e),n.d(e,{TextClass:()=>r.s,componentName:()=>r.T});var r=n(66434);customElements.define(r.T,r.s)},3393(t,e,n){n.d(e,{y:()=>s});var r=n(9696),o=n(79365),i=n(81365);const s=(...t)=>(0,r.Zz)(o.XX,o._$,o.yF,o.jd)((0,i.q)(...t))},19847(t,e,n){n.d(e,{A:()=>i});var r=n(97810),o=n(41813);const i=t=>class extends t{init(){super.init?.();const t=document.createElement("template");t.innerHTML=`\n\t\t\t\t<${o.T}\n\t\t\t\t\ttabindex="-1"\n\t\t\t\t\tslot="input"\n\t\t\t\t></${o.T}>\n\t\t\t`,this.baseElement.appendChild(t.content.cloneNode(!0)),this.inputElement=this.shadowRoot.querySelector(o.T),this.checkbox=this.inputElement.querySelector("vaadin-checkbox"),(0,r.EA)(this,this.inputElement,{includeAttrs:["required","full-width","size","label","invalid","disabled","readonly"]}),(0,r.q)(this.inputElement,this,["checked"]),(0,r.Gh)(this,this.inputElement,{includeAttrs:["checked"]})}}},47507(t,e,n){n.d(e,{A:()=>i});var r=n(76231),o=n(73551);const i=t=>`\n:host {\n\tdisplay: inline-flex;\n}\n\n${(0,o.X6)()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot="label"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot="label"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n\ndescope-enriched-text[empty] {\n\t${r.m.cssVarList.hostDisplay}: none;\n}\n\ndescope-enriched-text {\n\t${r.m.cssVarList.hostDirection}: var(${t.hostDirection});\n}\n\n`},41813(t,e,n){n.d(e,{A:()=>l,T:()=>i});var r=n(3393),o=n(97810);const i=(0,o.xE)("boolean-field-internal"),s=["disabled","invalid","readonly"],a=(0,r.y)({componentName:i,baseSelector:"div"}),l=class extends a{static get observedAttributes(){return["readonly","label"]}constructor(){super(),this.innerHTML='\n\t\t\t<div class="wrapper">\n\t\t\t\t<vaadin-checkbox>\n\t\t\t\t\t<descope-enriched-text link-target-blank="true" class="label-content" slot="label"></descope-enriched-text>\n\t\t\t\t</vaadin-checkbox>\n\t\t\t</div>\n\t\t',this.wrapperEle=this.querySelector("div"),this.checkbox=this.querySelector("vaadin-checkbox"),this.labelContent=this.querySelector(".label-content")}get value(){return this.checkbox?.checked}set value(t){this.checkbox.checked=t}get checked(){return this.value}set checked(t){this.value=t}init(){this.addEventListener("focus",t=>{t.isTrusted&&this.checkbox.focus()}),super.init?.(),(0,o.EA)(this,this.checkbox,{includeAttrs:s}),(0,o.Gh)(this,this.checkbox,{includeAttrs:["checked"]}),this.labelContent.addEventListener("click",t=>{this.hasAttribute("disabled")||this.hasAttribute("readonly")||this.checkbox.click()}),this.handleFocusEventsDispatching([this.checkbox])}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),"readonly"===t&&this.onReadOnlyChange(null!==n),"label"===t&&this.onLabelChange()}onLabelChange(){const t=this.getAttribute("label");this.labelContent.textContent=t||""}onReadOnlyChange(t){this.baseElement.setAttribute("inert",t)}getValidity(){return this.isRequired&&!this.value?{valueMissing:!0}:{}}}},3274(t,e,n){n.r(e);var r=n(41813);customElements.define(r.T,r.A)},83150(t,e,n){n.d(e,{H:()=>y,T:()=>c}),n(76231);var r=n(97810),o=n(9696),i=n(79365),s=n(19847),a=n(47507),l=n(73551);const c=(0,r.xE)("switch-toggle"),{host:d,component:h,checkboxElement:p,checkboxSurface:u,checkboxLabel:b,requiredIndicator:k,helperText:g,errorMessage:m}={host:{selector:()=>":host"},requiredIndicator:{selector:'[required] vaadin-checkbox [slot="label"]:not(:empty)::part(content)::after'},component:{selector:"vaadin-checkbox"},checkboxElement:{selector:"vaadin-checkbox::part(checkbox)"},checkboxSurface:{selector:"vaadin-checkbox::part(checkbox)::after"},checkboxLabel:{selector:'vaadin-checkbox [slot="label"]:not(:empty)'},helperText:{selector:"::part(helper-text)"},errorMessage:{selector:"::part(error-message)"}},y=(0,o.Zz)((0,i.RF)({mappings:{hostWidth:{...d,property:"width"},hostDirection:{...d,property:"direction"},fontSize:[h,b,b],fontFamily:[b,g,m],labelTextColor:[{...b,property:"color"},{...b,property:"-webkit-text-fill-color"}],labelSpacing:{...b,property:"padding-inline-start"},labelLineHeight:{...b,property:"line-height"},labelFontWeight:{...b,property:"font-weight"},labelRequiredIndicator:{...k,property:"content"},errorMessageTextColor:{...m,property:"color"},errorMessageIcon:{...m,property:"background-image"},errorMessageIconSize:{...m,property:"background-size"},errorMessageIconPadding:{...m,property:"padding-inline-start"},errorMessageIconRepeat:{...m,property:"background-repeat"},errorMessageIconPosition:{...m,property:"background-position"},errorMessageFontSize:{...m,property:"font-size"},trackBorderWidth:{...p,property:"border-width"},trackBorderStyle:{...p,property:"border-style"},trackBorderColor:{...p,property:"border-color"},trackBackgroundColor:{...p,property:"background-color"},trackBorderRadius:{...p,property:"border-radius"},trackWidth:[{...p,property:"width"}],trackHeight:[{...u,property:"font-size"},{...p,property:"height"}],knobSize:[{...u,property:"width"},{...u,property:"height"}],knobTextColor:{...u,property:"color"},knobRadius:{...u,property:"border-radius"},knobTransitionDuration:{...u,property:"transition"},knobColor:{...u,property:"background-color"},knobTopOffset:{...u,property:"top"},knobLeftOffset:{...u,property:"left"},inputOutlineWidth:{...p,property:"outline-width"},inputOutlineOffset:{...p,property:"outline-offset"},inputOutlineColor:{...p,property:"outline-color"},inputOutlineStyle:{...p,property:"outline-style"}}}),i.VO,(0,i.OZ)({proxyProps:["value","selectionStart"]}),i.tQ,s.A)((0,i.tz)({slots:[],wrappedEleName:"vaadin-text-field",style:()=>`\n\t\t\t${(0,a.A)(y.cssVarList)}\n\t\t\t${(0,l.cy)(y.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot="label"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,excludeAttrsSync:["label","tabindex","style"],componentName:c}))},21934(t,e,n){n.r(e),n.d(e,{SwitchToggleClass:()=>r.H,componentName:()=>r.T});var r=n(83150);n(67468),n(11284),n(55838),n(3274),customElements.define(r.T,r.H)},18330(t,e,n){n.d(e,{f:()=>o});var r=n(44099);class o extends r.r{constructor(t,e){super(t,"input","input",{initializer:(t,n)=>{n.value&&(t.value=n.value),n.type&&t.setAttribute("type",n.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0})}}}}]);
|
|
3
3
|
//# sourceMappingURL=boolean-fields-descope-switch-toggle-index-js.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boolean-fields-descope-switch-toggle-index-js.js","mappings":";yQAiBO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,iBAE7C,MAAAC,WAA2B,EAAAC,EAAAC,IAAe,CAC1CL,gBACAM,aAAA,iBAEAC,GAEAC,GAEA,WAAAC,GACAC,QAEAC,KAAAC,aAAA,CAAwBC,KAAA,SAAcC,UAAA,2CAIlC,EAAAb,EAAAc,IACJ,6iBAkCAJ,MAGAA,MAAAK,KAEI,EAAAf,EAAAgB,IAAeN,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G,EAAAxM,GAAYiK,EAAA7E,uBACZ,EAAAqH,EAAAC,IAAsBzC,EAAA7E,+/BAsD3BuH,iBAAA,6BACArQ,mJCxJAkH,eAAAC,OAAsBmJ,EAAAjJ,EAAeiJ,EAAAC,iDCI9B,MAAAC,UAA8BC,EAAAC,EACrC,WAAAjQ,CAAA2H,EAAAuI,GACAjQ,MAAA0H,EAAA,iBACAwI,YAAA,CAAAC,EAAAzI,KACAA,EAAA1B,QACAmK,EAAAnK,MAAA0B,EAAA1B,OAEA0B,EAAA0I,MACAD,EAAA1M,aAAA,OAAAiE,EAAA0I,MAIAD,EAAAE,GAAApQ,KAAAqQ,UAEA,mBAAAL,GACAA,EAAAE,IAGAI,aAAA,GAEA","sources":["webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js","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-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/booleanFieldMixin.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/commonStyles.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/index.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/index.js","webpack://@descope/web-components-ui/javascript/libs/webpack-extract-font-loader/node_modules/@vaadin/field-base/src/input-controller.js"],"sourcesContent":["import MarkdownIt from 'markdown-it';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} 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 {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({\n componentName,\n baseSelector: ':host > div',\n}) {\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 // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 =\n this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer =\n 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, {\n html: true,\n breaks: true,\n });\n } catch {\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstChild?.setAttribute('part', 'content');\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: {\n selector: () => ':host',\n property: 'display',\n fallback: 'inline-block',\n },\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: {\n selector: 'a:hover',\n property: 'text-decoration',\n },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(EnrichedText);\n","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 {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\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 :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\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 this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\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: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\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","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import { compose } from '../helpers';\nimport {\n changeMixin,\n inputEventsDispatchingMixin,\n inputValidationMixin,\n normalizeBooleanAttributesMixin,\n} from '../mixins';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","import { forwardAttrs, forwardProps, syncAttrs } from '../../helpers/componentHelpers';\nimport { componentName as descopeInternalComponentName } from './descope-boolean-field-internal/BooleanFieldInternal';\n\nexport const booleanFieldMixin = (superclass) =>\n class BooleanFieldMixinClass extends superclass {\n init() {\n super.init?.();\n\n const template = document.createElement('template');\n template.innerHTML = `\n\t\t\t\t<${descopeInternalComponentName}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\tslot=\"input\"\n\t\t\t\t></${descopeInternalComponentName}>\n\t\t\t`;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n this.checkbox = this.inputElement.querySelector('vaadin-checkbox');\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'required',\n 'full-width',\n 'size',\n 'label',\n 'invalid',\n 'disabled',\n 'readonly',\n ],\n });\n\n forwardProps(this.inputElement, this, ['checked']);\n syncAttrs(this, this.inputElement, { includeAttrs: ['checked'] });\n }\n };\n","import { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { resetInputFieldDefaultWidth } from '../../helpers/themeHelpers/resetHelpers';\n\nexport default (cssVarList) => `\n:host {\n\tdisplay: inline-flex;\n}\n\n${resetInputFieldDefaultWidth()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot=\"label\"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot=\"label\"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n\ndescope-enriched-text[empty] {\n\t${EnrichedTextClass.cssVarList.hostDisplay}: none;\n}\n\ndescope-enriched-text {\n\t${EnrichedTextClass.cssVarList.hostDirection}: var(${cssVarList.hostDirection});\n}\n\n`;\n","import { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName, syncAttrs } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('boolean-field-internal');\n\nconst forwardAttributes = ['disabled', 'invalid', 'readonly'];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass BooleanInputInternal extends BaseInputClass {\n static get observedAttributes() {\n return ['readonly', 'label'];\n }\n\n constructor() {\n super();\n this.innerHTML = `\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<vaadin-checkbox>\n\t\t\t\t\t<descope-enriched-text link-target-blank=\"true\" class=\"label-content\" slot=\"label\"></descope-enriched-text>\n\t\t\t\t</vaadin-checkbox>\n\t\t\t</div>\n\t\t`;\n this.wrapperEle = this.querySelector('div');\n this.checkbox = this.querySelector('vaadin-checkbox');\n this.labelContent = this.querySelector('.label-content');\n }\n\n get value() {\n return this.checkbox?.checked;\n }\n\n set value(val) {\n this.checkbox.checked = val;\n }\n\n get checked() {\n return this.value;\n }\n\n set checked(val) {\n this.value = val;\n }\n\n init() {\n this.addEventListener('focus', (e) => {\n if (e.isTrusted) {\n this.checkbox.focus();\n }\n });\n super.init?.();\n\n forwardAttrs(this, this.checkbox, { includeAttrs: forwardAttributes });\n syncAttrs(this, this.checkbox, { includeAttrs: ['checked'] });\n\n // Handle label click to toggle checkbox\n this.labelContent.addEventListener('click', (e) => {\n if (!this.hasAttribute('disabled') && !this.hasAttribute('readonly')) {\n this.checkbox.click();\n }\n });\n\n // we need it in order to set the focus ring and trigger validation on descope-checkbox\n this.handleFocusEventsDispatching([this.checkbox]);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null);\n }\n\n if (attrName === 'label') {\n this.onLabelChange();\n }\n }\n\n onLabelChange() {\n const labelValue = this.getAttribute('label');\n if (labelValue) {\n this.labelContent.textContent = labelValue;\n } else {\n this.labelContent.textContent = '';\n }\n }\n\n onReadOnlyChange(val) {\n this.baseElement.setAttribute('inert', val);\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n return {};\n }\n}\n\nexport default BooleanInputInternal;\n","import BooleanFieldInternal, { componentName } from './BooleanFieldInternal';\n\ncustomElements.define(componentName, BooleanFieldInternal);\n","import { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { getComponentName } from '../../../helpers/componentHelpers';\nimport { compose } from '../../../helpers';\nimport {\n createStyleMixin,\n proxyInputMixin,\n draggableMixin,\n componentNameValidationMixin,\n createProxy,\n} from '../../../mixins';\nimport { booleanFieldMixin } from '../booleanFieldMixin';\nimport commonStyles from '../commonStyles';\nimport { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('switch-toggle');\n\nconst {\n host,\n component,\n checkboxElement: track,\n checkboxSurface: knob,\n checkboxLabel,\n requiredIndicator,\n helperText,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n requiredIndicator: {\n selector: '[required] vaadin-checkbox [slot=\"label\"]:not(:empty)::part(content)::after',\n },\n component: { selector: 'vaadin-checkbox' },\n checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },\n checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },\n checkboxLabel: { selector: 'vaadin-checkbox [slot=\"label\"]:not(:empty)' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const SwitchToggleClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n\n fontSize: [component, checkboxLabel, checkboxLabel],\n fontFamily: [checkboxLabel, helperText, errorMessage],\n\n labelTextColor: [\n { ...checkboxLabel, property: 'color' },\n { ...checkboxLabel, property: '-webkit-text-fill-color' },\n ],\n labelSpacing: { ...checkboxLabel, property: 'padding-inline-start' },\n labelLineHeight: { ...checkboxLabel, property: 'line-height' },\n labelFontWeight: { ...checkboxLabel, property: 'font-weight' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n trackBorderWidth: { ...track, property: 'border-width' },\n trackBorderStyle: { ...track, property: 'border-style' },\n trackBorderColor: { ...track, property: 'border-color' },\n trackBackgroundColor: { ...track, property: 'background-color' },\n trackBorderRadius: { ...track, property: 'border-radius' },\n trackWidth: [{ ...track, property: 'width' }],\n trackHeight: [\n { ...knob, property: 'font-size' },\n { ...track, property: 'height' },\n ],\n\n knobSize: [\n { ...knob, property: 'width' },\n { ...knob, property: 'height' },\n ],\n knobTextColor: { ...knob, property: 'color' },\n knobRadius: { ...knob, property: 'border-radius' },\n knobTransitionDuration: { ...knob, property: 'transition' },\n knobColor: { ...knob, property: 'background-color' },\n knobTopOffset: { ...knob, property: 'top' },\n knobLeftOffset: { ...knob, property: 'left' },\n\n inputOutlineWidth: { ...track, property: 'outline-width' },\n inputOutlineOffset: { ...track, property: 'outline-offset' },\n inputOutlineColor: { ...track, property: 'outline-color' },\n inputOutlineStyle: { ...track, property: 'outline-style' },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n booleanFieldMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t${commonStyles(SwitchToggleClass.cssVarList)}\n\t\t\t${useHostExternalPadding(SwitchToggleClass.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot=\"label\"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,\n excludeAttrsSync: ['label', 'tabindex', 'style'],\n componentName,\n })\n);\n","import { componentName, SwitchToggleClass } from './SwitchToggleClass';\nimport '@vaadin/checkbox';\nimport '@vaadin/text-field';\nimport '@descope-ui/descope-enriched-text';\nimport '../descope-boolean-field-internal';\n\ncustomElements.define(componentName, SwitchToggleClass);\n\nexport { SwitchToggleClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from '@vaadin/component-base/src/slot-controller.js';\n\n/**\n * A controller to create and initialize slotted `<input>` element.\n */\nexport class InputController extends SlotController {\n constructor(host, callback) {\n super(host, 'input', 'input', {\n initializer: (node, host) => {\n if (host.value) {\n node.value = host.value;\n }\n if (host.type) {\n node.setAttribute('type', host.type);\n }\n\n // Ensure every instance has unique ID\n node.id = this.defaultId;\n\n if (typeof callback === 'function') {\n callback(node);\n }\n },\n useUniqueId: true,\n });\n }\n}\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_6__","xE","EnrichedText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_4__","qu","baseSelector","origLinkRenderer","origEmRenderer","constructor","super","this","attachShadow","mode","innerHTML","fz","initProcessor","Ge","parseChildren","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","customizeLinkRenderer","linkTargetBlank","link_open","attrSet","disableCustomRules","disable","_consts__WEBPACK_IMPORTED_MODULE_3__","M","updateProcessorRules","storeOrigRenderers","_","renderToken","markdown_it__WEBPACK_IMPORTED_MODULE_0__","A","html","getAttribute","shadowRoot","querySelector","_helpers__WEBPACK_IMPORTED_MODULE_5__","G","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_2__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_1__","RF","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","DM","triggers","attr","value","VO","tQ","disableRules","decodeHTML","textArea","document","createElement","customElements","define","_EnrichedTextClass__WEBPACK_IMPORTED_MODULE_1__","T","m","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","observedAttrs","RawLink","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","concat","anchor","EA","includeAttrs","mapAttrs","tooltip","readOnly","preventDefault","selectors","host","link","wrapper","text","_descope_ui_descope_text_class__WEBPACK_IMPORTED_MODULE_4__","s","LinkClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","textDecoration","cssVarList","cursor","_LinkClass__WEBPACK_IMPORTED_MODULE_0__","J","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","TextClass","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","_TextClass__WEBPACK_IMPORTED_MODULE_0__","createBaseInputClass","args","_helpers__WEBPACK_IMPORTED_MODULE_0__","_mixins__WEBPACK_IMPORTED_MODULE_1__","XX","_$","yF","jd","_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","booleanFieldMixin","superclass","template","_descope_boolean_field_internal_BooleanFieldInternal__WEBPACK_IMPORTED_MODULE_1__","baseElement","appendChild","content","cloneNode","inputElement","checkbox","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_0__","Gh","__WEBPACK_DEFAULT_EXPORT__","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_1__","X6","_descope_ui_descope_enriched_text_class__WEBPACK_IMPORTED_MODULE_0__","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_1__","forwardAttributes","BaseInputClass","_baseClasses_createBaseInputClass__WEBPACK_IMPORTED_MODULE_0__","y","wrapperEle","labelContent","checked","val","isTrusted","focus","hasAttribute","click","handleFocusEventsDispatching","onLabelChange","labelValue","textContent","getValidity","isRequired","valueMissing","_BooleanFieldInternal__WEBPACK_IMPORTED_MODULE_0__","component","checkboxElement","track","checkboxSurface","knob","checkboxLabel","requiredIndicator","helperText","errorMessage","SwitchToggleClass","_helpers__WEBPACK_IMPORTED_MODULE_2__","_mixins__WEBPACK_IMPORTED_MODULE_3__","labelTextColor","labelSpacing","labelLineHeight","labelFontWeight","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","trackBorderWidth","trackBorderStyle","trackBorderColor","trackBackgroundColor","trackBorderRadius","trackWidth","trackHeight","knobSize","knobTextColor","knobRadius","knobTransitionDuration","knobColor","knobTopOffset","knobLeftOffset","inputOutlineWidth","inputOutlineOffset","inputOutlineColor","inputOutlineStyle","OZ","proxyProps","_booleanFieldMixin__WEBPACK_IMPORTED_MODULE_4__","tz","slots","wrappedEleName","_commonStyles__WEBPACK_IMPORTED_MODULE_5__","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_6__","cy","excludeAttrsSync","_SwitchToggleClass__WEBPACK_IMPORTED_MODULE_0__","H","InputController","_vaadin_component_base_src_slot_controller_js__WEBPACK_IMPORTED_MODULE_0__","r","callback","initializer","node","type","id","defaultId","useUniqueId"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"boolean-fields-descope-switch-toggle-index-js.js","mappings":";yQAiBO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,iBAE7C,MAAAC,WAA2B,EAAAC,EAAAC,IAAe,CAC1CL,gBACAM,aAAA,iBAEAC,GAEAC,GAEA,WAAAC,GACAC,QAEAC,KAAAC,aAAA,CAAwBC,KAAA,SAAcC,UAAA,2CAIlC,EAAAb,EAAAc,IACJ,6i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EAAA+B,IAAe,CAAGC,WAAA,6BAClBhC,EAAAjH,GACAkJ,EAAApM,EA1D+B,EA4D/B,EAAAmK,EAAAkC,IAAW,CACbC,MAAA,GACAC,eAAA,oBACAzG,MAAA,gBACK,EAAA0G,EAAAxM,GAAYiK,EAAA7E,uBACZ,EAAAqH,EAAAC,IAAsBzC,EAAA7E,+/BAsD3BuH,iBAAA,6BACAtQ,mJCxJAmH,eAAAC,OAAsBmJ,EAAAjJ,EAAeiJ,EAAAC,iDCI9B,MAAAC,UAA8BC,EAAAC,EACrC,WAAAlQ,CAAA4H,EAAAuI,GACAlQ,MAAA2H,EAAA,iBACAwI,YAAA,CAAAC,EAAAzI,KACAA,EAAA1B,QACAmK,EAAAnK,MAAA0B,EAAA1B,OAEA0B,EAAA0I,MACAD,EAAA1M,aAAA,OAAAiE,EAAA0I,MAIAD,EAAAE,GAAArQ,KAAAsQ,UAEA,mBAAAL,GACAA,EAAAE,IAGAI,aAAA,GAEA","sources":["webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js","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-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/./src/baseClasses/createBaseInputClass.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/booleanFieldMixin.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/commonStyles.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/BooleanFieldInternal.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-boolean-field-internal/index.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/SwitchToggleClass.js","webpack://@descope/web-components-ui/./src/components/boolean-fields/descope-switch-toggle/index.js","webpack://@descope/web-components-ui/javascript/libs/webpack-extract-font-loader/node_modules/@vaadin/field-base/src/input-controller.js"],"sourcesContent":["import MarkdownIt from 'markdown-it';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} 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 {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({\n componentName,\n baseSelector: ':host > div',\n}) {\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 // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\n\n // The SDK submits the form (and prevents link activation) on any Enter that reaches the flow root\n this.contentNode?.addEventListener('keydown', (e) => {\n if (e.key === 'Enter' && e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 =\n this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer =\n 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, {\n html: true,\n breaks: true,\n });\n } catch {\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstChild?.setAttribute('part', 'content');\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: {\n selector: () => ':host',\n property: 'display',\n fallback: 'inline-block',\n },\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: {\n selector: 'a:hover',\n property: 'text-decoration',\n },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(EnrichedText);\n","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 {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\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 :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\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 this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\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: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\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","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import { compose } from '../helpers';\nimport {\n changeMixin,\n inputEventsDispatchingMixin,\n inputValidationMixin,\n normalizeBooleanAttributesMixin,\n} from '../mixins';\nimport { createBaseClass } from './createBaseClass';\n\nexport const createBaseInputClass = (...args) =>\n compose(\n inputValidationMixin,\n changeMixin,\n normalizeBooleanAttributesMixin,\n inputEventsDispatchingMixin\n )(createBaseClass(...args));\n","import { forwardAttrs, forwardProps, syncAttrs } from '../../helpers/componentHelpers';\nimport { componentName as descopeInternalComponentName } from './descope-boolean-field-internal/BooleanFieldInternal';\n\nexport const booleanFieldMixin = (superclass) =>\n class BooleanFieldMixinClass extends superclass {\n init() {\n super.init?.();\n\n const template = document.createElement('template');\n template.innerHTML = `\n\t\t\t\t<${descopeInternalComponentName}\n\t\t\t\t\ttabindex=\"-1\"\n\t\t\t\t\tslot=\"input\"\n\t\t\t\t></${descopeInternalComponentName}>\n\t\t\t`;\n\n this.baseElement.appendChild(template.content.cloneNode(true));\n this.inputElement = this.shadowRoot.querySelector(descopeInternalComponentName);\n this.checkbox = this.inputElement.querySelector('vaadin-checkbox');\n\n forwardAttrs(this, this.inputElement, {\n includeAttrs: [\n 'required',\n 'full-width',\n 'size',\n 'label',\n 'invalid',\n 'disabled',\n 'readonly',\n ],\n });\n\n forwardProps(this.inputElement, this, ['checked']);\n syncAttrs(this, this.inputElement, { includeAttrs: ['checked'] });\n }\n };\n","import { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { resetInputFieldDefaultWidth } from '../../helpers/themeHelpers/resetHelpers';\n\nexport default (cssVarList) => `\n:host {\n\tdisplay: inline-flex;\n}\n\n${resetInputFieldDefaultWidth()}\n\n.wrapper {\n\tdisplay: flex;\n\tbox-sizing: border-box;\n}\nvaadin-text-field {\n\tposition: relative;\n\tpadding: 0;\n\tdisplay: inline-flex;\n\talign-items: flex-start;\n}\nvaadin-text-field::before {\n content: unset;\n}\nvaadin-text-field::part(label) {\n position: absolute;\n top: 0;\n}\nvaadin-text-field::part(input-field) {\n\tpadding: 0;\n\tbackground: none;\n\tmin-height: 0;\n}\nvaadin-text-field::part(input-field)::after {\n background: none;\n}\nvaadin-text-field[focus-ring]::part(input-field) {\n\tbox-shadow: none;\n}\n\nvaadin-checkbox [slot=\"label\"] {\n align-self: flex-start;\n padding: 0;\n}\n[required] vaadin-checkbox [slot=\"label\"]:not(:empty) {\n\tpadding-inline-end: 1em;\n}\ndescope-boolean-field-internal {\n -webkit-mask-image: none;\n min-height: initial;\n}\n\ndescope-enriched-text[empty] {\n\t${EnrichedTextClass.cssVarList.hostDisplay}: none;\n}\n\ndescope-enriched-text {\n\t${EnrichedTextClass.cssVarList.hostDirection}: var(${cssVarList.hostDirection});\n}\n\n`;\n","import { createBaseInputClass } from '../../../baseClasses/createBaseInputClass';\nimport { forwardAttrs, getComponentName, syncAttrs } from '../../../helpers/componentHelpers';\n\nexport const componentName = getComponentName('boolean-field-internal');\n\nconst forwardAttributes = ['disabled', 'invalid', 'readonly'];\n\nconst BaseInputClass = createBaseInputClass({ componentName, baseSelector: 'div' });\n\nclass BooleanInputInternal extends BaseInputClass {\n static get observedAttributes() {\n return ['readonly', 'label'];\n }\n\n constructor() {\n super();\n this.innerHTML = `\n\t\t\t<div class=\"wrapper\">\n\t\t\t\t<vaadin-checkbox>\n\t\t\t\t\t<descope-enriched-text link-target-blank=\"true\" class=\"label-content\" slot=\"label\"></descope-enriched-text>\n\t\t\t\t</vaadin-checkbox>\n\t\t\t</div>\n\t\t`;\n this.wrapperEle = this.querySelector('div');\n this.checkbox = this.querySelector('vaadin-checkbox');\n this.labelContent = this.querySelector('.label-content');\n }\n\n get value() {\n return this.checkbox?.checked;\n }\n\n set value(val) {\n this.checkbox.checked = val;\n }\n\n get checked() {\n return this.value;\n }\n\n set checked(val) {\n this.value = val;\n }\n\n init() {\n this.addEventListener('focus', (e) => {\n if (e.isTrusted) {\n this.checkbox.focus();\n }\n });\n super.init?.();\n\n forwardAttrs(this, this.checkbox, { includeAttrs: forwardAttributes });\n syncAttrs(this, this.checkbox, { includeAttrs: ['checked'] });\n\n // Handle label click to toggle checkbox\n this.labelContent.addEventListener('click', (e) => {\n if (!this.hasAttribute('disabled') && !this.hasAttribute('readonly')) {\n this.checkbox.click();\n }\n });\n\n // we need it in order to set the focus ring and trigger validation on descope-checkbox\n this.handleFocusEventsDispatching([this.checkbox]);\n }\n\n attributeChangedCallback(attrName, oldValue, newValue) {\n super.attributeChangedCallback?.(attrName, oldValue, newValue);\n\n if (attrName === 'readonly') {\n this.onReadOnlyChange(newValue !== null);\n }\n\n if (attrName === 'label') {\n this.onLabelChange();\n }\n }\n\n onLabelChange() {\n const labelValue = this.getAttribute('label');\n if (labelValue) {\n this.labelContent.textContent = labelValue;\n } else {\n this.labelContent.textContent = '';\n }\n }\n\n onReadOnlyChange(val) {\n this.baseElement.setAttribute('inert', val);\n }\n\n getValidity() {\n if (this.isRequired && !this.value) {\n return { valueMissing: true };\n }\n return {};\n }\n}\n\nexport default BooleanInputInternal;\n","import BooleanFieldInternal, { componentName } from './BooleanFieldInternal';\n\ncustomElements.define(componentName, BooleanFieldInternal);\n","import { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { getComponentName } from '../../../helpers/componentHelpers';\nimport { compose } from '../../../helpers';\nimport {\n createStyleMixin,\n proxyInputMixin,\n draggableMixin,\n componentNameValidationMixin,\n createProxy,\n} from '../../../mixins';\nimport { booleanFieldMixin } from '../booleanFieldMixin';\nimport commonStyles from '../commonStyles';\nimport { useHostExternalPadding } from '../../../helpers/themeHelpers/resetHelpers';\n\nexport const componentName = getComponentName('switch-toggle');\n\nconst {\n host,\n component,\n checkboxElement: track,\n checkboxSurface: knob,\n checkboxLabel,\n requiredIndicator,\n helperText,\n errorMessage,\n} = {\n host: { selector: () => ':host' },\n requiredIndicator: {\n selector: '[required] vaadin-checkbox [slot=\"label\"]:not(:empty)::part(content)::after',\n },\n component: { selector: 'vaadin-checkbox' },\n checkboxElement: { selector: 'vaadin-checkbox::part(checkbox)' },\n checkboxSurface: { selector: 'vaadin-checkbox::part(checkbox)::after' },\n checkboxLabel: { selector: 'vaadin-checkbox [slot=\"label\"]:not(:empty)' },\n helperText: { selector: '::part(helper-text)' },\n errorMessage: { selector: '::part(error-message)' },\n};\n\nexport const SwitchToggleClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { ...host, property: 'width' },\n hostDirection: { ...host, property: 'direction' },\n\n fontSize: [component, checkboxLabel, checkboxLabel],\n fontFamily: [checkboxLabel, helperText, errorMessage],\n\n labelTextColor: [\n { ...checkboxLabel, property: 'color' },\n { ...checkboxLabel, property: '-webkit-text-fill-color' },\n ],\n labelSpacing: { ...checkboxLabel, property: 'padding-inline-start' },\n labelLineHeight: { ...checkboxLabel, property: 'line-height' },\n labelFontWeight: { ...checkboxLabel, property: 'font-weight' },\n labelRequiredIndicator: { ...requiredIndicator, property: 'content' },\n\n errorMessageTextColor: { ...errorMessage, property: 'color' },\n\n errorMessageIcon: { ...errorMessage, property: 'background-image' },\n errorMessageIconSize: { ...errorMessage, property: 'background-size' },\n errorMessageIconPadding: { ...errorMessage, property: 'padding-inline-start' },\n errorMessageIconRepeat: { ...errorMessage, property: 'background-repeat' },\n errorMessageIconPosition: { ...errorMessage, property: 'background-position' },\n errorMessageFontSize: { ...errorMessage, property: 'font-size' },\n\n trackBorderWidth: { ...track, property: 'border-width' },\n trackBorderStyle: { ...track, property: 'border-style' },\n trackBorderColor: { ...track, property: 'border-color' },\n trackBackgroundColor: { ...track, property: 'background-color' },\n trackBorderRadius: { ...track, property: 'border-radius' },\n trackWidth: [{ ...track, property: 'width' }],\n trackHeight: [\n { ...knob, property: 'font-size' },\n { ...track, property: 'height' },\n ],\n\n knobSize: [\n { ...knob, property: 'width' },\n { ...knob, property: 'height' },\n ],\n knobTextColor: { ...knob, property: 'color' },\n knobRadius: { ...knob, property: 'border-radius' },\n knobTransitionDuration: { ...knob, property: 'transition' },\n knobColor: { ...knob, property: 'background-color' },\n knobTopOffset: { ...knob, property: 'top' },\n knobLeftOffset: { ...knob, property: 'left' },\n\n inputOutlineWidth: { ...track, property: 'outline-width' },\n inputOutlineOffset: { ...track, property: 'outline-offset' },\n inputOutlineColor: { ...track, property: 'outline-color' },\n inputOutlineStyle: { ...track, property: 'outline-style' },\n },\n }),\n draggableMixin,\n proxyInputMixin({ proxyProps: ['value', 'selectionStart'] }),\n componentNameValidationMixin,\n booleanFieldMixin\n)(\n createProxy({\n slots: [],\n wrappedEleName: 'vaadin-text-field',\n style: () => `\n\t\t\t${commonStyles(SwitchToggleClass.cssVarList)}\n\t\t\t${useHostExternalPadding(SwitchToggleClass.cssVarList)}\n\n :host {\n\t\t\t\tdisplay: inline-flex;\n\t\t\t\tmax-width: 100%;\n }\n\n :host ::part(error-message) {\n direction: ltr;\n }\n\n vaadin-text-field {\n width: 100%;\n }\n\n vaadin-text-field::part(input-field)::after {\n content: none;\n }\n\n descope-boolean-field-internal {\n\t\t\t\tpadding: 0;\n width: 100%;\n }\n\n vaadin-text-field::part(input-field) {\n cursor: pointer;\n }\n\n vaadin-checkbox {\n cursor: pointer;\n }\n\n vaadin-checkbox [slot=\"label\"]:not(:empty) {\n cursor: pointer;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox) {\n margin: 0;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::before {\n content: '';\n\t\t\t}\n\n vaadin-checkbox[active]::part(checkbox) {\n\t\t\t\ttransform: none;\n\t\t\t}\n\n vaadin-checkbox::part(checkbox)::after {\n\t\t\t\tposition: absolute;\n\t\t\t\topacity: 1;\n\t\t\t\tcontent: '';\n\t\t\t}\n\t\t`,\n excludeAttrsSync: ['label', 'tabindex', 'style'],\n componentName,\n })\n);\n","import { componentName, SwitchToggleClass } from './SwitchToggleClass';\nimport '@vaadin/checkbox';\nimport '@vaadin/text-field';\nimport '@descope-ui/descope-enriched-text';\nimport '../descope-boolean-field-internal';\n\ncustomElements.define(componentName, SwitchToggleClass);\n\nexport { SwitchToggleClass, componentName };\n","/**\n * @license\n * Copyright (c) 2021 - 2023 Vaadin Ltd.\n * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/\n */\nimport { SlotController } from '@vaadin/component-base/src/slot-controller.js';\n\n/**\n * A controller to create and initialize slotted `<input>` element.\n */\nexport class InputController extends SlotController {\n constructor(host, callback) {\n super(host, 'input', 'input', {\n initializer: (node, host) => {\n if (host.value) {\n node.value = host.value;\n }\n if (host.type) {\n node.setAttribute('type', host.type);\n }\n\n // Ensure every instance has unique ID\n node.id = this.defaultId;\n\n if (typeof callback === 'function') {\n callback(node);\n }\n },\n useUniqueId: true,\n });\n }\n}\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_6__","xE","EnrichedText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_4__","qu","baseSelector","origLinkRenderer","origEmRenderer","constructor","super","this","attachShadow","mode","innerHTML","fz","initProcessor","Ge","parseChildren","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","key","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","customizeLinkRenderer","linkTargetBlank","link_open","attrSet","disableCustomRules","disable","_consts__WEBPACK_IMPORTED_MODULE_3__","M","updateProcessorRules","storeOrigRenderers","_","renderToken","markdown_it__WEBPACK_IMPORTED_MODULE_0__","A","html","getAttribute","shadowRoot","querySelector","_helpers__WEBPACK_IMPORTED_MODULE_5__","G","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_2__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_1__","RF","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","DM","triggers","attr","value","VO","tQ","disableRules","decodeHTML","textArea","document","createElement","customElements","define","_EnrichedTextClass__WEBPACK_IMPORTED_MODULE_1__","T","m","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","observedAttrs","RawLink","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","concat","anchor","EA","includeAttrs","mapAttrs","tooltip","readOnly","preventDefault","selectors","host","link","wrapper","text","_descope_ui_descope_text_class__WEBPACK_IMPORTED_MODULE_4__","s","LinkClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","textDecoration","cssVarList","cursor","_LinkClass__WEBPACK_IMPORTED_MODULE_0__","J","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","TextClass","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","_TextClass__WEBPACK_IMPORTED_MODULE_0__","createBaseInputClass","args","_helpers__WEBPACK_IMPORTED_MODULE_0__","_mixins__WEBPACK_IMPORTED_MODULE_1__","XX","_$","yF","jd","_createBaseClass__WEBPACK_IMPORTED_MODULE_2__","q","booleanFieldMixin","superclass","template","_descope_boolean_field_internal_BooleanFieldInternal__WEBPACK_IMPORTED_MODULE_1__","baseElement","appendChild","content","cloneNode","inputElement","checkbox","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_0__","Gh","__WEBPACK_DEFAULT_EXPORT__","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_1__","X6","_descope_ui_descope_enriched_text_class__WEBPACK_IMPORTED_MODULE_0__","_helpers_componentHelpers__WEBPACK_IMPORTED_MODULE_1__","forwardAttributes","BaseInputClass","_baseClasses_createBaseInputClass__WEBPACK_IMPORTED_MODULE_0__","y","wrapperEle","labelContent","checked","val","isTrusted","focus","hasAttribute","click","handleFocusEventsDispatching","onLabelChange","labelValue","textContent","getValidity","isRequired","valueMissing","_BooleanFieldInternal__WEBPACK_IMPORTED_MODULE_0__","component","checkboxElement","track","checkboxSurface","knob","checkboxLabel","requiredIndicator","helperText","errorMessage","SwitchToggleClass","_helpers__WEBPACK_IMPORTED_MODULE_2__","_mixins__WEBPACK_IMPORTED_MODULE_3__","labelTextColor","labelSpacing","labelLineHeight","labelFontWeight","labelRequiredIndicator","errorMessageTextColor","errorMessageIcon","errorMessageIconSize","errorMessageIconPadding","errorMessageIconRepeat","errorMessageIconPosition","errorMessageFontSize","trackBorderWidth","trackBorderStyle","trackBorderColor","trackBackgroundColor","trackBorderRadius","trackWidth","trackHeight","knobSize","knobTextColor","knobRadius","knobTransitionDuration","knobColor","knobTopOffset","knobLeftOffset","inputOutlineWidth","inputOutlineOffset","inputOutlineColor","inputOutlineStyle","OZ","proxyProps","_booleanFieldMixin__WEBPACK_IMPORTED_MODULE_4__","tz","slots","wrappedEleName","_commonStyles__WEBPACK_IMPORTED_MODULE_5__","_helpers_themeHelpers_resetHelpers__WEBPACK_IMPORTED_MODULE_6__","cy","excludeAttrsSync","_SwitchToggleClass__WEBPACK_IMPORTED_MODULE_0__","H","InputController","_vaadin_component_base_src_slot_controller_js__WEBPACK_IMPORTED_MODULE_0__","r","callback","initializer","node","type","id","defaultId","useUniqueId"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1456,2294,4159,9261],{76231(t,e,n){n.d(e,{T:()=>
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[1456,2294,4159,9261],{76231(t,e,n){n.d(e,{T:()=>d,m:()=>p});var r=n(92540),o=n(88961),s=n(63200),i=n(36976),l=n(72270),a=n(54847),h=n(25964);const d=(0,h.xE)("enriched-text");class c extends((0,l.qu)({componentName:d,baseSelector:":host > div"})){#t;#e;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,h.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.#n(),(0,h.Ge)(this,this.#r.bind(this)),this.contentNode?.addEventListener("click",t=>{t.target instanceof HTMLAnchorElement&&t.stopPropagation()}),this.contentNode?.addEventListener("keydown",t=>{"Enter"===t.key&&t.target instanceof HTMLAnchorElement&&t.stopPropagation()})}static get observedAttributes(){return["readonly","link-target-blank"]}attributeChangedCallback(t,e,n){super.attributeChangedCallback?.(t,e,n),n!==e&&("readonly"===t&&this.onReadOnlyChange("true"===n),"link-target-blank"===t&&this.#n())}customUnderlineRenderer(){this.processor.renderer.rules.em_open=(t,e,n,r,o)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,r,o)),this.processor.renderer.rules.em_close=(t,e,n,r,o)=>("_"===t[e].markup&&(t[e].tag="u"),this.#e(t,e,n,r,o))}#o(){this.linkTargetBlank?this.processor.renderer.rules.link_open=(t,e,n,r,o)=>(t[e].attrSet("target","_blank"),this.#t(t,e,n,r,o)):this.processor.renderer.rules.link_open=this.#t}#s(){this.processor&&this.processor.disable(i.M)}#i(){this.#s()}#l(){this.#t=this.processor.renderer.rules.link_open||((t,e,n,r,o)=>o.renderToken(t,e,n)),this.#e=this.processor.renderer.rules.em_open||((t,e,n,r,o)=>o.renderToken(t,e,n))}#n(){this.processor=new r.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")}#r(){if(!this.processor)return;let t=(0,a.G)(this.innerHTML);!t?.trim()&&this.isConnected?this.setAttribute("empty","true"):this.removeAttribute("empty");try{const e=this.processor.parse(t,{references:void 0});t=this.processor.renderer.render(e,{html:!0,breaks:!0})}catch{console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=t,this.contentNode.firstChild?.setAttribute("part","content")}onReadOnlyChange(t){t?this.contentNode.setAttribute("inert",t):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,h.xE)("link")}),(0,o.RF)({componentNameOverride:(0,h.xE)("text")}),(0,o.DM)({triggers:[{attr:"full-width",value:"true"}]}),o.VO,o.tQ)(c)},36976(t,e,n){n.d(e,{M:()=>r});const r=["blockquote","list","image","table","code","hr","backticks","fence","reference","heading","lheading","html_block"]},54847(t,e,n){n.d(e,{G:()=>r});const r=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value}},55838(t,e,n){n.r(e),n.d(e,{EnrichedTextClass:()=>r.m,componentName:()=>r.T}),n(90512);var r=n(76231);customElements.define(r.T,r.m)},75464(t,e,n){n.d(e,{J:()=>x,T:()=>a});var r=n(88961),o=n(63200),s=n(25964),i=n(72270),l=n(66434);const a=(0,s.xE)("link"),h=["href","readonly"];class d extends((0,i.qu)({componentName:a,baseSelector:":host a"})){static get observedAttributes(){return h.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\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\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,s.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",t=>{this.readOnly&&t.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const c={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:p,text:m,host:u,wrapper:g,link:y}=c,x=(0,o.Zz)((0,r.RF)({mappings:{hostWidth:{...u,property:"width"},hostDirection:{...m,property:"direction"},textAlign:g,textDecoration:{...y,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...m,property:l.s.cssVarList.textColor}],cursor:p}}),(0,r.DM)({triggers:[{attr:"full-width",value:"true"}]}),r.VO,r.tQ)(d)},90512(t,e,n){n.r(e),n.d(e,{LinkClass:()=>r.J,componentName:()=>r.T});var r=n(75464);n(63595),customElements.define(r.T,r.J)},66434(t,e,n){n.d(e,{T:()=>l,s:()=>d});var r=n(88961),o=n(63200),s=n(25964),i=n(72270);const l=(0,s.xE)("text");class a 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 t=!!this.childNodes.length;this.style.display=!t&&this.hideWhenEmpty?"none":""})}}const{host:h}={host:{selector:()=>":host"}},d=(0,o.Zz)((0,r.RF)({mappings:{hostWidth:{...h,property:"width"},hostDirection:{...h,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),(0,r.DM)({triggers:[{attr:"full-width",value:"true"}]}),r.VO,r.tQ)(a)},63595(t,e,n){n.r(e),n.d(e,{TextClass:()=>r.s,componentName:()=>r.T});var r=n(66434);customElements.define(r.T,r.s)},11339(t,e,n){n.r(e),n.d(e,{AlertClass:()=>p,componentName:()=>h}),n(55838);var r=n(76231),o=n(25964),s=n(79365),i=n(9696),l=n(97810),a=n(81365);const h=(0,l.xE)("alert");class d extends((0,a.q)({componentName:h,baseSelector:":host > div"})){constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div>\n <div class="icon"></div>\n <div class="content">\n <descope-enriched-text>\n <slot></slot>\n </descope-enriched-text>\n </div>\n </div>\n ',(0,o.fz)('\n :host {\n display: inline-flex;\n }\n :host > div {\n display: flex;\n width: 100%;\n }\n :host([empty="true"]) {\n display: none;\n }\n .icon {\n flex-shrink: 0;\n }\n .content {\n display: flex;\n flex-wrap: wrap;\n white-space: normal;\n overflow-wrap: break-word;\n }\n ',this)}init(){super.init?.(),this.slotEle=this.shadowRoot.querySelector("slot"),this.textComp=this.shadowRoot.querySelector("descope-enriched-text"),this.slotEle.addEventListener("slotchange",this.handleSlotChange.bind(this)),(0,o.Gh)(this.textComp,this,{includeAttrs:["empty"]}),(0,o.Ge)(this,this.handleChildrenChange.bind(this)),(0,l.EA)(this,this.textComp,{includeAttrs:["variant","full-width","link-target-blank"]})}handleChildrenChange(){this.textComp.textContent=this.textContent}handleSlotChange(){const t=this.slotEle.assignedNodes({flatten:!0});t.length&&(this.textComp.textContent=t[0]?.textContent||"")}}const{icon:c}={icon:{selector:()=>".icon"}},p=(0,i.Zz)((0,s.RF)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},textColor:{selector:r.m.componentName,property:r.m.cssVarList.textColor},backgroundColor:{},borderColor:{},borderWidth:{},borderStyle:{},borderRadius:{},fontSize:[{},{selector:r.m.componentName,property:r.m.cssVarList.fontSize}],gap:{},horizontalPadding:[{property:"padding-top"},{property:"padding-bottom"}],verticalPadding:[{property:"padding-right"},{property:"padding-left"}],alignItems:{},justifyContent:[{},{selector:r.m.componentName,property:r.m.cssVarList.textAlign}],icon:[{...c,property:"content"},{...c,property:"display",fallback:"none"}],iconSize:[{...c,property:"width"},{...c,property:"height"}]}}),(0,s.RF)({componentNameOverride:(0,l.xE)("enriched-text")}),(0,s.RF)({componentNameOverride:(0,l.xE)("text")}),s.VO,s.tQ)(d);customElements.define(h,p)}}]);
|
|
2
2
|
//# sourceMappingURL=descope-alert-index-js.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"descope-alert-index-js.js","mappings":"+PAiBO,M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AAU0F,EAAA1F,SAAA,UAAAE,SAAA,SAEVmG,SAAA,CACA,IAAUX,EAAA1F,SAAA,SACV,IAAU0F,EAAA1F,SAAA,eAIR,EAAA6F,EAAAjG,IAAgB,CAAGoB,uBAAuB,EAAA6D,EAAAjK,IAAgB,oBAC1D,EAAAiL,EAAAjG,IAAgB,CAAGoB,uBAAuB,EAAA6D,EAAAjK,IAAgB,UAC1DiL,EAAAxE,GACAwE,EAAAvE,GA7CwB,CA8C1BwD,GC7HAlD,eAAAC,OAAsBnH,EAAeiL","sources":["webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js","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-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/./src/components/descope-alert/AlertClass.js","webpack://@descope/web-components-ui/./src/components/descope-alert/index.js"],"sourcesContent":["import MarkdownIt from 'markdown-it';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} 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 {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({\n componentName,\n baseSelector: ':host > div',\n}) {\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 // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 =\n this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer =\n 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, {\n html: true,\n breaks: true,\n });\n } catch {\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstChild?.setAttribute('part', 'content');\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: {\n selector: () => ':host',\n property: 'display',\n fallback: 'inline-block',\n },\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: {\n selector: 'a:hover',\n property: 'text-decoration',\n },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(EnrichedText);\n","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 {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\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 :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\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 this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\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: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\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","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { injectStyle, observeChildren, syncAttrs } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\n\nexport const componentName = getComponentName('alert');\n\nclass RawAlert extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <div class=\"icon\"></div>\n <div class=\"content\">\n <descope-enriched-text>\n <slot></slot>\n </descope-enriched-text>\n </div>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n }\n :host > div {\n display: flex;\n width: 100%;\n }\n :host([empty=\"true\"]) {\n display: none;\n }\n .icon {\n flex-shrink: 0;\n }\n .content {\n display: flex;\n flex-wrap: wrap;\n white-space: normal;\n overflow-wrap: break-word;\n }\n `,\n this\n );\n }\n\n init() {\n super.init?.();\n\n this.slotEle = this.shadowRoot.querySelector('slot');\n this.textComp = this.shadowRoot.querySelector('descope-enriched-text');\n\n this.slotEle.addEventListener('slotchange', this.handleSlotChange.bind(this));\n\n syncAttrs(this.textComp, this, { includeAttrs: ['empty'] });\n\n observeChildren(this, this.handleChildrenChange.bind(this));\n\n forwardAttrs(this, this.textComp, {\n includeAttrs: ['variant', 'full-width', 'link-target-blank'],\n });\n }\n\n handleChildrenChange() {\n this.textComp.textContent = this.textContent;\n }\n\n handleSlotChange() {\n const assignedNodes = this.slotEle.assignedNodes({ flatten: true });\n if (!assignedNodes.length) return;\n this.textComp.textContent = assignedNodes[0]?.textContent || '';\n }\n}\n\nconst { icon } = {\n icon: { selector: () => '.icon' },\n};\n\nexport const AlertClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n textColor: {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.textColor,\n },\n backgroundColor: {},\n borderColor: {},\n borderWidth: {},\n borderStyle: {},\n borderRadius: {},\n fontSize: [\n {},\n {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.fontSize,\n },\n ],\n gap: {},\n horizontalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],\n verticalPadding: [{ property: 'padding-right' }, { property: 'padding-left' }],\n alignItems: {},\n justifyContent: [\n {},\n {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.textAlign,\n },\n ],\n icon: [\n { ...icon, property: 'content' },\n { ...icon, property: 'display', fallback: 'none' },\n ],\n iconSize: [\n { ...icon, property: 'width' },\n { ...icon, property: 'height' },\n ],\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('enriched-text') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(RawAlert);\n","import '@descope-ui/descope-enriched-text';\nimport { componentName, AlertClass } from './AlertClass';\n\ncustomElements.define(componentName, AlertClass);\n\nexport { AlertClass, componentName };\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_6__","xE","EnrichedText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_4__","qu","baseSelector","origLinkRenderer","origEmRenderer","constructor","super","this","attachShadow","mode","innerHTML","fz","initProcessor","Ge","parseChildren","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","customizeLinkRenderer","linkTargetBlank","link_open","attrSet","disableCustomRules","disable","_consts__WEBPACK_IMPORTED_MODULE_3__","M","updateProcessorRules","storeOrigRenderers","_","renderToken","markdown_it__WEBPACK_IMPORTED_MODULE_0__","A","html","getAttribute","shadowRoot","querySelector","_helpers__WEBPACK_IMPORTED_MODULE_5__","G","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_2__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_1__","RF","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","DM","triggers","attr","value","VO","tQ","disableRules","decodeHTML","textArea","document","createElement","customElements","define","_EnrichedTextClass__WEBPACK_IMPORTED_MODULE_1__","T","m","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","observedAttrs","RawLink","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","concat","anchor","EA","includeAttrs","mapAttrs","tooltip","readOnly","preventDefault","selectors","host","link","wrapper","text","_descope_ui_descope_text_class__WEBPACK_IMPORTED_MODULE_4__","s","LinkClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","textDecoration","cssVarList","cursor","_LinkClass__WEBPACK_IMPORTED_MODULE_0__","J","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","TextClass","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","_TextClass__WEBPACK_IMPORTED_MODULE_0__","componentHelpers","RawAlert","createBaseClass","q","componentsHelpers","slotEle","textComp","handleSlotChange","Gh","handleChildrenChange","textContent","assignedNodes","flatten","icon","AlertClass","helpers","mixins","backgroundColor","borderRadius","gap","horizontalPadding","verticalPadding","alignItems","justifyContent","iconSize"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"descope-alert-index-js.js","mappings":"+PAiBO,MAAAA,GAAsB,EAAAC,EAAAC,IAAgB,iBAE7C,MAAAC,WAA2B,EAAAC,EAAAC,IAAe,CAC1CL,gBACAM,aAAA,iBAEAC,GAEAC,GAEA,WAAAC,GACAC,QAEAC,KAAAC,aAAA,CAAwBC,KAAA,SAAcC,UAAA,2CAIlC,EAAAb,EAAAc,IACJ,6iBAkCAJ,MAGAA,MAAAK,KAEI,EAAAf,EAAAgB,IAAeN,KAAAA,MAAAO,EAAAC,KAAAR,OAGnBA,KAAAS,aAAAC,iBAAA,QAAAC,IACAA,EAAAC,kBAAAC,mBACAF,EAAA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,EAAAvE,GA7CwB,CA8C1BwD,GC7HAlD,eAAAC,OAAsBpH,EAAekL","sources":["webpack://@descope/web-components-ui/../components/descope-enriched-text/src/component/EnrichedTextClass.js","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-link/src/component/LinkClass.js","webpack://@descope/web-components-ui/../components/descope-link/src/component/index.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/TextClass.js","webpack://@descope/web-components-ui/../components/descope-text/src/component/index.js","webpack://@descope/web-components-ui/./src/components/descope-alert/AlertClass.js","webpack://@descope/web-components-ui/./src/components/descope-alert/index.js"],"sourcesContent":["import MarkdownIt from 'markdown-it';\nimport {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\n} 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 {\n getComponentName,\n injectStyle,\n observeChildren,\n} from '@descope-ui/common/components-helpers';\n\nexport const componentName = getComponentName('enriched-text');\n\nclass EnrichedText extends createBaseClass({\n componentName,\n baseSelector: ':host > div',\n}) {\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 // Stop propagation on link clicks to prevent parent handlers from firing\n this.contentNode?.addEventListener('click', (e) => {\n if (e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\n\n // The SDK submits the form (and prevents link activation) on any Enter that reaches the flow root\n this.contentNode?.addEventListener('keydown', (e) => {\n if (e.key === 'Enter' && e.target instanceof HTMLAnchorElement) {\n e.stopPropagation();\n }\n });\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 = (\n tokens,\n idx,\n options,\n env,\n self,\n ) => {\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 =\n this.processor.renderer.rules.link_open || defaultLinkRenderer;\n\n const defaultStrongRenderer = (tokens, idx, options, _, self) =>\n self.renderToken(tokens, idx, options);\n this.#origEmRenderer =\n 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, {\n html: true,\n breaks: true,\n });\n } catch {\n console.warn('Not parsing invalid markdown token');\n }\n\n this.contentNode.innerHTML = html;\n this.contentNode.firstChild?.setAttribute('part', 'content');\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: {\n selector: () => ':host',\n property: 'display',\n fallback: 'inline-block',\n },\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: {\n selector: 'a:hover',\n property: 'text-decoration',\n },\n minHeight: {},\n minWidth: {},\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('link') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(EnrichedText);\n","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 {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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\nconst observedAttrs = ['href', 'readonly'];\n\nclass RawLink extends createBaseClass({\n componentName,\n baseSelector: ':host a',\n}) {\n static get observedAttributes() {\n return observedAttrs.concat(super.observedAttributes || []);\n }\n\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n\t\t<div>\n\t\t\t<descope-text part=\"wrapper\">\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 :host([ellipsis=\"true\"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis=\"true\"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n `,\n this,\n );\n\n this.anchor = this.shadowRoot.querySelector('a');\n\n forwardAttrs(this, this.anchor, {\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 this.anchor.addEventListener('click', (e) => {\n if (this.readOnly) {\n e.preventDefault();\n }\n });\n }\n\n get readOnly() {\n return this.getAttribute('readonly') === 'true';\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: {\n ...link,\n property: 'text-decoration',\n fallback: 'none',\n },\n textColor: [\n { ...anchor, property: 'color' },\n { ...text, property: TextClass.cssVarList.textColor },\n ],\n cursor: anchor,\n },\n }),\n stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\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","import {\n createStyleMixin,\n draggableMixin,\n componentNameValidationMixin,\n stretchMixin,\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 `\n :host {\n display: inline-block;\n line-height: 1em;\n }\n :host > slot {\n width: 100%;\n display: inline-block;\n }\n `,\n this,\n );\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: [{ property: 'color' }],\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 stretchMixin({ triggers: [{ attr: 'full-width', value: 'true' }] }),\n draggableMixin,\n componentNameValidationMixin,\n)(RawText);\n","import { componentName, TextClass } from './TextClass';\n\ncustomElements.define(componentName, TextClass);\n\nexport { TextClass, componentName };\n","import { EnrichedTextClass } from '@descope-ui/descope-enriched-text/class';\nimport { injectStyle, observeChildren, syncAttrs } from '@descope-ui/common/components-helpers';\nimport { createStyleMixin, draggableMixin, componentNameValidationMixin } from '../../mixins';\nimport { compose } from '../../helpers';\nimport { forwardAttrs, getComponentName } from '../../helpers/componentHelpers';\nimport { createBaseClass } from '../../baseClasses/createBaseClass';\n\nexport const componentName = getComponentName('alert');\n\nclass RawAlert extends createBaseClass({ componentName, baseSelector: ':host > div' }) {\n constructor() {\n super();\n\n this.attachShadow({ mode: 'open' }).innerHTML = `\n <div>\n <div class=\"icon\"></div>\n <div class=\"content\">\n <descope-enriched-text>\n <slot></slot>\n </descope-enriched-text>\n </div>\n </div>\n `;\n\n injectStyle(\n `\n :host {\n display: inline-flex;\n }\n :host > div {\n display: flex;\n width: 100%;\n }\n :host([empty=\"true\"]) {\n display: none;\n }\n .icon {\n flex-shrink: 0;\n }\n .content {\n display: flex;\n flex-wrap: wrap;\n white-space: normal;\n overflow-wrap: break-word;\n }\n `,\n this\n );\n }\n\n init() {\n super.init?.();\n\n this.slotEle = this.shadowRoot.querySelector('slot');\n this.textComp = this.shadowRoot.querySelector('descope-enriched-text');\n\n this.slotEle.addEventListener('slotchange', this.handleSlotChange.bind(this));\n\n syncAttrs(this.textComp, this, { includeAttrs: ['empty'] });\n\n observeChildren(this, this.handleChildrenChange.bind(this));\n\n forwardAttrs(this, this.textComp, {\n includeAttrs: ['variant', 'full-width', 'link-target-blank'],\n });\n }\n\n handleChildrenChange() {\n this.textComp.textContent = this.textContent;\n }\n\n handleSlotChange() {\n const assignedNodes = this.slotEle.assignedNodes({ flatten: true });\n if (!assignedNodes.length) return;\n this.textComp.textContent = assignedNodes[0]?.textContent || '';\n }\n}\n\nconst { icon } = {\n icon: { selector: () => '.icon' },\n};\n\nexport const AlertClass = compose(\n createStyleMixin({\n mappings: {\n hostWidth: { selector: () => ':host', property: 'width' },\n hostDirection: { selector: () => ':host', property: 'direction' },\n textColor: {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.textColor,\n },\n backgroundColor: {},\n borderColor: {},\n borderWidth: {},\n borderStyle: {},\n borderRadius: {},\n fontSize: [\n {},\n {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.fontSize,\n },\n ],\n gap: {},\n horizontalPadding: [{ property: 'padding-top' }, { property: 'padding-bottom' }],\n verticalPadding: [{ property: 'padding-right' }, { property: 'padding-left' }],\n alignItems: {},\n justifyContent: [\n {},\n {\n selector: EnrichedTextClass.componentName,\n property: EnrichedTextClass.cssVarList.textAlign,\n },\n ],\n icon: [\n { ...icon, property: 'content' },\n { ...icon, property: 'display', fallback: 'none' },\n ],\n iconSize: [\n { ...icon, property: 'width' },\n { ...icon, property: 'height' },\n ],\n },\n }),\n createStyleMixin({ componentNameOverride: getComponentName('enriched-text') }),\n createStyleMixin({ componentNameOverride: getComponentName('text') }),\n draggableMixin,\n componentNameValidationMixin\n)(RawAlert);\n","import '@descope-ui/descope-enriched-text';\nimport { componentName, AlertClass } from './AlertClass';\n\ncustomElements.define(componentName, AlertClass);\n\nexport { AlertClass, componentName };\n"],"names":["componentName","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_6__","xE","EnrichedText","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_4__","qu","baseSelector","origLinkRenderer","origEmRenderer","constructor","super","this","attachShadow","mode","innerHTML","fz","initProcessor","Ge","parseChildren","bind","contentNode","addEventListener","e","target","HTMLAnchorElement","stopPropagation","key","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","onReadOnlyChange","customUnderlineRenderer","processor","renderer","rules","em_open","tokens","idx","options","env","self","markup","tag","em_close","customizeLinkRenderer","linkTargetBlank","link_open","attrSet","disableCustomRules","disable","_consts__WEBPACK_IMPORTED_MODULE_3__","M","updateProcessorRules","storeOrigRenderers","_","renderToken","markdown_it__WEBPACK_IMPORTED_MODULE_0__","A","html","getAttribute","shadowRoot","querySelector","_helpers__WEBPACK_IMPORTED_MODULE_5__","G","trim","isConnected","setAttribute","removeAttribute","parse","references","undefined","render","breaks","console","warn","firstChild","isReadOnly","EnrichedTextClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_2__","Zz","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_1__","RF","mappings","hostWidth","selector","property","hostDisplay","fallback","hostDirection","fontSize","fontFamily","fontWeight","fontWeightBold","textColor","textLineHeight","textAlign","linkColor","linkTextDecoration","linkHoverTextDecoration","minHeight","minWidth","componentNameOverride","DM","triggers","attr","value","VO","tQ","disableRules","decodeHTML","textArea","document","createElement","customElements","define","_EnrichedTextClass__WEBPACK_IMPORTED_MODULE_1__","T","m","_descope_ui_common_components_helpers__WEBPACK_IMPORTED_MODULE_2__","observedAttrs","RawLink","_descope_ui_common_base_classes__WEBPACK_IMPORTED_MODULE_3__","concat","anchor","EA","includeAttrs","mapAttrs","tooltip","readOnly","preventDefault","selectors","host","link","wrapper","text","_descope_ui_descope_text_class__WEBPACK_IMPORTED_MODULE_4__","s","LinkClass","_descope_ui_common_utils__WEBPACK_IMPORTED_MODULE_1__","_descope_ui_common_components_mixins__WEBPACK_IMPORTED_MODULE_0__","textDecoration","cssVarList","cursor","_LinkClass__WEBPACK_IMPORTED_MODULE_0__","J","RawText","hideWhenEmpty","init","hasChildren","childNodes","length","style","display","TextClass","textLetterSpacing","textShadow","textTransform","fontStyle","borderWidth","borderStyle","borderColor","_TextClass__WEBPACK_IMPORTED_MODULE_0__","componentHelpers","RawAlert","createBaseClass","q","componentsHelpers","slotEle","textComp","handleSlotChange","Gh","handleChildrenChange","textContent","assignedNodes","flatten","icon","AlertClass","helpers","mixins","backgroundColor","borderRadius","gap","horizontalPadding","verticalPadding","alignItems","justifyContent","iconSize"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159,9261],{76231(e,t,r){r.d(t,{T:()=>c,m:()=>p});var n=r(92540),o=r(88961),s=r(63200),i=r(36976),l=r(72270),a=r(54847),h=r(25964);const c=(0,h.xE)("enriched-text");class d extends((0,l.qu)({componentName:c,baseSelector:":host > div"})){#e;#t;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,h.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,h.Ge)(this,this.#n.bind(this)),this.contentNode?.addEventListener("click",e=>{e.target instanceof HTMLAnchorElement&&e.stopPropagation()})}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,a.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{console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=e,this.contentNode.firstChild?.setAttribute("part","content")}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,h.xE)("link")}),(0,o.RF)({componentNameOverride:(0,h.xE)("text")}),(0,o.DM)({triggers:[{attr:"full-width",value:"true"}]}),o.VO,o.tQ)(d)},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(90512);var n=r(76231);customElements.define(n.T,n.m)},75464(e,t,r){r.d(t,{J:()=>b,T:()=>a});var n=r(88961),o=r(63200),s=r(25964),i=r(72270),l=r(66434);const a=(0,s.xE)("link"),h=["href","readonly"];class c extends((0,i.qu)({componentName:a,baseSelector:":host a"})){static get observedAttributes(){return h.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\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\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,s.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",e=>{this.readOnly&&e.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const d={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:p,text:u,host:m,wrapper:g,link:k}=d,b=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:g,textDecoration:{...k,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:l.s.cssVarList.textColor}],cursor:p}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(c)},90512(e,t,r){r.r(t),r.d(t,{LinkClass:()=>n.J,componentName:()=>n.T});var n=r(75464);r(63595),customElements.define(n.T,n.J)},66434(e,t,r){r.d(t,{T:()=>l,s:()=>c});var n=r(88961),o=r(63200),s=r(25964),i=r(72270);const l=(0,s.xE)("text");class a 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:h}={host:{selector:()=>":host"}},c=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...h,property:"width"},hostDirection:{...h,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(a)},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)}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[2294,4159,9261],{76231(e,t,r){r.d(t,{T:()=>c,m:()=>p});var n=r(92540),o=r(88961),s=r(63200),i=r(36976),l=r(72270),a=r(54847),h=r(25964);const c=(0,h.xE)("enriched-text");class d extends((0,l.qu)({componentName:c,baseSelector:":host > div"})){#e;#t;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <div class="content"></div>\n ',(0,h.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,h.Ge)(this,this.#n.bind(this)),this.contentNode?.addEventListener("click",e=>{e.target instanceof HTMLAnchorElement&&e.stopPropagation()}),this.contentNode?.addEventListener("keydown",e=>{"Enter"===e.key&&e.target instanceof HTMLAnchorElement&&e.stopPropagation()})}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,a.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{console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=e,this.contentNode.firstChild?.setAttribute("part","content")}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,h.xE)("link")}),(0,o.RF)({componentNameOverride:(0,h.xE)("text")}),(0,o.DM)({triggers:[{attr:"full-width",value:"true"}]}),o.VO,o.tQ)(d)},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(90512);var n=r(76231);customElements.define(n.T,n.m)},75464(e,t,r){r.d(t,{J:()=>b,T:()=>a});var n=r(88961),o=r(63200),s=r(25964),i=r(72270),l=r(66434);const a=(0,s.xE)("link"),h=["href","readonly"];class c extends((0,i.qu)({componentName:a,baseSelector:":host a"})){static get observedAttributes(){return h.concat(super.observedAttributes||[])}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n\t\t<div>\n\t\t\t<descope-text part="wrapper">\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\n :host([ellipsis="true"]) descope-text {\n display: inline-flex;\n }\n :host([ellipsis="true"]) descope-text::part(text-wrapper) {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n }\n ',this),this.anchor=this.shadowRoot.querySelector("a"),(0,s.EA)(this,this.anchor,{includeAttrs:["href","target","tooltip"],mapAttrs:{tooltip:"title"}}),(0,s.EA)(this,this.shadowRoot.querySelector("descope-text"),{includeAttrs:["mode","variant"]}),this.anchor.addEventListener("click",e=>{this.readOnly&&e.preventDefault()})}get readOnly(){return"true"===this.getAttribute("readonly")}}const d={host:{selector:()=>":host"},link:{selector:()=>":host a"},anchor:{},wrapper:{selector:()=>":host > div"},text:{selector:()=>l.s.componentName}},{anchor:p,text:u,host:m,wrapper:g,link:k}=d,b=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...m,property:"width"},hostDirection:{...u,property:"direction"},textAlign:g,textDecoration:{...k,property:"text-decoration",fallback:"none"},textColor:[{...p,property:"color"},{...u,property:l.s.cssVarList.textColor}],cursor:p}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(c)},90512(e,t,r){r.r(t),r.d(t,{LinkClass:()=>n.J,componentName:()=>n.T});var n=r(75464);r(63595),customElements.define(n.T,n.J)},66434(e,t,r){r.d(t,{T:()=>l,s:()=>c});var n=r(88961),o=r(63200),s=r(25964),i=r(72270);const l=(0,s.xE)("text");class a 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:h}={host:{selector:()=>":host"}},c=(0,o.Zz)((0,n.RF)({mappings:{hostWidth:{...h,property:"width"},hostDirection:{...h,property:"direction"},fontSize:{},textColor:[{property:"color"}],textLineHeight:{property:"line-height"},textLetterSpacing:{property:"letter-spacing"},textShadow:{},textAlign:{},textTransform:{},fontFamily:{},fontStyle:{},fontWeight:{},borderWidth:{},borderStyle:{},borderColor:{}}}),(0,n.DM)({triggers:[{attr:"full-width",value:"true"}]}),n.VO,n.tQ)(a)},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)}}]);
|
|
2
2
|
//# sourceMappingURL=descope-enriched-text.js.map
|