@descope/web-components-ui 1.0.301 → 1.0.303

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/index.esm.js CHANGED
@@ -112,13 +112,13 @@ const observeChildren = (ele, callback) => {
112
112
 
113
113
  const observer = new MutationObserver((mutationsList) => {
114
114
  mutationsList.forEach((mutation) => {
115
- if (mutation.type === 'childList') {
115
+ if (mutation.type === 'childList' || mutation.type === 'characterData') {
116
116
  callback(mutation);
117
117
  }
118
118
  });
119
119
  });
120
120
 
121
- observer.observe(ele, { childList: true });
121
+ observer.observe(ele, { childList: true, characterData: true, subtree: true });
122
122
  };
123
123
 
124
124
  const createSyncAttrsCb =
@@ -2232,8 +2232,6 @@ class RawText extends createBaseClass({ componentName: componentName$L, baseSele
2232
2232
  </style>
2233
2233
  <slot part="text-wrapper"></slot>
2234
2234
  `;
2235
-
2236
- this.textSlot = this.shadowRoot.querySelector('slot');
2237
2235
  }
2238
2236
 
2239
2237
  get hideWhenEmpty() {
@@ -3456,7 +3454,7 @@ let EnrichedText$2 = class EnrichedText extends createBaseClass({ componentName:
3456
3454
 
3457
3455
  this.#initProcessor();
3458
3456
 
3459
- this.textSlot.addEventListener('slotchange', this.#parseChildren.bind(this));
3457
+ observeChildren(this, this.#parseChildren.bind(this));
3460
3458
  }
3461
3459
 
3462
3460
  static get observedAttributes() {
@@ -3528,7 +3526,6 @@ let EnrichedText$2 = class EnrichedText extends createBaseClass({ componentName:
3528
3526
  try {
3529
3527
  const tokens = this.processor.parse(this.textContent);
3530
3528
  html = this.processor.renderer.render(tokens, { breaks: true });
3531
- this.contentNode.innerHTML = html;
3532
3529
  } catch (e) {
3533
3530
  // eslint-disable-next-line no-console
3534
3531
  console.warn('Not parsing invalid markdown token');
@@ -3539,9 +3536,9 @@ let EnrichedText$2 = class EnrichedText extends createBaseClass({ componentName:
3539
3536
 
3540
3537
  onReadOnlyChange(isReadOnly) {
3541
3538
  if (isReadOnly) {
3542
- this.setAttribute('inert', isReadOnly);
3539
+ this.contentNode.setAttribute('inert', isReadOnly);
3543
3540
  } else {
3544
- this.removeAttribute('inert');
3541
+ this.contentNode.removeAttribute('inert');
3545
3542
  }
3546
3543
  }
3547
3544
  };