@record-evolution/widget-markdown 1.0.8 → 1.0.10

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.
@@ -5550,7 +5550,7 @@ te.registerLanguage("css", Ii);
5550
5550
  te.registerLanguage("plaintext", vi);
5551
5551
  let le = class extends qe {
5552
5552
  constructor() {
5553
- super(), this.version = "1.0.8", this.marked = new Yn(
5553
+ super(), this.version = "1.0.10", this.marked = new Yn(
5554
5554
  hi({
5555
5555
  emptyLangClass: "hljs",
5556
5556
  langPrefix: "hljs language-",
@@ -5582,22 +5582,28 @@ let le = class extends qe {
5582
5582
  * Updates variable spans in the rendered DOM without recreating the entire structure.
5583
5583
  */
5584
5584
  updated(t) {
5585
- super.updated(t), t.has("inputData") && this.shadowRoot?.querySelectorAll(".md-var")?.forEach((n) => {
5586
- const o = n.getAttribute("data-var");
5587
- if (o) {
5588
- const s = this.inputData?.data?.find((i) => i.label === o)?.value;
5589
- if (s == null)
5590
- n.textContent = `{{${o}}}`;
5591
- else if (typeof s == "object")
5592
- try {
5593
- n.textContent = JSON.stringify(s);
5594
- } catch {
5595
- n.textContent = `{{${o}}}`;
5596
- }
5597
- else
5598
- n.textContent = String(s);
5585
+ if (super.updated(t), t.has("inputData")) {
5586
+ if (!this.inputData?.verticalScroll) {
5587
+ const n = this.shadowRoot?.querySelector(".wrapper");
5588
+ n && (n.scrollTop = 0);
5599
5589
  }
5600
- });
5590
+ this.shadowRoot?.querySelectorAll(".md-var")?.forEach((n) => {
5591
+ const o = n.getAttribute("data-var");
5592
+ if (o) {
5593
+ const s = this.inputData?.data?.find((i) => i.label === o)?.value;
5594
+ if (s == null)
5595
+ n.textContent = "";
5596
+ else if (typeof s == "object")
5597
+ try {
5598
+ n.textContent = JSON.stringify(s);
5599
+ } catch {
5600
+ n.textContent = "";
5601
+ }
5602
+ else
5603
+ n.textContent = String(s);
5604
+ }
5605
+ });
5606
+ }
5601
5607
  }
5602
5608
  render() {
5603
5609
  const t = String(this.inputData?.markdown ?? "");
@@ -5607,7 +5613,11 @@ let le = class extends qe {
5607
5613
  this.cachedHtmlTemplate = this.marked.parse(e);
5608
5614
  }
5609
5615
  return fo`
5610
- <div class="wrapper" style="background-color: ${this.themeBgColor}">
5616
+ <div
5617
+ class="wrapper"
5618
+ ?scrollable=${this.inputData?.verticalScroll}
5619
+ style="background-color: ${this.themeBgColor}"
5620
+ >
5611
5621
  <div class="paging markdown-body" ?active=${this.inputData?.markdown}>
5612
5622
  ${To(this.cachedHtmlTemplate ?? "")}
5613
5623
  </div>
@@ -5636,7 +5646,10 @@ le.styles = [
5636
5646
  flex-direction: column;
5637
5647
  width: 100%;
5638
5648
  height: 100%;
5639
- overflow: auto;
5649
+ overflow-x: auto;
5650
+ /* Vertical scrolling is opt-in via the verticalScroll setting; by
5651
+ default overlong content is clipped rather than scrollable. */
5652
+ overflow-y: hidden;
5640
5653
  padding: 1cqh 1cqw;
5641
5654
  box-sizing: border-box;
5642
5655
  /* Derive scrollbar colors from the (inherited) text color so they
@@ -5664,6 +5677,10 @@ le.styles = [
5664
5677
  background-color: color-mix(in srgb, currentColor 55%, transparent);
5665
5678
  }
5666
5679
 
5680
+ .wrapper[scrollable] {
5681
+ overflow-y: auto;
5682
+ }
5683
+
5667
5684
  h2 {
5668
5685
  margin: 0;
5669
5686
  padding: 0px;
@@ -5710,7 +5727,7 @@ ye([
5710
5727
  Ye()
5711
5728
  ], le.prototype, "lastMarkdown", 2);
5712
5729
  le = ye([
5713
- Pi("widget-markdown-1.0.8")
5730
+ Pi("widget-markdown-1.0.10")
5714
5731
  ], le);
5715
5732
  export {
5716
5733
  le as WidgetMarkdown