@descope/web-components-ui 1.0.301 → 1.0.303

Sign up to get free protection for your applications and to get access to all the features.
@@ -95,13 +95,13 @@ const observeChildren = (ele, callback) => {
95
95
 
96
96
  const observer = new MutationObserver((mutationsList) => {
97
97
  mutationsList.forEach((mutation) => {
98
- if (mutation.type === 'childList') {
98
+ if (mutation.type === 'childList' || mutation.type === 'characterData') {
99
99
  callback(mutation);
100
100
  }
101
101
  });
102
102
  });
103
103
 
104
- observer.observe(ele, { childList: true });
104
+ observer.observe(ele, { childList: true, characterData: true, subtree: true });
105
105
  };
106
106
 
107
107
  const createSyncAttrsCb =
@@ -4435,8 +4435,6 @@ class RawText extends createBaseClass({ componentName: componentName$A, baseSele
4435
4435
  </style>
4436
4436
  <slot part="text-wrapper"></slot>
4437
4437
  `;
4438
-
4439
- this.textSlot = this.shadowRoot.querySelector('slot');
4440
4438
  }
4441
4439
 
4442
4440
  get hideWhenEmpty() {
@@ -4690,7 +4688,7 @@ let EnrichedText$2 = class EnrichedText extends createBaseClass({ componentName:
4690
4688
 
4691
4689
  this.#initProcessor();
4692
4690
 
4693
- this.textSlot.addEventListener('slotchange', this.#parseChildren.bind(this));
4691
+ observeChildren(this, this.#parseChildren.bind(this));
4694
4692
  }
4695
4693
 
4696
4694
  static get observedAttributes() {
@@ -4762,7 +4760,6 @@ let EnrichedText$2 = class EnrichedText extends createBaseClass({ componentName:
4762
4760
  try {
4763
4761
  const tokens = this.processor.parse(this.textContent);
4764
4762
  html = this.processor.renderer.render(tokens, { breaks: true });
4765
- this.contentNode.innerHTML = html;
4766
4763
  } catch (e) {
4767
4764
  // eslint-disable-next-line no-console
4768
4765
  console.warn('Not parsing invalid markdown token');
@@ -4773,9 +4770,9 @@ let EnrichedText$2 = class EnrichedText extends createBaseClass({ componentName:
4773
4770
 
4774
4771
  onReadOnlyChange(isReadOnly) {
4775
4772
  if (isReadOnly) {
4776
- this.setAttribute('inert', isReadOnly);
4773
+ this.contentNode.setAttribute('inert', isReadOnly);
4777
4774
  } else {
4778
- this.removeAttribute('inert');
4775
+ this.contentNode.removeAttribute('inert');
4779
4776
  }
4780
4777
  }
4781
4778
  };