@descope/web-components-ui 1.0.297 → 1.0.298

Sign up to get free protection for your applications and to get access to all the features.
@@ -4619,12 +4619,12 @@ const onClipboardCopy = (e) => {
4619
4619
  e.preventDefault();
4620
4620
  };
4621
4621
 
4622
- const componentName$z = getComponentName('markdown-content');
4622
+ const componentName$z = getComponentName('enriched-text');
4623
4623
 
4624
- const BaseMarkdownContentClass = createBaseTextClass(componentName$z);
4624
+ const BaseEnrichedTextClass = createBaseTextClass(componentName$z);
4625
4625
 
4626
- const markdownContentMixin = (superclass) =>
4627
- class MarkdownContentMixinClass extends superclass {
4626
+ const EnrichedTextMixin = (superclass) =>
4627
+ class EnrichedTextMixinClass extends superclass {
4628
4628
  static get observedAttributes() {
4629
4629
  return ['disabled-rules', 'line-break'];
4630
4630
  }
@@ -4639,7 +4639,7 @@ const markdownContentMixin = (superclass) =>
4639
4639
 
4640
4640
  init() {
4641
4641
  super.init();
4642
- this.#initMarkdown();
4642
+ this.#initProcessor();
4643
4643
  this.textSlot.addEventListener('slotchange', this.#parseChildren.bind(this));
4644
4644
  }
4645
4645
 
@@ -4648,28 +4648,28 @@ const markdownContentMixin = (superclass) =>
4648
4648
 
4649
4649
  if (attrName === 'disabled-rules') {
4650
4650
  if (newValue !== oldValue) {
4651
- this.#initMarkdown(newValue);
4651
+ this.#initProcessor(newValue);
4652
4652
  this.#parseChildren();
4653
4653
  }
4654
4654
  }
4655
4655
  }
4656
4656
 
4657
- #initMarkdown() {
4658
- this.markdown = markdownit({ breaks: this.lineBreak }).disable(this.disabledRules);
4657
+ #initProcessor() {
4658
+ this.processor = markdownit({ breaks: this.lineBreak }).disable(this.disabledRules);
4659
4659
  }
4660
4660
 
4661
4661
  #parseChildren() {
4662
4662
  const node = this.textSlot.assignedNodes({ flatten: true })?.[0];
4663
4663
 
4664
4664
  if (node && node.nodeType === Node.TEXT_NODE) {
4665
- const tokens = this.markdown.parse(node.textContent, { references: undefined });
4666
- const result = this.markdown.renderer.render(enrichTokens(tokens), {
4665
+ const tokens = this.processor.parse(node.textContent, { references: undefined });
4666
+ const result = this.processor.renderer.render(enrichTokens(tokens), {
4667
4667
  breaks: this.lineBreak,
4668
4668
  });
4669
4669
 
4670
4670
  if (result !== node.textContent) {
4671
4671
  const span = document.createElement('div');
4672
- span.classList.add('markdown-wrapper');
4672
+ span.classList.add('enriched-text');
4673
4673
  // eslint-disable-next-line no-use-before-define
4674
4674
  span.innerHTML = `${getStyleReset()}${result}`;
4675
4675
  span.addEventListener('copy', onClipboardCopy);
@@ -4679,7 +4679,7 @@ const markdownContentMixin = (superclass) =>
4679
4679
  }
4680
4680
  };
4681
4681
 
4682
- const MarkdownContentClass = compose(
4682
+ const EnrichedTextClass = compose(
4683
4683
  createStyleMixin({
4684
4684
  mappings: {
4685
4685
  hostWidth: { selector: () => ':host', property: 'width' },
@@ -4695,25 +4695,25 @@ const MarkdownContentClass = compose(
4695
4695
  }),
4696
4696
  draggableMixin,
4697
4697
  componentNameValidationMixin,
4698
- markdownContentMixin,
4698
+ EnrichedTextMixin,
4699
4699
  hideWhenEmptyMixin
4700
- )(BaseMarkdownContentClass);
4700
+ )(BaseEnrichedTextClass);
4701
4701
 
4702
4702
  function getStyleReset() {
4703
4703
  return `
4704
4704
  <style>
4705
- .markdown-wrapper > * { margin:0 }
4706
- .markdown-wrapper > *:not(:only-child):not(:last-child) {
4707
- margin-bottom: var(${MarkdownContentClass.cssVarList.textLineHeight})
4705
+ .enriched-text > * { margin:0 }
4706
+ .enriched-text > *:not(:only-child):not(:last-child) {
4707
+ margin-bottom: var(${EnrichedTextClass.cssVarList.textLineHeight})
4708
4708
  }
4709
4709
  </style>
4710
4710
  `;
4711
4711
  }
4712
4712
 
4713
4713
  const globalRefs$i = getThemeRefs(globals);
4714
- const vars$q = MarkdownContentClass.cssVarList;
4714
+ const vars$q = EnrichedTextClass.cssVarList;
4715
4715
 
4716
- const markdownContent = {
4716
+ const EnrichedText = {
4717
4717
  [vars$q.hostDirection]: globalRefs$i.direction,
4718
4718
 
4719
4719
  [vars$q.fontSize]: globalRefs$i.typography.body1.size,
@@ -4788,9 +4788,9 @@ const markdownContent = {
4788
4788
  },
4789
4789
  };
4790
4790
 
4791
- var markdownContent$1 = /*#__PURE__*/Object.freeze({
4791
+ var EnrichedText$1 = /*#__PURE__*/Object.freeze({
4792
4792
  __proto__: null,
4793
- default: markdownContent,
4793
+ default: EnrichedText,
4794
4794
  vars: vars$q
4795
4795
  });
4796
4796
 
@@ -11448,7 +11448,7 @@ const components = {
11448
11448
  totpImage,
11449
11449
  notpImage,
11450
11450
  text: text$3,
11451
- markdownContent: markdownContent$1,
11451
+ EnrichedText: EnrichedText$1,
11452
11452
  link: link$1,
11453
11453
  divider: divider$1,
11454
11454
  passcode: passcode$1,
@@ -11799,6 +11799,7 @@ exports.CheckboxClass = CheckboxClass;
11799
11799
  exports.ContainerClass = ContainerClass;
11800
11800
  exports.DividerClass = DividerClass;
11801
11801
  exports.EmailFieldClass = EmailFieldClass;
11802
+ exports.EnrichedTextClass = EnrichedTextClass;
11802
11803
  exports.GridClass = GridClass;
11803
11804
  exports.ImageClass = ImageClass;
11804
11805
  exports.LinkClass = LinkClass;
@@ -11806,7 +11807,6 @@ exports.LoaderLinearClass = LoaderLinearClass;
11806
11807
  exports.LoaderRadialClass = LoaderRadialClass;
11807
11808
  exports.LogoClass = LogoClass;
11808
11809
  exports.MappingsFieldClass = MappingsFieldClass;
11809
- exports.MarkdownContentClass = MarkdownContentClass;
11810
11810
  exports.ModalClass = ModalClass;
11811
11811
  exports.MultiSelectComboBoxClass = MultiSelectComboBoxClass;
11812
11812
  exports.NewPasswordClass = NewPasswordClass;