@descope/web-components-ui 1.0.302 → 1.0.303
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-enriched-text-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-enriched-text/EnrichedTextClass.js +2 -2
@@ -1 +1 @@
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[5158],{212:(e,t,o)=>{o.r(t),o.d(t,{EnrichedTextClass:()=>b});var n=o(9927),s=o(4978),r=o(2061),i=o(4567);const l=["block","inline","abbr","abbr2","references","footnote_tail","replacements","smartquotes"],
|
1
|
+
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[5158],{212:(e,t,o)=>{o.r(t),o.d(t,{EnrichedTextClass:()=>b});var n=o(9927),s=o(4978),r=o(2061),i=o(4567);const l=["block","inline","abbr","abbr2","references","footnote_tail","replacements","smartquotes"],c=["text","newline","backticks","del","emphasis","sub","sup","links","escape","ins","mark","footnote_inline","footnote_ref","autolink","htmltag","entity"],a=["code","fences","blockquote","list","heading","paragraph","hr","footnote","lheading","htmlblock","table","deflist"],h={core:["block","inline"],inline:["text","newline","backticks","del","emphasis","sub","sup","links","escape","ins","footnote_inline","footnote_ref","autolink"],block:["code","fences","blockquote","list","heading","paragraph","footnote","htmlblock"]};var d=o(3346);const p=(0,i.iY)("enriched-text");class u extends((0,d.s)({componentName:p,baseSelector:":host > div"})){#e;constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n <style>\n :host {\n display: inline-block;\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 text-decoration: none;\n cursor: pointer;\n }\n a:hover {\n text-decoration: underline;\n }\n blockquote {\n padding: 0 2em;\n }\n </style>\n <slot part="text-wrapper" style="display:none"></slot>\n <div class="content"></div>\n ',this.textSlot=this.shadowRoot.querySelector("slot"),this.#t(),(0,i.P$)(this,this.#o.bind(this))}static get observedAttributes(){return["readonly"]}attributeChangedCallback(e,t,o){super.attributeChangedCallback?.(e,t,o),o!==t&&"readonly"===e&&this.onReadOnlyChange("true"===o)}#n(){this.processor&&(l&&this.processor.core.ruler.disable(l),c&&this.processor.inline.ruler.disable(c),a&&this.processor.block.ruler.disable(a),this.processor.renderer.rules.image=()=>"")}#s(){if(!this.processor)return;const e=h;e?.core&&this.processor?.core.ruler.enable(e?.core),e?.inline&&this.processor?.inline.ruler.enable(e?.inline),e?.block&&this.processor?.block.ruler.enable(e?.block),e?.custom?.includes("image")&&(this.processor.renderer.rules.image=this.#e)}#r(){this.#n(),this.#s()}#t(){this.processor=new n._,this.#e=this.processor.renderer.rules.image,this.#r()}get contentNode(){return this.shadowRoot.querySelector(".content")}#o(){if(!this.processor)return;let e=this.textContent;try{const t=this.processor.parse(this.textContent);e=this.processor.renderer.render(t,{breaks:!0})}catch(e){console.warn("Not parsing invalid markdown token")}this.contentNode.innerHTML=e}onReadOnlyChange(e){e?this.contentNode.setAttribute("inert",e):this.contentNode.removeAttribute("inert")}}const b=(0,r.qC)((0,s.yk)({mappings:{hostWidth:{selector:()=>":host",property:"width"},hostDirection:{selector:()=>":host",property:"direction"},fontSize:{},fontFamily:{},fontWeight:{},textColor:{property:"color"},textLineHeight:{property:"line-height"},textAlign:{},linkColor:{selector:"a",property:"color"}}}),(0,s.yk)({componentNameOverride:(0,i.iY)("link")}),s.e4,s.Ae)(u);customElements.define(p,b)}}]);
|
package/package.json
CHANGED
@@ -135,9 +135,9 @@ class EnrichedText extends createBaseClass({ componentName, baseSelector: ':host
|
|
135
135
|
|
136
136
|
onReadOnlyChange(isReadOnly) {
|
137
137
|
if (isReadOnly) {
|
138
|
-
this.setAttribute('inert', isReadOnly);
|
138
|
+
this.contentNode.setAttribute('inert', isReadOnly);
|
139
139
|
} else {
|
140
|
-
this.removeAttribute('inert');
|
140
|
+
this.contentNode.removeAttribute('inert');
|
141
141
|
}
|
142
142
|
}
|
143
143
|
}
|