@muibook/components 14.0.0 → 14.0.2
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.
|
@@ -18,7 +18,7 @@ import "../mui-rule/index.js";
|
|
|
18
18
|
import "../mui-prompt-toggle/index.js";
|
|
19
19
|
class k extends HTMLElement {
|
|
20
20
|
constructor() {
|
|
21
|
-
super(), this.triggerEl = null, this.previewShellEl = null, this.previewRowEl = null, this.previewSlotEl = null, this.previewResizeObserver = null, this.fanAnimations = /* @__PURE__ */ new Map(), this.pendingColorFade = !1, this.lastDebugPayload = '{"event":"idle"}', this.enforceActionVariants = () => {
|
|
21
|
+
super(), this.triggerEl = null, this.previewShellEl = null, this.previewRowEl = null, this.previewSlotEl = null, this.previewResizeObserver = null, this.fanAnimations = /* @__PURE__ */ new Map(), this.pendingColorFade = !1, this.lastDebugPayload = '{"event":"idle"}', this.lightDomObserver = null, this.onActionsSlotChange = () => this.updateActionsLayout(), this.enforceActionVariants = () => {
|
|
22
22
|
if (!this.shadowRoot) return;
|
|
23
23
|
const e = Array.from(this.shadowRoot.querySelectorAll('slot[name="actions"], slot[name="actions-trigger"], slot[name="actions-right"]')), o = (r, s) => {
|
|
24
24
|
if (!s || r.tagName.toLowerCase() !== "mui-button") return;
|
|
@@ -32,13 +32,13 @@ class k extends HTMLElement {
|
|
|
32
32
|
const s = r.name === "actions";
|
|
33
33
|
r.assignedElements({ flatten: !0 }).forEach((a) => {
|
|
34
34
|
[a, ...Array.from(a.querySelectorAll("*"))].forEach((c) => {
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
35
|
+
const h = c.tagName.toLowerCase();
|
|
36
|
+
if (h === "mui-button") {
|
|
37
37
|
c.setAttribute("variant", "tertiary"), o(c, s);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
h === "mui-dropdown" && c.querySelectorAll('[slot="action"]').forEach((u) => {
|
|
41
|
+
u instanceof HTMLElement && u.tagName.toLowerCase() === "mui-button" && (u.setAttribute("variant", "tertiary"), o(u, s));
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
});
|
|
@@ -48,9 +48,9 @@ class k extends HTMLElement {
|
|
|
48
48
|
}, this.onPaste = (t) => {
|
|
49
49
|
const e = t, o = e.clipboardData;
|
|
50
50
|
if (!o) return;
|
|
51
|
-
const r = Array.from(o.files || []), s = o.getData("text/plain") || "", i = s.trim(), a = i.length > 0, l = a ? this.detectMediaUrl(i) : null, c = this.getAttribute("preview-overflow-to-preview") !== "false",
|
|
52
|
-
if (!
|
|
53
|
-
(
|
|
51
|
+
const r = Array.from(o.files || []), s = o.getData("text/plain") || "", i = s.trim(), a = i.length > 0, l = a ? this.detectMediaUrl(i) : null, c = this.getAttribute("preview-overflow-to-preview") !== "false", h = this.getAttribute("preview-threshold-chars"), p = Number.isFinite(Number.parseInt(h || "", 10)) ? Math.max(1, Number.parseInt(h || "", 10)) : 220, u = a ? this.detectBadge(i) : "", m = u !== "" && u !== "Insightful", g = c && a && (!!(l != null && l.url) || i.length >= p || m), b = r.length > 0;
|
|
52
|
+
if (!b && !a) return;
|
|
53
|
+
(b || g) && e.preventDefault();
|
|
54
54
|
const v = r.map((d) => ({
|
|
55
55
|
kind: d.type.startsWith("image/") ? "image" : d.type.startsWith("video/") ? "video" : d.type.startsWith("audio/") ? "audio" : "file",
|
|
56
56
|
mimeType: d.type || "",
|
|
@@ -61,7 +61,7 @@ class k extends HTMLElement {
|
|
|
61
61
|
preview: d.name || "Pasted file",
|
|
62
62
|
value: d.name || ""
|
|
63
63
|
}));
|
|
64
|
-
|
|
64
|
+
g && i && (l != null && l.url ? v.unshift({
|
|
65
65
|
kind: l.kind === "image" ? "image" : "text",
|
|
66
66
|
mimeType: l.mimeType,
|
|
67
67
|
badge: l.badge,
|
|
@@ -77,8 +77,8 @@ class k extends HTMLElement {
|
|
|
77
77
|
source: "paste",
|
|
78
78
|
items: v,
|
|
79
79
|
text: s || "",
|
|
80
|
-
textBadge: (l == null ? void 0 : l.badge) ||
|
|
81
|
-
overflowed:
|
|
80
|
+
textBadge: (l == null ? void 0 : l.badge) || u,
|
|
81
|
+
overflowed: g,
|
|
82
82
|
thresholdChars: p
|
|
83
83
|
});
|
|
84
84
|
}, this.onInput = (t) => {
|
|
@@ -240,12 +240,12 @@ class k extends HTMLElement {
|
|
|
240
240
|
)
|
|
241
241
|
).flatMap((r) => r.assignedElements({ flatten: !0 })).forEach((r) => {
|
|
242
242
|
[r, ...Array.from(r.querySelectorAll("*"))].forEach((i) => {
|
|
243
|
-
const l = i.tagName.toLowerCase() === "mui-prompt-toggle", c = i.hasAttribute("context-toggle"),
|
|
243
|
+
const l = i.tagName.toLowerCase() === "mui-prompt-toggle", c = i.hasAttribute("context-toggle"), h = i.hasAttribute("context-active") || i.hasAttribute("context-close") || i.hasAttribute("context-chip") || i.hasAttribute("context-spinner");
|
|
244
244
|
if (l) {
|
|
245
245
|
i.setAttribute("mode", t);
|
|
246
246
|
return;
|
|
247
247
|
}
|
|
248
|
-
if (c ||
|
|
248
|
+
if (c || h) {
|
|
249
249
|
i.hasAttribute("context-chip") && i.tagName.toLowerCase() === "mui-chip" && !i.hasAttribute("variant") && i.setAttribute("variant", "ghost");
|
|
250
250
|
const p = c ? t === "icon" : t === "chip";
|
|
251
251
|
i.toggleAttribute("hidden", !p), i.style.display = p ? "inline-flex" : "none";
|
|
@@ -253,12 +253,25 @@ class k extends HTMLElement {
|
|
|
253
253
|
});
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
+
hasTruthyFlagAttribute(t) {
|
|
257
|
+
const e = this.getAttribute(t);
|
|
258
|
+
return e !== null && e !== "false";
|
|
259
|
+
}
|
|
260
|
+
shouldUseFanModeByActions() {
|
|
261
|
+
if (!this.shadowRoot) return !1;
|
|
262
|
+
const t = this.shadowRoot.querySelector('slot[name="actions"]');
|
|
263
|
+
return t ? t.assignedElements({ flatten: !0 }).filter(
|
|
264
|
+
(o) => !o.hasAttribute("hidden")
|
|
265
|
+
).length > 0 : !1;
|
|
266
|
+
}
|
|
267
|
+
isFanModeEnabled() {
|
|
268
|
+
return this.hasTruthyFlagAttribute("actions-fan") ? !0 : this.shouldUseFanModeByActions();
|
|
269
|
+
}
|
|
256
270
|
ensureFanMode() {
|
|
257
|
-
this.hasAttribute("fan-open") && !this.hasAttribute("actions-fan") && this.setAttribute("actions-fan", "");
|
|
258
271
|
}
|
|
259
272
|
connectedCallback() {
|
|
260
273
|
var e;
|
|
261
|
-
this.hasAttribute("context-mode") || this.setAttribute("context-mode", "icon"), this.ensureFanMode(), this.render(), this.bindEvents(), this.updateActionsLayout();
|
|
274
|
+
this.hasAttribute("context-mode") || this.setAttribute("context-mode", "icon"), this.ensureFanMode(), this.render(), this.bindEvents(), this.updateActionsLayout(), queueMicrotask(() => this.updateActionsLayout()), requestAnimationFrame(() => this.updateActionsLayout()), requestAnimationFrame(() => requestAnimationFrame(() => this.updateActionsLayout()));
|
|
262
275
|
const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("textarea");
|
|
263
276
|
t && (this.syncTextareaHeight(t), requestAnimationFrame(() => this.syncTextareaHeight(t)));
|
|
264
277
|
}
|
|
@@ -421,10 +434,10 @@ class k extends HTMLElement {
|
|
|
421
434
|
t == null || t.focus();
|
|
422
435
|
}
|
|
423
436
|
syncTextareaHeight(t) {
|
|
424
|
-
const o = Number.parseInt(this.getAttribute("rows") || String(3), 10) || 3, r = Math.max(o + 6, 10), s = getComputedStyle(t), a = (Number.parseFloat(s.fontSize) || 16) * 1.55, l = Number.parseFloat(s.paddingTop) || 0, c = Number.parseFloat(s.paddingBottom) || 0,
|
|
437
|
+
const o = Number.parseInt(this.getAttribute("rows") || String(3), 10) || 3, r = Math.max(o + 6, 10), s = getComputedStyle(t), a = (Number.parseFloat(s.fontSize) || 16) * 1.55, l = Number.parseFloat(s.paddingTop) || 0, c = Number.parseFloat(s.paddingBottom) || 0, h = Number.parseFloat(s.borderTopWidth) || 0, p = Number.parseFloat(s.borderBottomWidth) || 0, u = l + c + h + p, m = 3 * a + u, g = r * a + u;
|
|
425
438
|
t.style.height = "auto";
|
|
426
|
-
const
|
|
427
|
-
t.style.height = `${Math.ceil(v)}px`, t.style.overflowY =
|
|
439
|
+
const b = t.scrollHeight, v = Math.max(m, Math.min(b, g));
|
|
440
|
+
t.style.height = `${Math.ceil(v)}px`, t.style.overflowY = b > g ? "auto" : "hidden";
|
|
428
441
|
}
|
|
429
442
|
detectBadge(t) {
|
|
430
443
|
const e = t.trim();
|
|
@@ -482,18 +495,24 @@ class k extends HTMLElement {
|
|
|
482
495
|
return null;
|
|
483
496
|
}
|
|
484
497
|
bindEvents() {
|
|
498
|
+
var i;
|
|
485
499
|
if (!this.shadowRoot) return;
|
|
486
500
|
this.unbindEvents();
|
|
487
501
|
const t = this.shadowRoot.querySelector("textarea");
|
|
488
502
|
t == null || t.addEventListener("input", this.onInput), t == null || t.addEventListener("keydown", this.onKeyDown), t == null || t.addEventListener("paste", this.onPaste), t == null || t.addEventListener("focus", this.onTextareaFocus);
|
|
489
503
|
const e = this.shadowRoot.querySelector('slot[name="actions"]'), o = this.shadowRoot.querySelector('slot[name="actions-trigger"]'), r = this.shadowRoot.querySelector('slot[name="actions-right"]'), s = this.shadowRoot.querySelector("#promptDefaultSubmitAction");
|
|
490
|
-
e == null || e.addEventListener("slotchange",
|
|
504
|
+
e == null || e.addEventListener("slotchange", this.onActionsSlotChange), o == null || o.addEventListener("slotchange", this.onActionsSlotChange), r == null || r.addEventListener("slotchange", this.onActionsSlotChange), typeof MutationObserver < "u" && ((i = this.lightDomObserver) == null || i.disconnect(), this.lightDomObserver = new MutationObserver(() => this.updateActionsLayout()), this.lightDomObserver.observe(this, {
|
|
505
|
+
childList: !0,
|
|
506
|
+
subtree: !0,
|
|
507
|
+
attributes: !0,
|
|
508
|
+
attributeFilter: ["slot", "hidden"]
|
|
509
|
+
})), s == null || s.addEventListener("click", this.onDefaultSubmitClick), this.addEventListener("prompt-preview-open", this.onPreviewOpen), this.addEventListener("click", this.onContextToggleClick), this.addEventListener("dismiss", this.onContextChipDismiss), this.syncErrorVisibility(), this.bindPreviewOverflow(), this.bindActionTrigger(), this.syncLoadingState();
|
|
491
510
|
}
|
|
492
511
|
unbindEvents() {
|
|
493
|
-
var
|
|
512
|
+
var i, a, l, c;
|
|
494
513
|
if (!this.shadowRoot) return;
|
|
495
|
-
const t = this.shadowRoot.querySelector("textarea"), e = this.shadowRoot.querySelector("#promptDefaultSubmitAction");
|
|
496
|
-
t == null || t.removeEventListener("input", this.onInput), t == null || t.removeEventListener("keydown", this.onKeyDown), t == null || t.removeEventListener("paste", this.onPaste), t == null || t.removeEventListener("focus", this.onTextareaFocus),
|
|
514
|
+
const t = this.shadowRoot.querySelector("textarea"), e = this.shadowRoot.querySelector('slot[name="actions"]'), o = this.shadowRoot.querySelector('slot[name="actions-trigger"]'), r = this.shadowRoot.querySelector('slot[name="actions-right"]'), s = this.shadowRoot.querySelector("#promptDefaultSubmitAction");
|
|
515
|
+
t == null || t.removeEventListener("input", this.onInput), t == null || t.removeEventListener("keydown", this.onKeyDown), t == null || t.removeEventListener("paste", this.onPaste), t == null || t.removeEventListener("focus", this.onTextareaFocus), s == null || s.removeEventListener("click", this.onDefaultSubmitClick), e == null || e.removeEventListener("slotchange", this.onActionsSlotChange), o == null || o.removeEventListener("slotchange", this.onActionsSlotChange), r == null || r.removeEventListener("slotchange", this.onActionsSlotChange), this.removeEventListener("prompt-preview-open", this.onPreviewOpen), this.removeEventListener("click", this.onContextToggleClick), this.removeEventListener("dismiss", this.onContextChipDismiss), this.triggerEl && (this.triggerEl.removeEventListener("click", this.toggleFanOpen), this.triggerEl = null), (i = this.previewRowEl) == null || i.removeEventListener("scroll", this.onPreviewScroll), (a = this.previewSlotEl) == null || a.removeEventListener("slotchange", this.onPreviewSlotChange), (l = this.previewResizeObserver) == null || l.disconnect(), this.previewResizeObserver = null, (c = this.lightDomObserver) == null || c.disconnect(), this.lightDomObserver = null, this.previewShellEl = null, this.previewRowEl = null, this.previewSlotEl = null;
|
|
497
516
|
}
|
|
498
517
|
bindPreviewOverflow() {
|
|
499
518
|
var t, e;
|
|
@@ -540,7 +559,7 @@ class k extends HTMLElement {
|
|
|
540
559
|
openInternalPreviewDialog(t) {
|
|
541
560
|
var y;
|
|
542
561
|
if (!this.shadowRoot) return;
|
|
543
|
-
const e = this.shadowRoot.querySelector("#promptAutoPreviewDialog"), o = this.shadowRoot.querySelector("#promptAutoPreviewTitle"), r = this.shadowRoot.querySelector("#promptAutoPreviewCode"), s = this.shadowRoot.querySelector("#promptAutoPreviewImage"), i = this.shadowRoot.querySelector("#promptAutoPreviewMedia"), a = this.shadowRoot.querySelector("#promptAutoPreviewMediaUrl"), l = this.normalizePreviewDetail(t), c = this.getAttribute("preview-dialog-title") || l.label,
|
|
562
|
+
const e = this.shadowRoot.querySelector("#promptAutoPreviewDialog"), o = this.shadowRoot.querySelector("#promptAutoPreviewTitle"), r = this.shadowRoot.querySelector("#promptAutoPreviewCode"), s = this.shadowRoot.querySelector("#promptAutoPreviewImage"), i = this.shadowRoot.querySelector("#promptAutoPreviewMedia"), a = this.shadowRoot.querySelector("#promptAutoPreviewMediaUrl"), l = this.normalizePreviewDetail(t), c = this.getAttribute("preview-dialog-title") || l.label, h = l.value, p = l.bgImage, u = l.badge, m = h ? this.detectMediaUrl(h) : null, g = !p && h.length > 0 && (u === "VIDEO" || u === "MUSIC"), b = !p && (!!(m && (m.kind === "video" || m.kind === "audio")) || g), v = p.length > 0, d = h.length > 0, w = (() => {
|
|
544
563
|
if (!m || m.kind !== "audio") return !1;
|
|
545
564
|
try {
|
|
546
565
|
const f = new URL(m.url);
|
|
@@ -557,16 +576,16 @@ class k extends HTMLElement {
|
|
|
557
576
|
return "Audio";
|
|
558
577
|
}
|
|
559
578
|
})();
|
|
560
|
-
if (!(!v && !d && !
|
|
561
|
-
if (this.setAttribute("preview-dialog-value",
|
|
579
|
+
if (!(!v && !d && !b)) {
|
|
580
|
+
if (this.setAttribute("preview-dialog-value", h), this.setAttribute("preview-dialog-image", p), this.setAttribute("preview-dialog-type", u || (v ? "IMG" : "CODE")), o && (o.textContent = c), b ? e == null || e.setAttribute("content-max-height", "none") : e == null || e.removeAttribute("content-max-height"), v)
|
|
562
581
|
a && a.setAttribute("hidden", ""), s && (s.setAttribute("src", p), s.removeAttribute("hidden")), i && i.setAttribute("hidden", ""), r && r.setAttribute("hidden", "");
|
|
563
|
-
else if (
|
|
582
|
+
else if (b && m) {
|
|
564
583
|
if (a) {
|
|
565
584
|
const f = w;
|
|
566
585
|
a.textContent = f ? n : m.url, f ? (a.setAttribute("href", m.url), a.setAttribute("target", "_blank"), a.setAttribute("rel", "noopener noreferrer")) : (a.removeAttribute("href"), a.removeAttribute("target"), a.removeAttribute("rel")), a.toggleAttribute("hidden", !f);
|
|
567
586
|
}
|
|
568
587
|
i && (i.setAttribute("src", m.url), i.removeAttribute("type"), i.removeAttribute("prefer-native-controls"), i.removeAttribute("hidden")), r && r.setAttribute("hidden", ""), s && (s.removeAttribute("src"), s.setAttribute("hidden", ""));
|
|
569
|
-
} else
|
|
588
|
+
} else g ? (a && (a.textContent = h, a.toggleAttribute("hidden", !0)), i && (i.setAttribute("src", h), i.setAttribute("type", u === "VIDEO" ? "video" : "audio"), i.removeAttribute("prefer-native-controls"), i.removeAttribute("hidden")), r && r.setAttribute("hidden", ""), s && (s.removeAttribute("src"), s.setAttribute("hidden", ""))) : (a && a.setAttribute("hidden", ""), r && (r.textContent = this.formatPreviewCode(h, u), r.removeAttribute("hidden")), i && (i.removeAttribute("src"), i.removeAttribute("prefer-native-controls"), i.setAttribute("hidden", "")), s && (s.removeAttribute("src"), s.setAttribute("hidden", "")));
|
|
570
589
|
(y = e == null ? void 0 : e.open) == null || y.call(e);
|
|
571
590
|
}
|
|
572
591
|
}
|
|
@@ -579,7 +598,7 @@ class k extends HTMLElement {
|
|
|
579
598
|
return t.tagName.toLowerCase() === "mui-prompt-toggle" || t.hasAttribute("context-toggle") ? !0 : !!t.querySelector("[context-toggle]");
|
|
580
599
|
}
|
|
581
600
|
bindActionTrigger() {
|
|
582
|
-
if (!this.shadowRoot || !this.
|
|
601
|
+
if (!this.shadowRoot || !this.isFanModeEnabled()) return;
|
|
583
602
|
const t = this.shadowRoot.querySelector('slot[name="actions"]'), e = this.shadowRoot.querySelector('slot[name="actions-trigger"]'), o = this.shadowRoot.querySelector("#promptDefaultActionsTrigger");
|
|
584
603
|
if (!t) return;
|
|
585
604
|
this.triggerEl && (this.triggerEl.removeEventListener("click", this.toggleFanOpen), this.triggerEl = null);
|
|
@@ -616,28 +635,26 @@ class k extends HTMLElement {
|
|
|
616
635
|
updateActionsLayout() {
|
|
617
636
|
if (!this.shadowRoot) return;
|
|
618
637
|
this.syncContextModeUI();
|
|
619
|
-
const t = this.shadowRoot.querySelector('slot[name="actions"]'), e = this.shadowRoot.querySelector('slot[name="actions-trigger"]'), o = this.shadowRoot.querySelector("#promptDefaultActionsTrigger")
|
|
638
|
+
const t = this.shadowRoot.querySelector('slot[name="actions"]'), e = this.shadowRoot.querySelector('slot[name="actions-trigger"]'), o = this.shadowRoot.querySelector("#promptDefaultActionsTrigger");
|
|
620
639
|
if (!t) return;
|
|
621
|
-
const
|
|
640
|
+
const r = ((e == null ? void 0 : e.assignedElements({ flatten: !0 })) || []).filter(
|
|
622
641
|
(n) => !n.hasAttribute("hidden")
|
|
623
|
-
),
|
|
642
|
+
), s = t.assignedElements({ flatten: !0 }).filter(
|
|
624
643
|
(n) => !n.hasAttribute("hidden")
|
|
625
|
-
),
|
|
626
|
-
|
|
627
|
-
const
|
|
644
|
+
), i = s.length > 0, a = this.shadowRoot.querySelector(".actions-slot-left");
|
|
645
|
+
a && (a.style.display = i ? "inline-flex" : "none");
|
|
646
|
+
const l = r.length === 0 && s.length === 1 && this.isContextOnlyAction(s[0]);
|
|
628
647
|
if (o) {
|
|
629
|
-
const n = !
|
|
648
|
+
const n = !i || l;
|
|
630
649
|
o.toggleAttribute("hidden", n), o.style.display = n ? "none" : "inline-flex";
|
|
631
650
|
}
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
}
|
|
637
|
-
this.enforceActionVariants(), h.forEach((n, y) => {
|
|
651
|
+
const c = l ? null : r.find((n) => n.hasAttribute("fan-trigger")) || r[0] || o || s.find((n) => n.hasAttribute("fan-trigger")) || s[0] || null, h = s.filter((n) => n !== c), p = c ? [c, ...h] : s, u = this.shadowRoot.querySelector('slot[name="actions-right"]'), m = (u == null ? void 0 : u.assignedElements({ flatten: !0 })) || [], g = h.length > 0;
|
|
652
|
+
this.toggleAttribute("has-actions", i), this.toggleAttribute("has-extra-actions", g);
|
|
653
|
+
const b = i || this.hasTruthyFlagAttribute("actions-fan"), v = this.hasAttribute("fan-open"), d = 100, w = "calc(var(--action-icon-only-size-medium) + var(--space-100))";
|
|
654
|
+
this.enforceActionVariants(), p.forEach((n, y) => {
|
|
638
655
|
n.style.transition = `transform ${d}ms ease, opacity ${d}ms ease`, n.style.zIndex = "";
|
|
639
656
|
const f = this.fanAnimations.get(n);
|
|
640
|
-
if (f && (f.cancel(), this.fanAnimations.delete(n)), !
|
|
657
|
+
if (f && (f.cancel(), this.fanAnimations.delete(n)), !b) {
|
|
641
658
|
this.setFanItemInert(n, !1), n.style.transitionDelay = "", n.style.transform = "", n.style.opacity = "", n.style.pointerEvents = "", n.style.filter = "";
|
|
642
659
|
return;
|
|
643
660
|
}
|
|
@@ -674,23 +691,23 @@ class k extends HTMLElement {
|
|
|
674
691
|
n.style.pointerEvents = "", this.setFanItemInert(n, !1);
|
|
675
692
|
});
|
|
676
693
|
});
|
|
677
|
-
}),
|
|
694
|
+
}), m.forEach((n) => {
|
|
678
695
|
n.style.transition = "", n.style.zIndex = "";
|
|
679
696
|
}), this.bindActionTrigger(), this.syncTriggerIconState();
|
|
680
697
|
}
|
|
681
698
|
render() {
|
|
682
699
|
if (!this.shadowRoot) return;
|
|
683
|
-
const t = this.getAttribute("placeholder") || "Reply to Mui...", e = this.getAttribute("value") || "", o = this.getAttribute("rows") || "3", r = this.hasAttribute("disabled"), s = this.getAttribute("preview-dialog-width") || "560px", i = this.getAttribute("color-top-start") || "", a = this.getAttribute("color-top-mid") || "", l = this.getAttribute("color-top-end") || "", c = this.getAttribute("color-top-accent") || "", p = (this.getAttribute("color-layout") || "default").toLowerCase() === "swap",
|
|
700
|
+
const t = this.getAttribute("placeholder") || "Reply to Mui...", e = this.getAttribute("value") || "", o = this.getAttribute("rows") || "3", r = this.hasAttribute("disabled"), s = this.getAttribute("preview-dialog-width") || "560px", i = this.getAttribute("color-top-start") || "", a = this.getAttribute("color-top-mid") || "", l = this.getAttribute("color-top-end") || "", c = this.getAttribute("color-top-accent") || "", p = (this.getAttribute("color-layout") || "default").toLowerCase() === "swap", u = p ? l || "var(--prompt-color-top-end, var(--green-500))" : i || "var(--prompt-color-top-start, var(--blue-500))", m = p ? c || "var(--prompt-color-top-accent, var(--orange-500))" : a || "var(--prompt-color-top-mid, var(--blue-500))", g = p ? i || "var(--prompt-color-top-start, var(--blue-500))" : l || "var(--prompt-color-top-end, var(--green-500))", b = p ? a || "var(--prompt-color-top-mid, var(--blue-500))" : c || "var(--prompt-color-top-accent, var(--orange-500))", v = this.getAttribute("aria-label"), d = this.getAttribute("aria-labelledby"), w = this.getAttribute("aria-describedby"), n = !v && !d ? "Prompt input" : "", y = (this.getAttribute("error-message") || "").trim(), f = y;
|
|
684
701
|
this.shadowRoot.innerHTML = /*html*/
|
|
685
702
|
`
|
|
686
703
|
<style>
|
|
687
704
|
:host {
|
|
688
705
|
display: block;
|
|
689
706
|
--prompt-action-radius: var(--chip-radius-small, var(--radius-400));
|
|
690
|
-
--_prompt-color-top-start-source: ${
|
|
707
|
+
--_prompt-color-top-start-source: ${u};
|
|
691
708
|
--_prompt-color-top-mid-source: ${m};
|
|
692
|
-
--_prompt-color-top-end-source: ${
|
|
693
|
-
--_prompt-color-top-accent-source: ${
|
|
709
|
+
--_prompt-color-top-end-source: ${g};
|
|
710
|
+
--_prompt-color-top-accent-source: ${b};
|
|
694
711
|
--_prompt-accent-primary: var(--prompt-accent-primary, var(--prompt-spectrum-start, var(--blue-500)));
|
|
695
712
|
--_prompt-accent-secondary: var(--prompt-accent-secondary, var(--blue-500));
|
|
696
713
|
--_prompt-accent-mid: color-mix(in srgb, var(--_prompt-accent-primary) 52%, var(--_prompt-accent-secondary) 48%);
|
|
@@ -1259,13 +1276,6 @@ class k extends HTMLElement {
|
|
|
1259
1276
|
pointer-events: none;
|
|
1260
1277
|
margin-inline-end: var(--space-100);
|
|
1261
1278
|
}
|
|
1262
|
-
.actions-separator {
|
|
1263
|
-
margin-inline: var(--space-200);
|
|
1264
|
-
pointer-events: none;
|
|
1265
|
-
}
|
|
1266
|
-
.actions-separator[hidden] {
|
|
1267
|
-
display: none !important;
|
|
1268
|
-
}
|
|
1269
1279
|
.actions-slot mui-button {
|
|
1270
1280
|
--action-radius-x-small: var(--prompt-action-radius);
|
|
1271
1281
|
--action-radius-small: var(--prompt-action-radius);
|
|
@@ -1434,7 +1444,6 @@ class k extends HTMLElement {
|
|
|
1434
1444
|
</mui-icon-toggle>
|
|
1435
1445
|
</mui-button>
|
|
1436
1446
|
</slot>
|
|
1437
|
-
<mui-rule class="actions-separator" direction="vertical" length="var(--space-400)" weight="var(--stroke-size-100)" aria-hidden="true"></mui-rule>
|
|
1438
1447
|
<slot name="actions"></slot>
|
|
1439
1448
|
</div>
|
|
1440
1449
|
<div class="actions-slot actions-slot-right">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/* ================================================================================================== */
|
|
3
|
-
/* Don't edit directly • Generated on Fri, 27 Feb 2026
|
|
3
|
+
/* Don't edit directly • Generated on Fri, 27 Feb 2026 06:15:52 GMT • muibook.com */
|
|
4
4
|
/* ================================================================================================== */
|
|
5
5
|
|
|
6
6
|
/* ================================================================================================== */
|