@muibook/components 18.0.0 → 18.0.1
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.
|
@@ -164,7 +164,7 @@ class E extends HTMLElement {
|
|
|
164
164
|
return !!(s && this.contains(s));
|
|
165
165
|
}
|
|
166
166
|
render() {
|
|
167
|
-
var o, n, d, h,
|
|
167
|
+
var o, n, d, h, S, f, p, m, g, c, v, b, u, l, y;
|
|
168
168
|
if (!this.shadowRoot) return;
|
|
169
169
|
const e = (this.getAttribute("title") || "").trim(), t = (this.getAttribute("footer-text") || "").trim(), s = this.escapeHtml(e), i = this.escapeHtml(t);
|
|
170
170
|
this.shadowRoot.innerHTML = /*html*/
|
|
@@ -388,8 +388,7 @@ class E extends HTMLElement {
|
|
|
388
388
|
|
|
389
389
|
:host([fullscreen]) .notes,
|
|
390
390
|
:host(:fullscreen) .notes {
|
|
391
|
-
|
|
392
|
-
border-radius: 0;
|
|
391
|
+
display: none !important;
|
|
393
392
|
}
|
|
394
393
|
|
|
395
394
|
:host([present]) .stage {
|
|
@@ -468,13 +467,13 @@ class E extends HTMLElement {
|
|
|
468
467
|
</div>
|
|
469
468
|
<div class="notes"><mui-body variant="optional" size="x-small">Notes...</mui-body><slot name="notes"></slot></div>
|
|
470
469
|
</div>
|
|
471
|
-
`, this.defaultSlot = this.shadowRoot.querySelector("slot:not([name])"), (o = this.defaultSlot) == null || o.addEventListener("slotchange", this.onSlotChange), this.headerSlot = this.shadowRoot.querySelector('slot[name="header"]'), this.headerAfterSlot = this.shadowRoot.querySelector('slot[name="header-after"]'), this.headerDescriptionSlot = this.shadowRoot.querySelector('slot[name="header-description"]'), this.footerSlot = this.shadowRoot.querySelector('slot[name="footer"]'), this.footerAfterSlot = this.shadowRoot.querySelector('slot[name="footer-after"]'), this.notesSlot = this.shadowRoot.querySelector('slot[name="notes"]'), this.stageEl = this.shadowRoot.querySelector(".stage"), (n = this.headerSlot) == null || n.addEventListener("slotchange", this.onChromeSlotChange), (d = this.headerAfterSlot) == null || d.addEventListener("slotchange", this.onChromeSlotChange), (h = this.headerDescriptionSlot) == null || h.addEventListener("slotchange", this.onChromeSlotChange), (
|
|
470
|
+
`, this.defaultSlot = this.shadowRoot.querySelector("slot:not([name])"), (o = this.defaultSlot) == null || o.addEventListener("slotchange", this.onSlotChange), this.headerSlot = this.shadowRoot.querySelector('slot[name="header"]'), this.headerAfterSlot = this.shadowRoot.querySelector('slot[name="header-after"]'), this.headerDescriptionSlot = this.shadowRoot.querySelector('slot[name="header-description"]'), this.footerSlot = this.shadowRoot.querySelector('slot[name="footer"]'), this.footerAfterSlot = this.shadowRoot.querySelector('slot[name="footer-after"]'), this.notesSlot = this.shadowRoot.querySelector('slot[name="notes"]'), this.stageEl = this.shadowRoot.querySelector(".stage"), (n = this.headerSlot) == null || n.addEventListener("slotchange", this.onChromeSlotChange), (d = this.headerAfterSlot) == null || d.addEventListener("slotchange", this.onChromeSlotChange), (h = this.headerDescriptionSlot) == null || h.addEventListener("slotchange", this.onChromeSlotChange), (S = this.footerSlot) == null || S.addEventListener("slotchange", this.onChromeSlotChange), (f = this.footerAfterSlot) == null || f.addEventListener("slotchange", this.onChromeSlotChange), (p = this.footerDescriptionSlot) == null || p.addEventListener("slotchange", this.onChromeSlotChange), (m = this.notesSlot) == null || m.addEventListener("slotchange", this.onChromeSlotChange), this.style.setProperty("--slide-frame-ratio", this.resolveRatio()), (g = this.shadowRoot.querySelector("#notesActionBtn")) == null || g.addEventListener("click", () => {
|
|
472
471
|
this.toggleNotes();
|
|
473
|
-
}), (
|
|
472
|
+
}), (c = this.shadowRoot.querySelector("#slideFramePrevSectionBtn")) == null || c.addEventListener("click", () => {
|
|
474
473
|
this.prevSection();
|
|
475
|
-
}), (
|
|
474
|
+
}), (v = this.shadowRoot.querySelector("#slideFrameNextSectionBtn")) == null || v.addEventListener("click", () => {
|
|
476
475
|
this.nextSection();
|
|
477
|
-
}), (
|
|
476
|
+
}), (b = this.shadowRoot.querySelector("#slideFrameToggleFullscreenBtn")) == null || b.addEventListener("click", () => {
|
|
478
477
|
if (this.hasAttribute("fullscreen") || document.fullscreenElement === this) {
|
|
479
478
|
this.resetPresentationState(), this.exitFullscreen();
|
|
480
479
|
return;
|
|
@@ -484,29 +483,25 @@ class E extends HTMLElement {
|
|
|
484
483
|
});
|
|
485
484
|
}), (u = this.shadowRoot.querySelector("#slideFrameExitPresentBtn")) == null || u.addEventListener("click", () => {
|
|
486
485
|
this.resetPresentationState(), this.exitFullscreen();
|
|
487
|
-
}), (
|
|
486
|
+
}), (l = this.shadowRoot.querySelector("#slideFrameToggleNotesBtn")) == null || l.addEventListener("click", () => {
|
|
488
487
|
this.toggleNotes();
|
|
489
|
-
}), (
|
|
488
|
+
}), (y = this.shadowRoot.querySelector("#slideFrameRatioSelect")) == null || y.addEventListener("change", (a) => {
|
|
490
489
|
var w;
|
|
491
|
-
const r =
|
|
490
|
+
const r = a.currentTarget, x = (r == null ? void 0 : r.value) || ((w = r == null ? void 0 : r.getAttribute) == null ? void 0 : w.call(r, "value")) || "16:9";
|
|
492
491
|
this.setAttribute("ratio", x);
|
|
493
492
|
}), requestAnimationFrame(() => this.updateFullscreenSurfaceFit());
|
|
494
493
|
}
|
|
495
494
|
syncChromeState() {
|
|
496
495
|
if (!this.shadowRoot) return;
|
|
497
496
|
const e = (a) => ((a == null ? void 0 : a.assignedNodes({ flatten: !0 })) || []).some(
|
|
498
|
-
(
|
|
499
|
-
), t = !!(this.getAttribute("title") || "").trim(), s = !!(this.getAttribute("footer-text") || "").trim(), i = this.hasAttribute("hide-header"), o = this.hasAttribute("hide-footer"), n = !o && this.getSections().length > 0, d = !i && (t || e(this.headerSlot) || e(this.headerAfterSlot) || e(this.headerDescriptionSlot)), h = !o && (s || e(this.footerSlot) || e(this.footerAfterSlot) || e(this.footerDescriptionSlot) || n || this.hasAttribute("present") || this.hasAttribute("fullscreen")),
|
|
500
|
-
if (
|
|
501
|
-
const a = this.hasAttribute("fullscreen") || document.fullscreenElement === this;
|
|
502
|
-
S.hidden = a;
|
|
503
|
-
}
|
|
504
|
-
if (c) {
|
|
497
|
+
(r) => r.nodeType === Node.ELEMENT_NODE || (r.textContent || "").trim().length > 0
|
|
498
|
+
), t = !!(this.getAttribute("title") || "").trim(), s = !!(this.getAttribute("footer-text") || "").trim(), i = this.hasAttribute("hide-header"), o = this.hasAttribute("hide-footer"), n = !o && this.getSections().length > 0, d = !i && (t || e(this.headerSlot) || e(this.headerAfterSlot) || e(this.headerDescriptionSlot)), h = !o && (s || e(this.footerSlot) || e(this.footerAfterSlot) || e(this.footerDescriptionSlot) || n || this.hasAttribute("present") || this.hasAttribute("fullscreen")), S = e(this.notesSlot), f = this.hasAttribute("fullscreen") || document.fullscreenElement === this, p = this.hasAttribute("notes-open") && !f, m = this.shadowRoot.querySelector("#headerRegion"), g = this.shadowRoot.querySelector("#footerRegion"), c = this.shadowRoot.querySelector("#footerCounter"), v = this.shadowRoot.querySelector("#slideFrameExitPresentBtn"), b = this.shadowRoot.querySelector("#slideFrameToggleFullscreenBtn"), u = this.shadowRoot.querySelector(".present-controls"), l = Math.max(this.getSections().length, 1), y = this.getActiveSectionIndex() + 1;
|
|
499
|
+
if (u && (u.hidden = f), c) {
|
|
505
500
|
c.hidden = !n;
|
|
506
|
-
const a = Math.min(
|
|
507
|
-
c.style.setProperty("--slide-frame-counter-digits", String(
|
|
501
|
+
const a = Math.min(y, l), r = String(l).length;
|
|
502
|
+
c.style.setProperty("--slide-frame-counter-digits", String(r)), c.setAttribute("aria-label", `Section ${a} of ${l}`), c.innerHTML = `Section <span class="counter-value">${a}</span>/<span class="counter-value">${l}</span>`;
|
|
508
503
|
}
|
|
509
|
-
v && (v.hidden = !this.hasAttribute("fullscreen")), b && (b.textContent = this.hasAttribute("fullscreen") ? "Exit Fullscreen" : "Full Screen"),
|
|
504
|
+
v && (v.hidden = !this.hasAttribute("fullscreen")), b && (b.textContent = this.hasAttribute("fullscreen") ? "Exit Fullscreen" : "Full Screen"), m && (m.hidden = !d), g && (g.hidden = !h), this.toggleAttribute("has-header", d), this.toggleAttribute("has-footer", h), this.toggleAttribute("has-notes", S), this.toggleAttribute("notes-visible", p), this.toggleAttribute("has-chrome", d || h || p), this.updateFullscreenSurfaceFit();
|
|
510
505
|
}
|
|
511
506
|
handleFullscreenChange() {
|
|
512
507
|
const e = document.fullscreenElement === this, t = this.hasAttribute("fullscreen");
|
|
@@ -539,9 +534,9 @@ class E extends HTMLElement {
|
|
|
539
534
|
}
|
|
540
535
|
const t = this.shadowRoot.querySelector(".frame"), s = this.shadowRoot.querySelector(".present-controls"), i = this.shadowRoot.querySelector(".notes");
|
|
541
536
|
if (!t) return;
|
|
542
|
-
const o = t.getBoundingClientRect(), n = getComputedStyle(t), d = parseFloat(n.paddingTop || "0") || 0, h = parseFloat(n.paddingBottom || "0") || 0,
|
|
543
|
-
let
|
|
544
|
-
|
|
537
|
+
const o = t.getBoundingClientRect(), n = getComputedStyle(t), d = parseFloat(n.paddingTop || "0") || 0, h = parseFloat(n.paddingBottom || "0") || 0, S = parseFloat(n.paddingLeft || "0") || 0, f = parseFloat(n.paddingRight || "0") || 0, p = parseFloat(n.rowGap || n.gap || "0") || 0, m = s && getComputedStyle(s).display !== "none" ? s.getBoundingClientRect().height : 0, g = i && getComputedStyle(i).display !== "none" ? i.getBoundingClientRect().height : 0, c = [m > 0, !0, g > 0].filter(Boolean).length, v = Math.max(0, c - 1), b = Math.max(0, o.width - S - f), u = Math.max(0, o.height - d - h - m - g - p * v), l = this.resolveRatioParts(), y = this.hasAttribute("fullscreen") || document.fullscreenElement === this;
|
|
538
|
+
let a, r;
|
|
539
|
+
y ? (r = u, a = r * (l.width / l.height)) : (a = b, r = a * (l.height / l.width), r > u && (r = u, a = r * (l.width / l.height))), this.stageEl.style.width = `${Math.max(0, Math.floor(a))}px`, this.stageEl.style.height = `${Math.max(0, Math.floor(r))}px`;
|
|
545
540
|
}
|
|
546
541
|
escapeHtml(e) {
|
|
547
542
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/* ================================================================================================== */
|
|
3
|
-
/* Don't edit directly • Generated on Sat, 28 Feb 2026
|
|
3
|
+
/* Don't edit directly • Generated on Sat, 28 Feb 2026 10:18:48 GMT • muibook.com */
|
|
4
4
|
/* ================================================================================================== */
|
|
5
5
|
|
|
6
6
|
/* ================================================================================================== */
|