@inertiaui/notifications-react 1.0.2 → 1.0.3
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/inertiaui-notifications.js +579 -570
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { isValidElement as e, useEffect as t, useId as n, useLayoutEffect as r, useMemo as i, useRef as a, useState as o, useSyncExternalStore as s } from "react";
|
|
2
|
+
import { createPortal as c } from "react-dom";
|
|
3
|
+
import { extendTailwindMerge as l } from "tailwind-merge";
|
|
4
|
+
import { animate as u, autoUpdateTopLayerPopover as d, cancelAnimations as f, createAnnouncer as p, createPopoverController as m, createTooltipController as h, isRightToLeft as g, positionTopLayerPopover as _, prefersReducedMotion as v, replacePlaceholders as y } from "@inertiaui/vanilla";
|
|
5
|
+
import { InfiniteScroll as b, Link as x, http as S, router as C, socketId as w, usePage as T } from "@inertiajs/react";
|
|
6
6
|
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
7
|
// ../js/types.ts
|
|
8
8
|
var k = [
|
|
@@ -158,7 +158,7 @@ function le(e, t, n, r, i) {
|
|
|
158
158
|
}), "pending";
|
|
159
159
|
}
|
|
160
160
|
// ../js/cn.ts
|
|
161
|
-
var ue =
|
|
161
|
+
var ue = l({ extend: { theme: { radius: ["iui-toast", "iui-inbox"] } } });
|
|
162
162
|
function G(...e) {
|
|
163
163
|
return ue(e.filter(Boolean).join(" "));
|
|
164
164
|
}
|
|
@@ -344,7 +344,7 @@ function Se(e) {
|
|
|
344
344
|
}
|
|
345
345
|
var Ce = (e) => Object.hasOwn(xe, e) ? xe[e] : void 0;
|
|
346
346
|
function we(e, t = {}) {
|
|
347
|
-
return typeof e == "function" ? e(t) :
|
|
347
|
+
return typeof e == "function" ? e(t) : y(e, t);
|
|
348
348
|
}
|
|
349
349
|
function Te(e, t = {}) {
|
|
350
350
|
let n = Ce(e);
|
|
@@ -2584,26 +2584,26 @@ function ei(e, t) {
|
|
|
2584
2584
|
}
|
|
2585
2585
|
var ti = 0;
|
|
2586
2586
|
function ni(e, t, n) {
|
|
2587
|
-
let { region: r, host: i } = t, a =
|
|
2587
|
+
let { region: r, host: i } = t, a = p({
|
|
2588
2588
|
polite: t.polite,
|
|
2589
2589
|
assertive: t.assertive
|
|
2590
2590
|
}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = ++ti, u = {
|
|
2591
2591
|
hover: `hover-${l}`,
|
|
2592
2592
|
focus: `focus-${l}`,
|
|
2593
2593
|
swipe: `swipe-${l}`
|
|
2594
|
-
}, d = null, f = null,
|
|
2594
|
+
}, d = null, f = null, m = 0, h = null, g = "pointer", _ = null, y = n().name, b = e.attach(y), x = () => e.getSnapshot().filter((e) => e.toaster === n().name && e.state !== "queued"), S = () => Array.from(r.querySelectorAll("[data-toast-list]")), C = (e) => r.querySelector(`[data-toast-id="${CSS.escape(e)}"]`), w = (e) => e instanceof Element ? e.closest("[data-toast-id]") ?? null : null, T = (e) => e.dataset.state !== "closing", E = () => x().reverse().map((e) => C(e.id)).filter((e) => e !== null && T(e)), D = (e) => (e.querySelector("[data-toast-body]")?.offsetHeight ?? e.offsetHeight) + (e.offsetHeight - e.clientHeight), O = () => {
|
|
2595
2595
|
let { visibleToasts: e, expand: t } = n();
|
|
2596
|
-
for (let n of
|
|
2596
|
+
for (let n of S()) {
|
|
2597
2597
|
let r = Array.from(n.querySelectorAll(":scope > [data-toast-id]")).filter(T), i = 0;
|
|
2598
2598
|
n.dataset.expanded = String(t || n === d || n.contains(document.activeElement)), r.forEach((t, n) => {
|
|
2599
2599
|
let a = D(t);
|
|
2600
|
-
t.style.setProperty("--toast-index", String(n)), t.style.setProperty("--toast-before", `${i}px`), t.style.setProperty("--toast-height", `${a}px`), t.style.zIndex = String(r.length - n), t.dataset.front = String(n === 0), t.dataset.overflow = String(n >= e), t !==
|
|
2600
|
+
t.style.setProperty("--toast-index", String(n)), t.style.setProperty("--toast-before", `${i}px`), t.style.setProperty("--toast-height", `${a}px`), t.style.zIndex = String(r.length - n), t.dataset.front = String(n === 0), t.dataset.overflow = String(n >= e), t !== _?.item && (delete t.dataset.swipeOut, t.style.removeProperty("--toast-swipe")), i += a;
|
|
2601
2601
|
}), n.style.setProperty("--toast-count", String(r.length)), n.style.setProperty("--toast-visible", String(Math.max(1, Math.min(r.length, e)))), n.style.setProperty("--toast-front-height", `${r[0] ? D(r[0]) : 0}px`), n.style.setProperty("--toast-heights", `${i}px`);
|
|
2602
2602
|
}
|
|
2603
2603
|
}, k = typeof ResizeObserver == "function" ? new ResizeObserver(() => O()) : void 0, A = /* @__PURE__ */ new WeakSet(), j = () => {
|
|
2604
|
-
let t = !
|
|
2605
|
-
for (let r of
|
|
2606
|
-
let i =
|
|
2604
|
+
let t = !v(), n = /* @__PURE__ */ new Set();
|
|
2605
|
+
for (let r of x()) {
|
|
2606
|
+
let i = C(r.id)?.querySelector("[data-toast-progress]"), a = e.timer(r.id);
|
|
2607
2607
|
if (!i || !a) continue;
|
|
2608
2608
|
n.add(r.id);
|
|
2609
2609
|
let o = Math.max(0, a.remaining / a.duration);
|
|
@@ -2632,17 +2632,17 @@ function ni(e, t, n) {
|
|
|
2632
2632
|
}, M = e.subscribe(j), N = () => {
|
|
2633
2633
|
f = null, e.resume(u.focus);
|
|
2634
2634
|
}, P = () => {
|
|
2635
|
-
let e = E(), t =
|
|
2636
|
-
N(), t ? t.focus() : n?.isConnected && (
|
|
2635
|
+
let e = E(), t = g === "pointer" ? void 0 : e[Math.min(m, e.length - 1)], n = h;
|
|
2636
|
+
N(), t ? t.focus() : n?.isConnected && (h = null, n.focus({ preventScroll: !0 }));
|
|
2637
2637
|
}, F = () => {
|
|
2638
|
-
f && (!f.isConnected || !T(f)) ? P() : r.contains(document.activeElement) || (
|
|
2638
|
+
f && (!f.isConnected || !T(f)) ? P() : r.contains(document.activeElement) || (h = null, N());
|
|
2639
2639
|
}, I = (t) => {
|
|
2640
|
-
t.relatedTarget instanceof HTMLElement && !r.contains(t.relatedTarget) && (
|
|
2640
|
+
t.relatedTarget instanceof HTMLElement && !r.contains(t.relatedTarget) && (h = t.relatedTarget), f = w(t.target), m = f ? E().indexOf(f) : 0, e.pause(u.focus), O();
|
|
2641
2641
|
}, L = () => void setTimeout(() => {
|
|
2642
2642
|
F(), O();
|
|
2643
2643
|
}), R = (t) => {
|
|
2644
|
-
|
|
2645
|
-
let n =
|
|
2644
|
+
g = "keyboard";
|
|
2645
|
+
let n = w(t.target);
|
|
2646
2646
|
t.key === "Escape" && n?.dataset.toastId !== void 0 && n.dataset.dismissible !== "false" && (t.preventDefault(), e.dismiss(n.dataset.toastId, "escape"));
|
|
2647
2647
|
}, z = (t) => {
|
|
2648
2648
|
d !== t && (d = t, t ? e.pause(u.hover) : e.resume(u.hover), O());
|
|
@@ -2657,9 +2657,9 @@ function ni(e, t, n) {
|
|
|
2657
2657
|
let n = te(e);
|
|
2658
2658
|
return n === "both" || (n === "right" ? t > 0 : t < 0);
|
|
2659
2659
|
}, ne = (e) => {
|
|
2660
|
-
if (
|
|
2661
|
-
let t =
|
|
2662
|
-
e.button === 0 && t && !n && t.dataset.dismissible !== "false" && T(t) && (
|
|
2660
|
+
if (g = e.pointerType === "touch" ? "touch" : "pointer", _?.active) return;
|
|
2661
|
+
let t = w(e.target), n = e.target instanceof Element && e.target.closest("a, button, input, select, textarea, [data-toast-no-swipe]");
|
|
2662
|
+
e.button === 0 && t && !n && t.dataset.dismissible !== "false" && T(t) && (_ = {
|
|
2663
2663
|
item: t,
|
|
2664
2664
|
pointerId: e.pointerId,
|
|
2665
2665
|
x: e.clientX,
|
|
@@ -2668,33 +2668,33 @@ function ni(e, t, n) {
|
|
|
2668
2668
|
active: !1
|
|
2669
2669
|
});
|
|
2670
2670
|
}, U = (t) => {
|
|
2671
|
-
if (!
|
|
2672
|
-
if (!
|
|
2673
|
-
|
|
2671
|
+
if (!_ || t.pointerId !== _.pointerId) return;
|
|
2672
|
+
if (!_.active && (!(t.buttons & 1) || !_.item.isConnected || !T(_.item))) {
|
|
2673
|
+
_ = null;
|
|
2674
2674
|
return;
|
|
2675
2675
|
}
|
|
2676
|
-
let n = t.clientX -
|
|
2677
|
-
if (!
|
|
2676
|
+
let n = t.clientX - _.x;
|
|
2677
|
+
if (!_.active) {
|
|
2678
2678
|
if (Math.abs(n) < 4) return;
|
|
2679
|
-
|
|
2679
|
+
_.active = !0, _.item.dataset.swiping = "true";
|
|
2680
2680
|
try {
|
|
2681
|
-
|
|
2681
|
+
_.item.setPointerCapture(t.pointerId);
|
|
2682
2682
|
} catch {}
|
|
2683
2683
|
e.pause(u.swipe);
|
|
2684
2684
|
}
|
|
2685
|
-
|
|
2686
|
-
let r = H(
|
|
2687
|
-
|
|
2685
|
+
_.dx = n;
|
|
2686
|
+
let r = H(_.item, n) ? n : Math.sign(n) * Math.min(Math.abs(n) * .15, 8);
|
|
2687
|
+
_.item.style.setProperty("--toast-swipe", `${r}px`);
|
|
2688
2688
|
}, re = (t) => {
|
|
2689
|
-
if (!
|
|
2690
|
-
let { item: n, dx: r, active: i } =
|
|
2691
|
-
|
|
2689
|
+
if (!_) return;
|
|
2690
|
+
let { item: n, dx: r, active: i } = _, a = n.dataset.toastId;
|
|
2691
|
+
_ = null, i && (delete n.dataset.swiping, e.resume(u.swipe), t && a !== void 0 ? (n.dataset.swipeOut = r > 0 ? "right" : "left", e.dismiss(a, "swipe")) : n.style.removeProperty("--toast-swipe"));
|
|
2692
2692
|
}, ie = (e) => {
|
|
2693
|
-
if (!
|
|
2694
|
-
let t = Math.abs(
|
|
2695
|
-
re(!n && H(
|
|
2693
|
+
if (!_ || e.pointerId !== _.pointerId) return;
|
|
2694
|
+
let t = Math.abs(_.dx) / Math.max(1, Date.now() - _.time), n = (window.getSelection?.()?.toString() ?? "") !== "";
|
|
2695
|
+
re(!n && H(_.item, _.dx) && (Math.abs(_.dx) >= qr || t > Jr));
|
|
2696
2696
|
}, ae = (e) => {
|
|
2697
|
-
e.pointerId ===
|
|
2697
|
+
e.pointerId === _?.pointerId && re(!1);
|
|
2698
2698
|
}, oe = (e) => {
|
|
2699
2699
|
let t = (t) => {
|
|
2700
2700
|
t.relatedTarget === e && t.stopImmediatePropagation();
|
|
@@ -2702,7 +2702,7 @@ function ni(e, t, n) {
|
|
|
2702
2702
|
ce && window.addEventListener("focusout", t, !0), e.focus(), window.removeEventListener("focusout", t, !0);
|
|
2703
2703
|
}, se = (e) => {
|
|
2704
2704
|
let { hotkey: t } = n(), i = t.length > 0 && t.every((t) => Wr.includes(t) ? e[t] : e.code === t), a = E()[0];
|
|
2705
|
-
i && a && (e.preventDefault(),
|
|
2705
|
+
i && a && (e.preventDefault(), g = "keyboard", document.activeElement instanceof HTMLElement && document.activeElement !== document.body && !r.contains(document.activeElement) && (h = document.activeElement), oe(a));
|
|
2706
2706
|
}, W = [], ce = !1, le = (e) => e.isConnected && (e instanceof HTMLDialogElement ? e.open && e.matches(":modal") : ce && e.matches(":popover-open")), ue = (e) => e instanceof HTMLElement && e !== i && e.hasAttribute("popover") && /^(alert)?dialog$/.test(e.getAttribute("role") ?? ""), G = (e) => {
|
|
2707
2707
|
let t = W.indexOf(e);
|
|
2708
2708
|
t !== -1 && W.splice(t, 1);
|
|
@@ -2735,7 +2735,7 @@ function ni(e, t, n) {
|
|
|
2735
2735
|
}, ge = (e) => e.stopPropagation(), J = (e) => {
|
|
2736
2736
|
e.relatedTarget instanceof Node && r.contains(e.relatedTarget) && e.stopPropagation();
|
|
2737
2737
|
}, _e = (e) => {
|
|
2738
|
-
let t =
|
|
2738
|
+
let t = w(e.target);
|
|
2739
2739
|
e.key === "Escape" && t && r.contains(t) && t.dataset.dismissible !== "false" && e.preventDefault();
|
|
2740
2740
|
}, ve = (e) => {
|
|
2741
2741
|
e.addEventListener("pointerdown", ge), e.addEventListener("focusin", ge), e.addEventListener("focusout", J), window.addEventListener("keydown", _e, !0), document.addEventListener("beforetoggle", me, !0), document.addEventListener("toggle", he, !0);
|
|
@@ -2761,12 +2761,12 @@ function ni(e, t, n) {
|
|
|
2761
2761
|
attributeFilter: ["open"]
|
|
2762
2762
|
}), fe()), be(n().aboveModals), r.addEventListener("focusin", I), r.addEventListener("focusout", L), r.addEventListener("keydown", R), r.addEventListener("pointerdown", ne), r.addEventListener("pointermove", U), r.addEventListener("pointerup", ie), r.addEventListener("pointercancel", ae), r.addEventListener("pointerover", ee), r.addEventListener("pointerout", V), document.addEventListener("keydown", se), {
|
|
2763
2763
|
update() {
|
|
2764
|
-
be(n().aboveModals), n().name !==
|
|
2765
|
-
let t =
|
|
2764
|
+
be(n().aboveModals), n().name !== y && (b(), y = n().name, b = e.attach(y));
|
|
2765
|
+
let t = x(), { typeLabels: r } = n(), i = !v();
|
|
2766
2766
|
for (let e of t) {
|
|
2767
2767
|
if (e.state === "closing") continue;
|
|
2768
2768
|
o.get(e.id) !== e.revision && (o.set(e.id, e.revision), a.announce($r(e, r), e.politeness ?? (e.type === "error" ? "assertive" : "polite")));
|
|
2769
|
-
let t =
|
|
2769
|
+
let t = C(e.id);
|
|
2770
2770
|
t && i && e.count > (s.get(e.id) ?? e.count) && typeof t.animate == "function" && t.animate([
|
|
2771
2771
|
{ scale: "1" },
|
|
2772
2772
|
{ scale: "1.03" },
|
|
@@ -2779,10 +2779,10 @@ function ni(e, t, n) {
|
|
|
2779
2779
|
n && k && !A.has(n) && (A.add(n), k.observe(n));
|
|
2780
2780
|
}
|
|
2781
2781
|
for (let e of [o, s]) for (let n of e.keys()) t.some((e) => e.id === n) || e.delete(n);
|
|
2782
|
-
F(), f && (
|
|
2782
|
+
F(), f && (m = E().indexOf(f)), _ && !_.item.isConnected && re(!1), d && !d.matches(":hover") && (d = null, e.resume(u.hover)), O(), j();
|
|
2783
2783
|
},
|
|
2784
2784
|
destroy() {
|
|
2785
|
-
r.removeEventListener("focusin", I), r.removeEventListener("focusout", L), r.removeEventListener("keydown", R), r.removeEventListener("pointerdown", ne), r.removeEventListener("pointermove", U), r.removeEventListener("pointerup", ie), r.removeEventListener("pointercancel", ae), r.removeEventListener("pointerover", ee), r.removeEventListener("pointerout", V), document.removeEventListener("keydown", se), be(!1), M(), k?.disconnect(), xe?.disconnect(), c.forEach((e) => e.animation?.cancel()), a.destroy(), e.resume(u.hover), e.resume(u.focus), e.resume(u.swipe),
|
|
2785
|
+
r.removeEventListener("focusin", I), r.removeEventListener("focusout", L), r.removeEventListener("keydown", R), r.removeEventListener("pointerdown", ne), r.removeEventListener("pointermove", U), r.removeEventListener("pointerup", ie), r.removeEventListener("pointercancel", ae), r.removeEventListener("pointerover", ee), r.removeEventListener("pointerout", V), document.removeEventListener("keydown", se), be(!1), M(), k?.disconnect(), xe?.disconnect(), c.forEach((e) => e.animation?.cancel()), a.destroy(), e.resume(u.hover), e.resume(u.focus), e.resume(u.swipe), b();
|
|
2786
2786
|
}
|
|
2787
2787
|
};
|
|
2788
2788
|
}
|
|
@@ -2837,10 +2837,19 @@ function Ki(e, t, n) {
|
|
|
2837
2837
|
}
|
|
2838
2838
|
// src/notifications.ts
|
|
2839
2839
|
function qi(e) {
|
|
2840
|
-
Mr(Ki(
|
|
2840
|
+
Mr(Ki(C, S, w), e);
|
|
2841
|
+
}
|
|
2842
|
+
function Ji() {
|
|
2843
|
+
let e;
|
|
2844
|
+
try {
|
|
2845
|
+
e = T().flash;
|
|
2846
|
+
} catch {}
|
|
2847
|
+
r(() => {
|
|
2848
|
+
qi(), e && gr(e);
|
|
2849
|
+
}, []);
|
|
2841
2850
|
}
|
|
2842
2851
|
// src/parts.tsx
|
|
2843
|
-
function
|
|
2852
|
+
function Yi({ className: e }) {
|
|
2844
2853
|
return /* @__PURE__ */ O("svg", {
|
|
2845
2854
|
viewBox: "0 0 20 20",
|
|
2846
2855
|
fill: "none",
|
|
@@ -2859,16 +2868,16 @@ function Ji({ className: e }) {
|
|
|
2859
2868
|
})]
|
|
2860
2869
|
});
|
|
2861
2870
|
}
|
|
2862
|
-
var
|
|
2863
|
-
function
|
|
2864
|
-
return
|
|
2871
|
+
var Xi = (t) => typeof t == "function" || typeof t == "object" && !!t && "$$typeof" in t && !e(t);
|
|
2872
|
+
function Zi(e, t) {
|
|
2873
|
+
return Xi(e) ? /* @__PURE__ */ D(e, {
|
|
2865
2874
|
className: t,
|
|
2866
2875
|
"aria-hidden": "true"
|
|
2867
2876
|
}) : e;
|
|
2868
2877
|
}
|
|
2869
2878
|
function $({ name: e, context: t, icons: n, resolver: r, className: i }) {
|
|
2870
2879
|
let a = ye(e, t, n, r);
|
|
2871
|
-
return a === void 0 ? e === "spinner" ? /* @__PURE__ */ D(
|
|
2880
|
+
return a === void 0 ? e === "spinner" ? /* @__PURE__ */ D(Yi, { className: i }) : /* @__PURE__ */ D("svg", {
|
|
2872
2881
|
viewBox: "0 0 20 20",
|
|
2873
2882
|
fill: "currentColor",
|
|
2874
2883
|
"aria-hidden": "true",
|
|
@@ -2878,106 +2887,105 @@ function $({ name: e, context: t, icons: n, resolver: r, className: i }) {
|
|
|
2878
2887
|
clipRule: "evenodd",
|
|
2879
2888
|
d: e
|
|
2880
2889
|
}, e))
|
|
2881
|
-
}) :
|
|
2890
|
+
}) : Zi(a, i);
|
|
2882
2891
|
}
|
|
2883
2892
|
// src/Toaster.tsx
|
|
2884
|
-
var
|
|
2885
|
-
function
|
|
2886
|
-
if (
|
|
2887
|
-
src:
|
|
2893
|
+
var Qi = [], $i = () => () => {};
|
|
2894
|
+
function ea({ toast: t, icons: n, resolver: r }) {
|
|
2895
|
+
if (t.image !== void 0) return /* @__PURE__ */ D("img", {
|
|
2896
|
+
src: t.image,
|
|
2888
2897
|
alt: "",
|
|
2889
2898
|
className: si
|
|
2890
2899
|
});
|
|
2891
|
-
if (
|
|
2892
|
-
let
|
|
2900
|
+
if (e(t.icon)) return t.icon;
|
|
2901
|
+
let i = (e, i) => ye(e, {
|
|
2893
2902
|
component: "Toaster",
|
|
2894
2903
|
part: i,
|
|
2895
|
-
toast:
|
|
2896
|
-
},
|
|
2897
|
-
if (
|
|
2898
|
-
if (
|
|
2904
|
+
toast: t
|
|
2905
|
+
}, n, r), a = (typeof t.icon == "string" ? i(t.icon, "icon") : void 0) ?? i(t.type, "type");
|
|
2906
|
+
if (a !== void 0) return Zi(a, "size-5");
|
|
2907
|
+
if (t.type === "loading") return /* @__PURE__ */ D($, {
|
|
2899
2908
|
name: "spinner",
|
|
2900
2909
|
context: {
|
|
2901
2910
|
component: "Toaster",
|
|
2902
2911
|
part: "type",
|
|
2903
|
-
toast:
|
|
2912
|
+
toast: t
|
|
2904
2913
|
},
|
|
2905
|
-
icons:
|
|
2906
|
-
resolver:
|
|
2914
|
+
icons: n,
|
|
2915
|
+
resolver: r,
|
|
2907
2916
|
className: ci
|
|
2908
2917
|
});
|
|
2909
|
-
let
|
|
2910
|
-
return
|
|
2918
|
+
let o = K(de, t.type);
|
|
2919
|
+
return o === void 0 ? /* @__PURE__ */ D("span", { className: oi }) : /* @__PURE__ */ D("svg", {
|
|
2911
2920
|
viewBox: "0 0 20 20",
|
|
2912
2921
|
fill: "currentColor",
|
|
2913
2922
|
className: "size-5",
|
|
2914
2923
|
children: /* @__PURE__ */ D("path", {
|
|
2915
2924
|
fillRule: "evenodd",
|
|
2916
2925
|
clipRule: "evenodd",
|
|
2917
|
-
d:
|
|
2926
|
+
d: o
|
|
2918
2927
|
})
|
|
2919
2928
|
});
|
|
2920
2929
|
}
|
|
2921
|
-
function
|
|
2922
|
-
|
|
2930
|
+
function ta({ position: e = "bottom-right", name: t, label: n, dismissLabel: i, hotkey: l = Ur, typeLabels: u = {}, visibleToasts: d = 3, expand: f = !1, progress: p = !1, icons: m = {}, iconResolver: h, classes: g = {}, renderToast: _, renderIcon: v, components: y = {}, aboveModals: b = !0 }) {
|
|
2931
|
+
Ji();
|
|
2932
|
+
let x = s(Q.subscribe, Q.getSnapshot, () => Qi), S = s($i, () => !0, () => !1), [C] = o(() => typeof document > "u" ? null : Object.assign(document.createElement("div"), { className: "iui-toaster-host" })), w = a(null), T = a(null), k = a(null), A = a(null), j = a({
|
|
2923
2933
|
name: t,
|
|
2924
|
-
hotkey:
|
|
2925
|
-
typeLabels:
|
|
2926
|
-
visibleToasts:
|
|
2927
|
-
expand:
|
|
2928
|
-
aboveModals:
|
|
2934
|
+
hotkey: l,
|
|
2935
|
+
typeLabels: u,
|
|
2936
|
+
visibleToasts: d,
|
|
2937
|
+
expand: f,
|
|
2938
|
+
aboveModals: b
|
|
2929
2939
|
});
|
|
2930
|
-
if (
|
|
2931
|
-
|
|
2940
|
+
if (r(() => {
|
|
2941
|
+
j.current = {
|
|
2932
2942
|
name: t,
|
|
2933
|
-
hotkey:
|
|
2934
|
-
typeLabels:
|
|
2935
|
-
visibleToasts:
|
|
2936
|
-
expand:
|
|
2937
|
-
aboveModals:
|
|
2943
|
+
hotkey: l,
|
|
2944
|
+
typeLabels: u,
|
|
2945
|
+
visibleToasts: d,
|
|
2946
|
+
expand: f,
|
|
2947
|
+
aboveModals: b
|
|
2938
2948
|
};
|
|
2939
|
-
}),
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
if (!T || !w) return;
|
|
2943
|
-
document.body.append(T);
|
|
2949
|
+
}), r(() => {
|
|
2950
|
+
if (!C || !S) return;
|
|
2951
|
+
document.body.append(C);
|
|
2944
2952
|
let e = ni(Q, {
|
|
2945
|
-
region:
|
|
2946
|
-
host:
|
|
2947
|
-
polite:
|
|
2948
|
-
assertive:
|
|
2949
|
-
}, () =>
|
|
2950
|
-
return
|
|
2951
|
-
e.destroy(),
|
|
2953
|
+
region: w.current,
|
|
2954
|
+
host: C,
|
|
2955
|
+
polite: T.current,
|
|
2956
|
+
assertive: k.current
|
|
2957
|
+
}, () => j.current);
|
|
2958
|
+
return A.current = e, () => {
|
|
2959
|
+
e.destroy(), A.current = null, C.remove();
|
|
2952
2960
|
};
|
|
2953
|
-
}, [
|
|
2954
|
-
let
|
|
2955
|
-
let t = () => Q.dismiss(e.id, "user"), n = (t, n) => Ir(e.id, t, n.nativeEvent),
|
|
2956
|
-
if (
|
|
2961
|
+
}, [C, S]), r(() => A.current?.update()), !C || !S) return null;
|
|
2962
|
+
let M = ei(x.filter((e) => e.toaster === t), e), N = (e) => {
|
|
2963
|
+
let t = () => Q.dismiss(e.id, "user"), n = (t, n) => Ir(e.id, t, n.nativeEvent), r = K(y, e.type);
|
|
2964
|
+
if (r) return /* @__PURE__ */ D(r, {
|
|
2957
2965
|
toast: e,
|
|
2958
2966
|
dismiss: t,
|
|
2959
2967
|
runAction: n
|
|
2960
2968
|
});
|
|
2961
|
-
if (
|
|
2969
|
+
if (_) return _(e, {
|
|
2962
2970
|
dismiss: t,
|
|
2963
2971
|
runAction: n
|
|
2964
2972
|
});
|
|
2965
|
-
let a = Qr(e.type,
|
|
2973
|
+
let a = Qr(e.type, u);
|
|
2966
2974
|
return /* @__PURE__ */ O(E, { children: [
|
|
2967
2975
|
e.icon !== !1 && /* @__PURE__ */ D("span", {
|
|
2968
2976
|
"aria-hidden": "true",
|
|
2969
|
-
className: G("flex size-5 shrink-0 items-center justify-center", K(ai, e.type) ?? ai.default,
|
|
2970
|
-
children:
|
|
2977
|
+
className: G("flex size-5 shrink-0 items-center justify-center", K(ai, e.type) ?? ai.default, g.icon),
|
|
2978
|
+
children: v ? v(e) : /* @__PURE__ */ D(ea, {
|
|
2971
2979
|
toast: e,
|
|
2972
|
-
icons:
|
|
2973
|
-
resolver:
|
|
2980
|
+
icons: m,
|
|
2981
|
+
resolver: h
|
|
2974
2982
|
})
|
|
2975
2983
|
}),
|
|
2976
2984
|
/* @__PURE__ */ O("div", {
|
|
2977
2985
|
className: "min-w-0 flex-1",
|
|
2978
2986
|
children: [
|
|
2979
2987
|
/* @__PURE__ */ O("p", {
|
|
2980
|
-
className: G(li,
|
|
2988
|
+
className: G(li, g.title),
|
|
2981
2989
|
children: [
|
|
2982
2990
|
a && /* @__PURE__ */ O("span", {
|
|
2983
2991
|
className: "sr-only",
|
|
@@ -2993,7 +3001,7 @@ function ea({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
2993
3001
|
]
|
|
2994
3002
|
}),
|
|
2995
3003
|
e.description && /* @__PURE__ */ D("p", {
|
|
2996
|
-
className: G("text-iui-toast-muted-foreground mt-1 text-sm wrap-break-word",
|
|
3004
|
+
className: G("text-iui-toast-muted-foreground mt-1 text-sm wrap-break-word", g.description),
|
|
2997
3005
|
children: e.description
|
|
2998
3006
|
}),
|
|
2999
3007
|
e.progress !== void 0 && /* @__PURE__ */ D("div", {
|
|
@@ -3010,13 +3018,13 @@ function ea({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
3010
3018
|
})
|
|
3011
3019
|
}),
|
|
3012
3020
|
e.actions.length > 0 && /* @__PURE__ */ D("div", {
|
|
3013
|
-
className: G("mt-3 flex flex-wrap gap-2",
|
|
3021
|
+
className: G("mt-3 flex flex-wrap gap-2", g.actions),
|
|
3014
3022
|
children: e.actions.map((t, r) => {
|
|
3015
3023
|
let i = H(t), a = {
|
|
3016
3024
|
"aria-disabled": e.pendingAction !== void 0 || void 0,
|
|
3017
3025
|
"aria-busy": e.pendingAction === r || void 0,
|
|
3018
3026
|
"data-toast-action": "",
|
|
3019
|
-
className: G(r === 0 ? "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-toast-action text-iui-toast-action hover:bg-iui-toast-action/10 border" : "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-toast-border hover:bg-iui-toast-control-hover border",
|
|
3027
|
+
className: G(r === 0 ? "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-toast-action text-iui-toast-action hover:bg-iui-toast-action/10 border" : "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-toast-border hover:bg-iui-toast-control-hover border", g.action),
|
|
3020
3028
|
onClick: (e) => n(r, e)
|
|
3021
3029
|
}, o = /* @__PURE__ */ O(E, { children: [e.pendingAction === r && /* @__PURE__ */ D($, {
|
|
3022
3030
|
name: "spinner",
|
|
@@ -3026,8 +3034,8 @@ function ea({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
3026
3034
|
toast: e,
|
|
3027
3035
|
action: t
|
|
3028
3036
|
},
|
|
3029
|
-
icons:
|
|
3030
|
-
resolver:
|
|
3037
|
+
icons: m,
|
|
3038
|
+
resolver: h,
|
|
3031
3039
|
className: "size-3.5 motion-safe:animate-spin"
|
|
3032
3040
|
}), t.label] });
|
|
3033
3041
|
return i === void 0 ? /* @__PURE__ */ D("button", {
|
|
@@ -3047,8 +3055,8 @@ function ea({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
3047
3055
|
}),
|
|
3048
3056
|
e.dismissible && /* @__PURE__ */ D("button", {
|
|
3049
3057
|
type: "button",
|
|
3050
|
-
"aria-label": Zr(
|
|
3051
|
-
className: G("rounded-iui-toast text-iui-toast-icon hover:bg-iui-toast-control-hover hover:text-iui-toast-icon-hover focus-visible:ring-iui-toast-ring -m-1 shrink-0 p-1 focus-visible:ring-2 focus-visible:outline-hidden",
|
|
3058
|
+
"aria-label": Zr(i, e),
|
|
3059
|
+
className: G("rounded-iui-toast text-iui-toast-icon hover:bg-iui-toast-control-hover hover:text-iui-toast-icon-hover focus-visible:ring-iui-toast-ring -m-1 shrink-0 p-1 focus-visible:ring-2 focus-visible:outline-hidden", g.dismiss),
|
|
3052
3060
|
onClick: t,
|
|
3053
3061
|
children: /* @__PURE__ */ D($, {
|
|
3054
3062
|
name: "dismiss",
|
|
@@ -3057,21 +3065,21 @@ function ea({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
3057
3065
|
part: "dismiss",
|
|
3058
3066
|
toast: e
|
|
3059
3067
|
},
|
|
3060
|
-
icons:
|
|
3061
|
-
resolver:
|
|
3068
|
+
icons: m,
|
|
3069
|
+
resolver: h,
|
|
3062
3070
|
className: "size-4"
|
|
3063
3071
|
})
|
|
3064
3072
|
})
|
|
3065
3073
|
] });
|
|
3066
3074
|
};
|
|
3067
|
-
return
|
|
3068
|
-
ref:
|
|
3069
|
-
"aria-label": Xr(n,
|
|
3075
|
+
return c(/* @__PURE__ */ O("section", {
|
|
3076
|
+
ref: w,
|
|
3077
|
+
"aria-label": Xr(n, l),
|
|
3070
3078
|
tabIndex: -1,
|
|
3071
3079
|
className: "iui-toaster outline-none",
|
|
3072
3080
|
"data-toaster": t,
|
|
3073
3081
|
children: [
|
|
3074
|
-
|
|
3082
|
+
M.map(([e, t]) => /* @__PURE__ */ D("ol", {
|
|
3075
3083
|
role: "list",
|
|
3076
3084
|
"data-toast-list": "",
|
|
3077
3085
|
"data-position": e,
|
|
@@ -3083,81 +3091,81 @@ function ea({ position: e = "bottom-right", name: t, label: n, dismissLabel: r,
|
|
|
3083
3091
|
"data-dismissible": String(e.dismissible),
|
|
3084
3092
|
"aria-busy": e.type === "loading" || void 0,
|
|
3085
3093
|
tabIndex: 0,
|
|
3086
|
-
className: G(ri,
|
|
3094
|
+
className: G(ri, g.toast),
|
|
3087
3095
|
children: [/* @__PURE__ */ D("div", {
|
|
3088
3096
|
"data-toast-body": "",
|
|
3089
3097
|
className: ii,
|
|
3090
|
-
children:
|
|
3091
|
-
}),
|
|
3098
|
+
children: N(e)
|
|
3099
|
+
}), p && e.duration !== null && /* @__PURE__ */ D("div", {
|
|
3092
3100
|
"data-toast-progress": "",
|
|
3093
3101
|
"aria-hidden": "true",
|
|
3094
|
-
className: G("iui-toast-progress", K(ai, e.type) ?? ai.default,
|
|
3102
|
+
className: G("iui-toast-progress", K(ai, e.type) ?? ai.default, g.progress)
|
|
3095
3103
|
})]
|
|
3096
3104
|
}, e.id))
|
|
3097
3105
|
}, e)),
|
|
3098
3106
|
/* @__PURE__ */ D("div", {
|
|
3099
|
-
ref:
|
|
3107
|
+
ref: T,
|
|
3100
3108
|
role: "status",
|
|
3101
3109
|
"aria-live": "polite",
|
|
3102
3110
|
"aria-atomic": "true",
|
|
3103
3111
|
className: "sr-only"
|
|
3104
3112
|
}),
|
|
3105
3113
|
/* @__PURE__ */ D("div", {
|
|
3106
|
-
ref:
|
|
3114
|
+
ref: k,
|
|
3107
3115
|
"aria-live": "assertive",
|
|
3108
3116
|
"aria-atomic": "true",
|
|
3109
3117
|
className: "sr-only"
|
|
3110
3118
|
})
|
|
3111
3119
|
]
|
|
3112
|
-
}),
|
|
3120
|
+
}), C);
|
|
3113
3121
|
}
|
|
3114
3122
|
// ../js/notificationCenter.ts
|
|
3115
|
-
var
|
|
3123
|
+
var na = [
|
|
3116
3124
|
"all",
|
|
3117
3125
|
"unread",
|
|
3118
3126
|
"snoozed",
|
|
3119
3127
|
"archived"
|
|
3120
|
-
],
|
|
3128
|
+
], ra = {
|
|
3121
3129
|
all: "empty",
|
|
3122
3130
|
unread: "emptyUnread",
|
|
3123
3131
|
snoozed: "emptySnoozed",
|
|
3124
3132
|
archived: "emptyArchived"
|
|
3125
|
-
},
|
|
3126
|
-
function
|
|
3127
|
-
return Object.hasOwn(
|
|
3133
|
+
}, ia = (e) => [...na, ...Object.keys(e)], aa = (e) => ia(e.tabs).filter((t) => Ne(t, e.allowedActions));
|
|
3134
|
+
function oa(e, t, n) {
|
|
3135
|
+
return Object.hasOwn(ra, e) ? Z(t[e]) : Object.hasOwn(n, e) ? n[e].label : e;
|
|
3128
3136
|
}
|
|
3129
|
-
var
|
|
3137
|
+
var sa = (e, t) => Z(t[Object.hasOwn(ra, e) ? ra[e] : "empty"]), ca = (e, t, n) => e.map((e) => ({
|
|
3130
3138
|
filter: e,
|
|
3131
|
-
label:
|
|
3139
|
+
label: oa(e, n, t.tabs),
|
|
3132
3140
|
selected: t.filter === e,
|
|
3133
3141
|
count: e === "unread" ? t.counts.unread : null
|
|
3134
|
-
})),
|
|
3135
|
-
function
|
|
3142
|
+
})), la = (e, t) => t.length > 0 ? e.filter((e) => !t.includes(e.id)) : e;
|
|
3143
|
+
function ua(e, t) {
|
|
3136
3144
|
return e.status === "idle" || e.status === "loading" && t === 0 ? "loading" : e.status === "error" ? "error" : t === 0 ? "empty" : "items";
|
|
3137
3145
|
}
|
|
3138
|
-
function
|
|
3146
|
+
function da(e, t = e.category) {
|
|
3139
3147
|
Ie({
|
|
3140
3148
|
...e,
|
|
3141
3149
|
category: t
|
|
3142
3150
|
}) > 0 && X.markAllAsRead({ category: t });
|
|
3143
3151
|
}
|
|
3144
|
-
var
|
|
3145
|
-
function
|
|
3152
|
+
var fa = (e) => e.filter === "all" && e.allowedActions.includes("archive");
|
|
3153
|
+
function pa(e, t) {
|
|
3146
3154
|
e.length > 0 && X.archiveAll({ category: t });
|
|
3147
3155
|
}
|
|
3148
|
-
function
|
|
3156
|
+
function ma(e, t, n, r) {
|
|
3149
3157
|
let i = new URL(e, "http://localhost"), a = i.searchParams;
|
|
3150
3158
|
return a.delete("filter"), a.delete("category"), r !== void 0 && a.delete(r), t !== "all" && a.set("filter", t), n !== null && a.set("category", n), `${i.pathname}${i.search}`;
|
|
3151
3159
|
}
|
|
3152
|
-
function
|
|
3160
|
+
function ha(e, t, n, r) {
|
|
3153
3161
|
let i = new URL(e, "http://localhost").searchParams, a = i.get("filter");
|
|
3154
3162
|
return {
|
|
3155
|
-
filter: n ?? (a !== null &&
|
|
3163
|
+
filter: n ?? (a !== null && aa(t).includes(a) ? a : "all"),
|
|
3156
3164
|
category: r === void 0 ? i.get("category") || null : r
|
|
3157
3165
|
};
|
|
3158
3166
|
}
|
|
3159
|
-
var
|
|
3160
|
-
function
|
|
3167
|
+
var ga = (e, t, n, r) => Z(e.pausedUntil, { time: mt(t, n, r) }), _a = (e, t, n) => mt(ft(e.preset, new Date(t)), t, n);
|
|
3168
|
+
function va(e, t) {
|
|
3161
3169
|
let n = !t.includes("snooze") || e === "archived" ? [] : [e === "snoozed" ? {
|
|
3162
3170
|
action: "unsnooze",
|
|
3163
3171
|
icon: "unsnooze",
|
|
@@ -3195,12 +3203,12 @@ function _a(e, t) {
|
|
|
3195
3203
|
...i
|
|
3196
3204
|
];
|
|
3197
3205
|
}
|
|
3198
|
-
var
|
|
3199
|
-
function
|
|
3206
|
+
var ya = (e, t, n = /* @__PURE__ */ new Date()) => e ? e(n) : lt(t, n);
|
|
3207
|
+
function ba(e, t, n) {
|
|
3200
3208
|
let r = e.filter((e) => e !== t);
|
|
3201
3209
|
return n ? [...r, t] : r;
|
|
3202
3210
|
}
|
|
3203
|
-
function
|
|
3211
|
+
function xa(e, t, { scroller: n, listed: r }) {
|
|
3204
3212
|
let i = [], a = (e) => {
|
|
3205
3213
|
i = e, t(e);
|
|
3206
3214
|
}, o = n ?? window, s = () => n ? n.scrollTop > 0 : e.getBoundingClientRect().top < 0, c = X.onArrival((t) => {
|
|
@@ -3224,8 +3232,8 @@ function ba(e, t, { scroller: n, listed: r }) {
|
|
|
3224
3232
|
}
|
|
3225
3233
|
};
|
|
3226
3234
|
}
|
|
3227
|
-
var
|
|
3228
|
-
function
|
|
3235
|
+
var Sa = 1e3, Ca = 250;
|
|
3236
|
+
function wa(e, t, n = e) {
|
|
3229
3237
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a = [], o, s = () => {
|
|
3230
3238
|
o = void 0;
|
|
3231
3239
|
let e = a, n = t().filter((t) => e.includes(t.id));
|
|
@@ -3235,11 +3243,11 @@ function Ca(e, t, n = e) {
|
|
|
3235
3243
|
}, l = (e) => {
|
|
3236
3244
|
r.delete(e);
|
|
3237
3245
|
let t = e.dataset.inboxId;
|
|
3238
|
-
t !== void 0 && e.dataset.seen === "false" && e.isConnected && (u.unobserve(e), i.delete(e), a.push(t), o ??= setTimeout(s,
|
|
3246
|
+
t !== void 0 && e.dataset.seen === "false" && e.isConnected && (u.unobserve(e), i.delete(e), a.push(t), o ??= setTimeout(s, Ca));
|
|
3239
3247
|
}, u = new IntersectionObserver((e) => {
|
|
3240
3248
|
for (let t of e) {
|
|
3241
3249
|
let e = t.target, n = t.rootBounds !== null && t.intersectionRect.height >= t.rootBounds.height / 2;
|
|
3242
|
-
t.isIntersecting && (t.intersectionRatio >= .5 || n) ? r.set(e, r.get(e) ?? setTimeout(() => l(e),
|
|
3250
|
+
t.isIntersecting && (t.intersectionRatio >= .5 || n) ? r.set(e, r.get(e) ?? setTimeout(() => l(e), Sa)) : c(e);
|
|
3243
3251
|
}
|
|
3244
3252
|
}, {
|
|
3245
3253
|
root: n,
|
|
@@ -3261,7 +3269,7 @@ function Ca(e, t, n = e) {
|
|
|
3261
3269
|
f.disconnect(), u.disconnect(), r.forEach((e) => clearTimeout(e)), o !== void 0 && (clearTimeout(o), s());
|
|
3262
3270
|
} };
|
|
3263
3271
|
}
|
|
3264
|
-
function
|
|
3272
|
+
function Ta(e, t) {
|
|
3265
3273
|
let n = (e.target instanceof Element ? e.target : null)?.closest("[data-inbox-link], [data-inbox-action]"), r = n?.closest("[data-inbox-item]")?.dataset.inboxId, i = r === void 0 ? void 0 : t.find((e) => e.id === r);
|
|
3266
3274
|
if (!n || !i) return;
|
|
3267
3275
|
if (!n.hasAttribute("data-inbox-action")) return { item: i };
|
|
@@ -3271,7 +3279,7 @@ function wa(e, t) {
|
|
|
3271
3279
|
action: o
|
|
3272
3280
|
} : void 0;
|
|
3273
3281
|
}
|
|
3274
|
-
var
|
|
3282
|
+
var Ea = 160, Da = [
|
|
3275
3283
|
"position",
|
|
3276
3284
|
"box-sizing",
|
|
3277
3285
|
"inset",
|
|
@@ -3287,7 +3295,7 @@ var Ta = 160, Ea = [
|
|
|
3287
3295
|
"overflow-y",
|
|
3288
3296
|
"overscroll-behavior"
|
|
3289
3297
|
];
|
|
3290
|
-
function
|
|
3298
|
+
function Oa(e, t, n) {
|
|
3291
3299
|
let r, i = null, a, o = t.querySelector("[data-inbox-scroller]"), s = o !== null && typeof ResizeObserver == "function" ? new ResizeObserver(() => {
|
|
3292
3300
|
o.offsetHeight > 0 && o.querySelector(":scope > [role=\"status\"]") === null && t.style.setProperty("--inbox-list-height", `${o.offsetHeight}px`);
|
|
3293
3301
|
}) : void 0;
|
|
@@ -3298,33 +3306,33 @@ function Da(e, t, n) {
|
|
|
3298
3306
|
}, l = () => {
|
|
3299
3307
|
if (!t.matches(":popover-open")) return;
|
|
3300
3308
|
if (getComputedStyle(t).getPropertyValue("--inbox-layout").trim() === "sheet") {
|
|
3301
|
-
a?.(), a = void 0,
|
|
3309
|
+
a?.(), a = void 0, Da.forEach((e) => t.style.removeProperty(e)), delete t.dataset.side;
|
|
3302
3310
|
return;
|
|
3303
3311
|
}
|
|
3304
|
-
let { placement: r } =
|
|
3312
|
+
let { placement: r } = _(e, t, {
|
|
3305
3313
|
placement: n.placement(),
|
|
3306
3314
|
offset: c("--inbox-gap", 8),
|
|
3307
3315
|
viewportMargin: c("--inbox-offset", 8),
|
|
3308
3316
|
anchorPositioning: !1
|
|
3309
3317
|
});
|
|
3310
|
-
t.dataset.side = r.split("-")[0], a ??=
|
|
3311
|
-
}, u = () => void (a === void 0 && l()),
|
|
3318
|
+
t.dataset.side = r.split("-")[0], a ??= d(e, t, l);
|
|
3319
|
+
}, u = () => void (a === void 0 && l()), f = (e) => {
|
|
3312
3320
|
e.newState === "open" && requestAnimationFrame(() => a === void 0 && l());
|
|
3313
|
-
},
|
|
3321
|
+
}, p = (r) => {
|
|
3314
3322
|
let i = r.newState === "open";
|
|
3315
3323
|
i ? (a === void 0 && l(), window.addEventListener("resize", u), t.contains(document.activeElement) || t.focus({ preventScroll: !0 })) : (a?.(), a = void 0, window.removeEventListener("resize", u)), e.setAttribute("aria-expanded", String(i)), n.onToggle(i);
|
|
3316
|
-
},
|
|
3324
|
+
}, m = (n) => {
|
|
3317
3325
|
let r = n.relatedTarget;
|
|
3318
3326
|
r instanceof Node && !t.contains(r) && !e.contains(r) && t.matches(":popover-open") && t.hidePopover();
|
|
3319
3327
|
};
|
|
3320
|
-
return t.addEventListener("beforetoggle",
|
|
3328
|
+
return t.addEventListener("beforetoggle", f), t.addEventListener("toggle", p), t.addEventListener("focusout", m), {
|
|
3321
3329
|
observe(e) {
|
|
3322
3330
|
let t = e?.closest("[data-inbox-scroller]") ?? null;
|
|
3323
3331
|
r && t === i || (r?.disconnect(), i = t, r = typeof IntersectionObserver == "function" ? new IntersectionObserver((e) => {
|
|
3324
3332
|
e.some((e) => e.isIntersecting) && n.onEndReached();
|
|
3325
3333
|
}, {
|
|
3326
3334
|
root: t,
|
|
3327
|
-
rootMargin: `0px 0px ${
|
|
3335
|
+
rootMargin: `0px 0px ${Ea}px 0px`
|
|
3328
3336
|
}) : void 0), r?.disconnect(), e && r?.observe(e);
|
|
3329
3337
|
},
|
|
3330
3338
|
place: l,
|
|
@@ -3332,11 +3340,11 @@ function Da(e, t, n) {
|
|
|
3332
3340
|
t.matches(":popover-open") && t.hidePopover();
|
|
3333
3341
|
},
|
|
3334
3342
|
destroy() {
|
|
3335
|
-
r?.disconnect(), s?.disconnect(), a?.(), t.removeEventListener("beforetoggle",
|
|
3343
|
+
r?.disconnect(), s?.disconnect(), a?.(), t.removeEventListener("beforetoggle", f), t.removeEventListener("toggle", p), t.removeEventListener("focusout", m), window.removeEventListener("resize", u);
|
|
3336
3344
|
}
|
|
3337
3345
|
};
|
|
3338
3346
|
}
|
|
3339
|
-
var
|
|
3347
|
+
var ka = {
|
|
3340
3348
|
j: "next",
|
|
3341
3349
|
arrowdown: "next",
|
|
3342
3350
|
k: "previous",
|
|
@@ -3346,15 +3354,15 @@ var Oa = {
|
|
|
3346
3354
|
h: "snooze",
|
|
3347
3355
|
x: "select",
|
|
3348
3356
|
enter: "open"
|
|
3349
|
-
},
|
|
3357
|
+
}, Aa = {
|
|
3350
3358
|
read: "[data-inbox-toggle-read]",
|
|
3351
3359
|
archive: "[data-inbox-toggle-archive]",
|
|
3352
3360
|
snooze: "[data-inbox-snooze]",
|
|
3353
3361
|
select: "[data-inbox-select]",
|
|
3354
3362
|
open: "[data-inbox-link]"
|
|
3355
3363
|
};
|
|
3356
|
-
function
|
|
3357
|
-
let n =
|
|
3364
|
+
function ja(e, t) {
|
|
3365
|
+
let n = ka[e.key.toLowerCase()], r = e.target instanceof HTMLElement ? e.target : null;
|
|
3358
3366
|
if (!n || !r || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey || r.closest("input:not([type=\"checkbox\"]), textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"tab\"]")) return;
|
|
3359
3367
|
let i = [...t.querySelectorAll("[data-inbox-item]")], a = r.closest("[data-inbox-item]"), o = a ? i.indexOf(a) : -1;
|
|
3360
3368
|
if ((n === "open" || e.key.startsWith("Arrow")) && r !== a && r !== t) return;
|
|
@@ -3363,10 +3371,10 @@ function Aa(e, t) {
|
|
|
3363
3371
|
t && (e.preventDefault(), t.focus());
|
|
3364
3372
|
return;
|
|
3365
3373
|
}
|
|
3366
|
-
let s = a?.querySelector(
|
|
3374
|
+
let s = a?.querySelector(Aa[n]);
|
|
3367
3375
|
a && s && (e.preventDefault(), s.click());
|
|
3368
3376
|
}
|
|
3369
|
-
function
|
|
3377
|
+
function Ma(e, t = () => e) {
|
|
3370
3378
|
let n, r = (t) => e.querySelector(`[data-inbox-item][data-inbox-id="${CSS.escape(t)}"]`), i = () => Array.from(e.querySelectorAll("[data-inbox-item]"), (e) => e.dataset.inboxId ?? ""), a = () => {
|
|
3371
3379
|
let t = document.activeElement, r = t instanceof HTMLElement && e.contains(t) ? t.closest("[data-inbox-item]")?.dataset.inboxId : void 0;
|
|
3372
3380
|
n = r === void 0 ? void 0 : {
|
|
@@ -3397,17 +3405,17 @@ function ja(e, t = () => e) {
|
|
|
3397
3405
|
e.removeEventListener("focusin", a), e.removeEventListener("focusout", o), s?.disconnect();
|
|
3398
3406
|
};
|
|
3399
3407
|
}
|
|
3400
|
-
function
|
|
3408
|
+
function Na(e, t, n, r, i = !1) {
|
|
3401
3409
|
let a = t > 0 ? Z(e.bellNew, {
|
|
3402
3410
|
count: St(t, n, r),
|
|
3403
3411
|
number: t
|
|
3404
3412
|
}) : Z(e.bell);
|
|
3405
3413
|
return i ? Z(e.bellPaused, { label: a }) : a;
|
|
3406
3414
|
}
|
|
3407
|
-
function
|
|
3415
|
+
function Pa(e) {
|
|
3408
3416
|
return e.trim().split(/\s+/).slice(0, 2).map((e) => Array.from(e)[0]?.toLocaleUpperCase() ?? "").join("");
|
|
3409
3417
|
}
|
|
3410
|
-
function
|
|
3418
|
+
function Fa(e, t, n, r = !1) {
|
|
3411
3419
|
let i = n.indexOf(t), a = {
|
|
3412
3420
|
ArrowRight: r ? -1 : 1,
|
|
3413
3421
|
ArrowLeft: r ? 1 : -1
|
|
@@ -3415,24 +3423,24 @@ function Pa(e, t, n, r = !1) {
|
|
|
3415
3423
|
return a === void 0 ? e === "Home" ? n[0] : e === "End" ? n.at(-1) : void 0 : n[(i + a + n.length) % n.length];
|
|
3416
3424
|
}
|
|
3417
3425
|
// ../js/overlay.ts
|
|
3418
|
-
var
|
|
3419
|
-
function
|
|
3426
|
+
var Ia = () => typeof HTMLElement < "u" && "showPopover" in HTMLElement.prototype, La = null;
|
|
3427
|
+
function Ra(e) {
|
|
3420
3428
|
let t = null, n = (n) => {
|
|
3421
|
-
n &&
|
|
3429
|
+
n && La !== t ? (La?.hide(), La = t) : !n && La === t && (La = null), e.onOpenChange(n);
|
|
3422
3430
|
}, r = (t) => {
|
|
3423
3431
|
let n = e.tooltip();
|
|
3424
|
-
if (n) return
|
|
3432
|
+
if (n) return f(n), v() ? void 0 : u(n, t ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }], {
|
|
3425
3433
|
duration: t ? 150 : 75,
|
|
3426
3434
|
easing: t ? "out" : "in"
|
|
3427
3435
|
});
|
|
3428
|
-
}, i = () => t ??=
|
|
3436
|
+
}, i = () => t ??= h({
|
|
3429
3437
|
...e,
|
|
3430
3438
|
onOpenChange: n,
|
|
3431
|
-
onMount: ({ popover: e }) => () =>
|
|
3439
|
+
onMount: ({ popover: e }) => () => f(e),
|
|
3432
3440
|
transition: r
|
|
3433
3441
|
});
|
|
3434
3442
|
return {
|
|
3435
|
-
native:
|
|
3443
|
+
native: Ia(),
|
|
3436
3444
|
onPointerEnter: (e) => {
|
|
3437
3445
|
e.pointerType !== "touch" && i().onMouseEnter();
|
|
3438
3446
|
},
|
|
@@ -3444,31 +3452,31 @@ function La(e) {
|
|
|
3444
3452
|
onFocusOut: (e) => t?.onFocusOut(e),
|
|
3445
3453
|
mount: () => t?.mount(),
|
|
3446
3454
|
cleanup: () => {
|
|
3447
|
-
t?.cleanup(),
|
|
3455
|
+
t?.cleanup(), La === t && (La = null);
|
|
3448
3456
|
}
|
|
3449
3457
|
};
|
|
3450
3458
|
}
|
|
3451
3459
|
// src/Tooltip.tsx
|
|
3452
|
-
function
|
|
3453
|
-
let [
|
|
3454
|
-
reference: () =>
|
|
3455
|
-
tooltip: () =>
|
|
3456
|
-
onOpenChange:
|
|
3460
|
+
function za({ text: e, shortcut: t, children: n }) {
|
|
3461
|
+
let [i, s] = o(!1), c = a(null), l = a(null), u = a(null), d = () => u.current ??= Ra({
|
|
3462
|
+
reference: () => c.current,
|
|
3463
|
+
tooltip: () => l.current,
|
|
3464
|
+
onOpenChange: s
|
|
3457
3465
|
});
|
|
3458
|
-
return
|
|
3459
|
-
|
|
3460
|
-
}, [
|
|
3461
|
-
ref:
|
|
3466
|
+
return r(() => () => u.current?.cleanup(), []), r(() => {
|
|
3467
|
+
i && u.current?.mount();
|
|
3468
|
+
}, [i]), /* @__PURE__ */ O("span", {
|
|
3469
|
+
ref: c,
|
|
3462
3470
|
className: hi,
|
|
3463
|
-
onPointerEnter: (e) =>
|
|
3464
|
-
onPointerLeave: () =>
|
|
3465
|
-
onPointerDown: () =>
|
|
3466
|
-
onFocus: (e) =>
|
|
3467
|
-
onBlur: (e) =>
|
|
3468
|
-
children: [n,
|
|
3469
|
-
ref:
|
|
3471
|
+
onPointerEnter: (e) => d().onPointerEnter(e.nativeEvent),
|
|
3472
|
+
onPointerLeave: () => d().onPointerLeave(),
|
|
3473
|
+
onPointerDown: () => d().onPointerDown(),
|
|
3474
|
+
onFocus: (e) => d().onFocusIn(e.nativeEvent),
|
|
3475
|
+
onBlur: (e) => d().onFocusOut(e.nativeEvent),
|
|
3476
|
+
children: [n, i && /* @__PURE__ */ O("span", {
|
|
3477
|
+
ref: l,
|
|
3470
3478
|
role: "tooltip",
|
|
3471
|
-
popover:
|
|
3479
|
+
popover: Ia() ? "manual" : void 0,
|
|
3472
3480
|
"data-inbox-tooltip": "",
|
|
3473
3481
|
className: "bg-iui-inbox-tooltip text-iui-inbox-tooltip-foreground pointer-events-none m-0 flex w-max max-w-xs items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium shadow-md",
|
|
3474
3482
|
children: [e, t && /* @__PURE__ */ D("kbd", {
|
|
@@ -3479,17 +3487,17 @@ function Ra({ text: e, shortcut: t, children: n }) {
|
|
|
3479
3487
|
});
|
|
3480
3488
|
}
|
|
3481
3489
|
// src/InboxHeader.tsx
|
|
3482
|
-
function
|
|
3483
|
-
let T =
|
|
3484
|
-
...
|
|
3485
|
-
category:
|
|
3486
|
-
}), F =
|
|
3487
|
-
filter:
|
|
3488
|
-
allowedActions:
|
|
3489
|
-
}), I =
|
|
3490
|
+
function Ba({ component: e, state: i, filter: s, category: c, items: l, labels: u, icons: d, iconResolver: f, classes: p, locale: h, maxCount: _ = 99, now: v, panel: y, href: b, open: S = !0, renderHeader: C, renderTab: w }) {
|
|
3491
|
+
let T = n(), k = n(), A = (e) => Z(u[e]), j = aa(i), M = [[null, A("allCategories")], ...Object.entries(i.categoryFilter)], N = M.length > 1, P = Ie({
|
|
3492
|
+
...i,
|
|
3493
|
+
category: c
|
|
3494
|
+
}), F = fa({
|
|
3495
|
+
filter: s,
|
|
3496
|
+
allowedActions: i.allowedActions
|
|
3497
|
+
}), I = s === "all" || s === "unread", L = F || i.canPause, R = I || L, z = (t) => ({
|
|
3490
3498
|
component: e,
|
|
3491
3499
|
part: t
|
|
3492
|
-
}), B =
|
|
3500
|
+
}), B = a(null), ee = a(null), [V, te] = o(!1), H = pt(i.pausePresets, u, h), ne = a(null), U = () => ne.current ??= m({
|
|
3493
3501
|
reference: () => B.current,
|
|
3494
3502
|
popover: () => ee.current,
|
|
3495
3503
|
position: {
|
|
@@ -3499,30 +3507,30 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3499
3507
|
menu: !0,
|
|
3500
3508
|
onOpenChange: te
|
|
3501
3509
|
});
|
|
3502
|
-
|
|
3510
|
+
r(() => {
|
|
3503
3511
|
let e = ne.current;
|
|
3504
3512
|
if (V && e) return e.mount(), () => e.cleanup();
|
|
3505
|
-
}, [V]),
|
|
3513
|
+
}, [V]), t(() => ne.current?.close(!1), [S]);
|
|
3506
3514
|
let re = (e) => void X.pause(ft(e.preset)), ie = (e) => {
|
|
3507
3515
|
let t = e.currentTarget.closest("[data-inbox-panel], [data-inbox-list]");
|
|
3508
3516
|
X.resume(), (B.current ?? t)?.focus();
|
|
3509
|
-
}, ae = () =>
|
|
3510
|
-
let t =
|
|
3511
|
-
n !== void 0 &&
|
|
3517
|
+
}, ae = () => da(i, c), oe = () => pa(l, c), se = (e, t) => void X.load(e, t), W = (e) => {
|
|
3518
|
+
let t = g(e.currentTarget), n = Fa(e.key, s, j, t);
|
|
3519
|
+
n !== void 0 && y && (e.preventDefault(), se(n, c), document.getElementById(y.tabId(n))?.focus());
|
|
3512
3520
|
}, ce = (e) => w ? w(e) : /* @__PURE__ */ O(E, { children: [
|
|
3513
3521
|
e.label,
|
|
3514
3522
|
" ",
|
|
3515
3523
|
e.count !== null && e.count > 0 && /* @__PURE__ */ D("span", {
|
|
3516
3524
|
className: "bg-iui-inbox-accent-subtle text-iui-inbox-accent rounded-full px-1.5 text-xs/5 tabular-nums",
|
|
3517
|
-
children: St(e.count,
|
|
3525
|
+
children: St(e.count, _, h)
|
|
3518
3526
|
})
|
|
3519
|
-
] }), le = (e) => j.length > 1 &&
|
|
3527
|
+
] }), le = (e) => j.length > 1 && b && /* @__PURE__ */ D("div", {
|
|
3520
3528
|
className: e,
|
|
3521
|
-
children:
|
|
3522
|
-
...
|
|
3523
|
-
filter:
|
|
3524
|
-
},
|
|
3525
|
-
href:
|
|
3529
|
+
children: ca(j, {
|
|
3530
|
+
...i,
|
|
3531
|
+
filter: s
|
|
3532
|
+
}, u).map((e) => /* @__PURE__ */ D(x, {
|
|
3533
|
+
href: b(e.filter, c),
|
|
3526
3534
|
"aria-current": e.selected ? "page" : void 0,
|
|
3527
3535
|
"data-inbox-tab": e.filter,
|
|
3528
3536
|
className: "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-selected:border-iui-inbox-accent aria-selected:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:text-iui-inbox-accent -mb-px inline-flex items-center gap-1.5 rounded-t-md border-b-2 border-transparent px-1.5 py-2 text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset",
|
|
@@ -3531,41 +3539,41 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3531
3539
|
}), ue = (e, t) => /* @__PURE__ */ O(E, { children: [
|
|
3532
3540
|
t,
|
|
3533
3541
|
" ",
|
|
3534
|
-
e !== null &&
|
|
3542
|
+
e !== null && i.categoryCounts[e] ? /* @__PURE__ */ D("span", {
|
|
3535
3543
|
className: gi,
|
|
3536
|
-
children: St(
|
|
3544
|
+
children: St(i.categoryCounts[e], _, h)
|
|
3537
3545
|
}) : null
|
|
3538
3546
|
] });
|
|
3539
3547
|
return /* @__PURE__ */ O(E, { children: [
|
|
3540
3548
|
C ? C({
|
|
3541
|
-
...
|
|
3542
|
-
titleId:
|
|
3543
|
-
title:
|
|
3544
|
-
close:
|
|
3549
|
+
...y && {
|
|
3550
|
+
titleId: y.titleId,
|
|
3551
|
+
title: y.title,
|
|
3552
|
+
close: y.close
|
|
3545
3553
|
},
|
|
3546
|
-
filter:
|
|
3547
|
-
category:
|
|
3554
|
+
filter: s,
|
|
3555
|
+
category: c,
|
|
3548
3556
|
unread: P,
|
|
3549
3557
|
markAllAsRead: ae,
|
|
3550
3558
|
canArchiveAll: F,
|
|
3551
3559
|
archiveAll: oe,
|
|
3552
|
-
allowedActions:
|
|
3553
|
-
canPause:
|
|
3554
|
-
pausedUntil:
|
|
3560
|
+
allowedActions: i.allowedActions,
|
|
3561
|
+
canPause: i.canPause,
|
|
3562
|
+
pausedUntil: i.pausedUntil,
|
|
3555
3563
|
pauseOptions: H,
|
|
3556
3564
|
pause: re,
|
|
3557
3565
|
resume: () => void X.resume()
|
|
3558
|
-
}) : /* @__PURE__ */ D(E, { children: (
|
|
3559
|
-
className:
|
|
3566
|
+
}) : /* @__PURE__ */ D(E, { children: (y || j.length > 1 || R) && /* @__PURE__ */ O("div", {
|
|
3567
|
+
className: y ? "flex items-center justify-between gap-3 px-4 pt-3 pb-1" : "border-iui-inbox-border flex flex-wrap-reverse items-stretch border-b pe-4",
|
|
3560
3568
|
children: [
|
|
3561
|
-
|
|
3562
|
-
id:
|
|
3569
|
+
y && /* @__PURE__ */ D("h2", {
|
|
3570
|
+
id: y.titleId,
|
|
3563
3571
|
className: "text-base font-semibold",
|
|
3564
|
-
children:
|
|
3572
|
+
children: y.title
|
|
3565
3573
|
}),
|
|
3566
3574
|
le("iui-inbox-fade border-iui-inbox-border -mb-px flex min-w-0 flex-auto gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none"),
|
|
3567
3575
|
R && /* @__PURE__ */ O("div", {
|
|
3568
|
-
className:
|
|
3576
|
+
className: y ? "-me-1.5 flex items-center gap-1" : "-me-1.5 flex shrink-0 items-center gap-1 py-2 ps-2.5",
|
|
3569
3577
|
children: [I && /* @__PURE__ */ D("button", {
|
|
3570
3578
|
type: "button",
|
|
3571
3579
|
"data-inbox-read-all": "",
|
|
@@ -3573,7 +3581,7 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3573
3581
|
className: "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-1.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
3574
3582
|
onClick: ae,
|
|
3575
3583
|
children: A("markAllAsRead")
|
|
3576
|
-
}), L && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(
|
|
3584
|
+
}), L && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(za, {
|
|
3577
3585
|
text: A("moreActions"),
|
|
3578
3586
|
children: /* @__PURE__ */ D("button", {
|
|
3579
3587
|
ref: B,
|
|
@@ -3583,7 +3591,7 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3583
3591
|
"aria-label": A("moreActions"),
|
|
3584
3592
|
"aria-expanded": V,
|
|
3585
3593
|
"aria-controls": V ? T : void 0,
|
|
3586
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
3594
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", p.control),
|
|
3587
3595
|
onClick: (e) => U().toggle(e.nativeEvent),
|
|
3588
3596
|
onPointerDown: () => U().onPointerDown(),
|
|
3589
3597
|
onKeyDown: (e) => U().onKeydown(e.nativeEvent),
|
|
@@ -3591,8 +3599,8 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3591
3599
|
children: /* @__PURE__ */ D($, {
|
|
3592
3600
|
name: "more",
|
|
3593
3601
|
context: z("more-actions"),
|
|
3594
|
-
icons:
|
|
3595
|
-
resolver:
|
|
3602
|
+
icons: d,
|
|
3603
|
+
resolver: f,
|
|
3596
3604
|
className: "size-4"
|
|
3597
3605
|
})
|
|
3598
3606
|
})
|
|
@@ -3601,7 +3609,7 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3601
3609
|
ref: ee,
|
|
3602
3610
|
role: "menu",
|
|
3603
3611
|
"aria-label": A("moreActions"),
|
|
3604
|
-
popover:
|
|
3612
|
+
popover: Ia() ? "auto" : void 0,
|
|
3605
3613
|
"data-inbox-menu": "",
|
|
3606
3614
|
className: "border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground rounded-iui-inbox m-0 w-max min-w-48 border p-1 shadow-lg",
|
|
3607
3615
|
children: [
|
|
@@ -3609,22 +3617,22 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3609
3617
|
type: "button",
|
|
3610
3618
|
role: "menuitem",
|
|
3611
3619
|
"data-inbox-archive-all": "",
|
|
3612
|
-
"aria-disabled":
|
|
3620
|
+
"aria-disabled": l.length === 0 || void 0,
|
|
3613
3621
|
className: "hover:bg-iui-inbox-control-hover focus-visible:bg-iui-inbox-control-hover flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-hidden aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
3614
3622
|
onClick: oe,
|
|
3615
3623
|
children: [/* @__PURE__ */ D($, {
|
|
3616
3624
|
name: "archive",
|
|
3617
3625
|
context: z("archive-all"),
|
|
3618
|
-
icons:
|
|
3619
|
-
resolver:
|
|
3626
|
+
icons: d,
|
|
3627
|
+
resolver: f,
|
|
3620
3628
|
className: "text-iui-inbox-icon size-4 shrink-0"
|
|
3621
3629
|
}), A("archiveAll")]
|
|
3622
3630
|
}),
|
|
3623
|
-
F &&
|
|
3631
|
+
F && i.canPause && /* @__PURE__ */ D("div", {
|
|
3624
3632
|
role: "separator",
|
|
3625
3633
|
className: "bg-iui-inbox-border -mx-1 my-1 h-px"
|
|
3626
3634
|
}),
|
|
3627
|
-
|
|
3635
|
+
i.canPause && /* @__PURE__ */ O("div", {
|
|
3628
3636
|
role: "group",
|
|
3629
3637
|
"aria-labelledby": k,
|
|
3630
3638
|
children: [/* @__PURE__ */ O("div", {
|
|
@@ -3633,8 +3641,8 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3633
3641
|
children: [/* @__PURE__ */ D($, {
|
|
3634
3642
|
name: "pause",
|
|
3635
3643
|
context: z("pause"),
|
|
3636
|
-
icons:
|
|
3637
|
-
resolver:
|
|
3644
|
+
icons: d,
|
|
3645
|
+
resolver: f,
|
|
3638
3646
|
className: "text-iui-inbox-icon size-4 shrink-0"
|
|
3639
3647
|
}), A("pause")]
|
|
3640
3648
|
}), H.map((e) => /* @__PURE__ */ O("button", {
|
|
@@ -3648,7 +3656,7 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3648
3656
|
" ",
|
|
3649
3657
|
/* @__PURE__ */ D("span", {
|
|
3650
3658
|
className: "text-iui-inbox-muted-foreground ms-auto ps-6 tabular-nums",
|
|
3651
|
-
children:
|
|
3659
|
+
children: _a(e, v, h)
|
|
3652
3660
|
})
|
|
3653
3661
|
]
|
|
3654
3662
|
}, e.label))]
|
|
@@ -3660,20 +3668,20 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3660
3668
|
}) }),
|
|
3661
3669
|
/* @__PURE__ */ D("div", {
|
|
3662
3670
|
"aria-live": "polite",
|
|
3663
|
-
children:
|
|
3671
|
+
children: i.pausedUntil !== null && /* @__PURE__ */ O("p", {
|
|
3664
3672
|
"data-inbox-paused": "",
|
|
3665
3673
|
className: "bg-iui-inbox-control-hover text-iui-inbox-foreground mx-4 mt-1 mb-2 flex shrink-0 items-center gap-2 rounded-md px-3 py-2 text-xs",
|
|
3666
3674
|
children: [
|
|
3667
3675
|
/* @__PURE__ */ D($, {
|
|
3668
3676
|
name: "paused",
|
|
3669
3677
|
context: z("paused"),
|
|
3670
|
-
icons:
|
|
3671
|
-
resolver:
|
|
3678
|
+
icons: d,
|
|
3679
|
+
resolver: f,
|
|
3672
3680
|
className: "text-iui-inbox-icon size-4 shrink-0"
|
|
3673
3681
|
}),
|
|
3674
3682
|
/* @__PURE__ */ D("span", {
|
|
3675
3683
|
className: "min-w-0 flex-1",
|
|
3676
|
-
children:
|
|
3684
|
+
children: ga(u, i.pausedUntil, v, h)
|
|
3677
3685
|
}),
|
|
3678
3686
|
/* @__PURE__ */ D("button", {
|
|
3679
3687
|
type: "button",
|
|
@@ -3686,24 +3694,24 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3686
3694
|
})
|
|
3687
3695
|
}),
|
|
3688
3696
|
C && le("iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none"),
|
|
3689
|
-
j.length > 1 && !
|
|
3697
|
+
j.length > 1 && !b && y && /* @__PURE__ */ D("div", {
|
|
3690
3698
|
role: "tablist",
|
|
3691
|
-
"aria-labelledby":
|
|
3699
|
+
"aria-labelledby": y.titleId,
|
|
3692
3700
|
className: "iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none",
|
|
3693
3701
|
onKeyDown: W,
|
|
3694
|
-
children:
|
|
3695
|
-
...
|
|
3696
|
-
filter:
|
|
3697
|
-
},
|
|
3698
|
-
id:
|
|
3702
|
+
children: ca(j, {
|
|
3703
|
+
...i,
|
|
3704
|
+
filter: s
|
|
3705
|
+
}, u).map((e) => /* @__PURE__ */ D("button", {
|
|
3706
|
+
id: y.tabId(e.filter),
|
|
3699
3707
|
type: "button",
|
|
3700
3708
|
role: "tab",
|
|
3701
3709
|
"aria-selected": e.selected,
|
|
3702
|
-
"aria-controls":
|
|
3710
|
+
"aria-controls": y.listId,
|
|
3703
3711
|
tabIndex: e.selected ? 0 : -1,
|
|
3704
3712
|
"data-inbox-tab": e.filter,
|
|
3705
3713
|
className: "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-selected:border-iui-inbox-accent aria-selected:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:text-iui-inbox-accent -mb-px inline-flex items-center gap-1.5 rounded-t-md border-b-2 border-transparent px-1.5 py-2 text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset",
|
|
3706
|
-
onClick: () => se(e.filter,
|
|
3714
|
+
onClick: () => se(e.filter, c),
|
|
3707
3715
|
children: ce(e)
|
|
3708
3716
|
}, e.filter))
|
|
3709
3717
|
}),
|
|
@@ -3711,35 +3719,35 @@ function za({ component: e, state: n, filter: r, category: i, items: a, labels:
|
|
|
3711
3719
|
role: "group",
|
|
3712
3720
|
"aria-label": A("categories"),
|
|
3713
3721
|
className: "iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1.5 overflow-x-auto border-b ps-4 pe-8 py-2 scrollbar-none",
|
|
3714
|
-
children: M.map(([e,
|
|
3715
|
-
href:
|
|
3722
|
+
children: M.map(([e, t]) => b ? /* @__PURE__ */ D(x, {
|
|
3723
|
+
href: b(s, e),
|
|
3716
3724
|
"data-inbox-category": e ?? "",
|
|
3717
|
-
"aria-current":
|
|
3725
|
+
"aria-current": c === e ? "page" : void 0,
|
|
3718
3726
|
className: "border-iui-inbox-border text-iui-inbox-muted-foreground hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-pressed:border-iui-inbox-accent aria-pressed:bg-iui-inbox-accent-subtle aria-pressed:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:bg-iui-inbox-accent-subtle aria-[current=page]:text-iui-inbox-accent inline-flex shrink-0 items-center gap-1 rounded-full border px-2.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden",
|
|
3719
|
-
children: ue(e,
|
|
3727
|
+
children: ue(e, t)
|
|
3720
3728
|
}, e ?? "") : /* @__PURE__ */ D("button", {
|
|
3721
3729
|
type: "button",
|
|
3722
3730
|
"data-inbox-category": e ?? "",
|
|
3723
|
-
"aria-pressed":
|
|
3731
|
+
"aria-pressed": c === e,
|
|
3724
3732
|
className: "border-iui-inbox-border text-iui-inbox-muted-foreground hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-pressed:border-iui-inbox-accent aria-pressed:bg-iui-inbox-accent-subtle aria-pressed:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:bg-iui-inbox-accent-subtle aria-[current=page]:text-iui-inbox-accent inline-flex shrink-0 items-center gap-1 rounded-full border px-2.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden",
|
|
3725
|
-
onClick: () => se(
|
|
3726
|
-
children: ue(e,
|
|
3733
|
+
onClick: () => se(s, e),
|
|
3734
|
+
children: ue(e, t)
|
|
3727
3735
|
}, e ?? ""))
|
|
3728
3736
|
})
|
|
3729
3737
|
] });
|
|
3730
3738
|
}
|
|
3731
3739
|
// src/NotificationItem.tsx
|
|
3732
|
-
var
|
|
3740
|
+
var Va = [
|
|
3733
3741
|
"snooze",
|
|
3734
3742
|
"archive",
|
|
3735
3743
|
"mute"
|
|
3736
3744
|
];
|
|
3737
|
-
function
|
|
3738
|
-
let g = e.readAt === null, _ = e.archivedAt !== null, v = Re(e,
|
|
3745
|
+
function Ha({ item: e, now: r, labels: i = Tt(), icons: s = {}, iconResolver: c, classes: l = {}, locale: u, pendingAction: d, snooze: f, allowedActions: p = Va, selected: m = !1, onSelectedChange: h }) {
|
|
3746
|
+
let g = e.readAt === null, _ = e.archivedAt !== null, v = Re(e, r), y = Dt(i, e), b = Et(e), x = (e) => p.includes(e), S = (t) => Z(i.itemControl, {
|
|
3739
3747
|
action: Z(t),
|
|
3740
3748
|
title: e.title
|
|
3741
|
-
}), C = x("snooze"), w =
|
|
3742
|
-
T && !C && k(null),
|
|
3749
|
+
}), C = x("snooze"), w = n(), [T, k] = o(null), A = a(null);
|
|
3750
|
+
T && !C && k(null), t(() => {
|
|
3743
3751
|
T && A.current?.querySelector("button")?.focus();
|
|
3744
3752
|
}, [T]);
|
|
3745
3753
|
let j = () => {
|
|
@@ -3747,40 +3755,40 @@ function Va({ item: e, now: t, labels: n = Tt(), icons: r = {}, iconResolver: i,
|
|
|
3747
3755
|
else if (T) k(null);
|
|
3748
3756
|
else {
|
|
3749
3757
|
let e = /* @__PURE__ */ new Date();
|
|
3750
|
-
k(
|
|
3758
|
+
k(f ? f(e) : lt(i, e));
|
|
3751
3759
|
}
|
|
3752
3760
|
}, M = (t) => ({
|
|
3753
3761
|
component: "NotificationItem",
|
|
3754
3762
|
part: t,
|
|
3755
3763
|
item: e
|
|
3756
|
-
}), N = e.icon ? ye(e.icon, M("media"),
|
|
3764
|
+
}), N = e.icon ? ye(e.icon, M("media"), s, c) : void 0, P = new Date(e.createdAt).toLocaleString(u, {
|
|
3757
3765
|
dateStyle: "medium",
|
|
3758
3766
|
timeStyle: "short"
|
|
3759
3767
|
}), F = /* @__PURE__ */ D($, {
|
|
3760
3768
|
name: e.announcement ? "announcement" : "notification",
|
|
3761
3769
|
context: M("media"),
|
|
3762
|
-
icons:
|
|
3763
|
-
resolver:
|
|
3770
|
+
icons: s,
|
|
3771
|
+
resolver: c,
|
|
3764
3772
|
className: "size-5"
|
|
3765
3773
|
});
|
|
3766
3774
|
e.actor?.avatar ? F = /* @__PURE__ */ D("img", {
|
|
3767
3775
|
src: e.actor.avatar,
|
|
3768
3776
|
alt: "",
|
|
3769
3777
|
className: "size-full object-cover"
|
|
3770
|
-
}) : N === void 0 ? e.actor?.name && (F =
|
|
3778
|
+
}) : N === void 0 ? e.actor?.name && (F = Pa(e.actor.name)) : F = Zi(N, "size-5");
|
|
3771
3779
|
let I = h ? "label" : "span";
|
|
3772
3780
|
return /* @__PURE__ */ O("div", {
|
|
3773
3781
|
"data-read": String(!g),
|
|
3774
3782
|
"data-archived": String(_),
|
|
3775
3783
|
"data-selected": h ? String(m) : void 0,
|
|
3776
|
-
className: G(xi,
|
|
3784
|
+
className: G(xi, l.item),
|
|
3777
3785
|
children: [
|
|
3778
3786
|
/* @__PURE__ */ O(I, {
|
|
3779
3787
|
className: G(Si, h && "z-10 cursor-pointer"),
|
|
3780
3788
|
children: [
|
|
3781
3789
|
/* @__PURE__ */ D("span", {
|
|
3782
3790
|
"aria-hidden": "true",
|
|
3783
|
-
className: G(Ci,
|
|
3791
|
+
className: G(Ci, l.media),
|
|
3784
3792
|
children: F
|
|
3785
3793
|
}),
|
|
3786
3794
|
h && /* @__PURE__ */ D("span", {
|
|
@@ -3790,7 +3798,7 @@ function Va({ item: e, now: t, labels: n = Tt(), icons: r = {}, iconResolver: i,
|
|
|
3790
3798
|
"data-inbox-select": "",
|
|
3791
3799
|
"aria-keyshortcuts": "X",
|
|
3792
3800
|
checked: m,
|
|
3793
|
-
"aria-label": Z(
|
|
3801
|
+
"aria-label": Z(i.select, { title: e.title }),
|
|
3794
3802
|
className: "accent-iui-inbox-accent size-4 cursor-pointer",
|
|
3795
3803
|
onChange: (e) => h(e.target.checked)
|
|
3796
3804
|
})
|
|
@@ -3805,15 +3813,15 @@ function Va({ item: e, now: t, labels: n = Tt(), icons: r = {}, iconResolver: i,
|
|
|
3805
3813
|
className: "min-w-0 flex-1",
|
|
3806
3814
|
children: [
|
|
3807
3815
|
/* @__PURE__ */ O("p", {
|
|
3808
|
-
className: G(wi,
|
|
3816
|
+
className: G(wi, l.title),
|
|
3809
3817
|
children: [
|
|
3810
3818
|
g && /* @__PURE__ */ O("span", {
|
|
3811
3819
|
className: "sr-only",
|
|
3812
|
-
children: [Z(
|
|
3820
|
+
children: [Z(i.unreadState), ": "]
|
|
3813
3821
|
}),
|
|
3814
3822
|
e.announcement && /* @__PURE__ */ O("span", {
|
|
3815
3823
|
className: "sr-only",
|
|
3816
|
-
children: [Z(
|
|
3824
|
+
children: [Z(i.announcement), ": "]
|
|
3817
3825
|
}),
|
|
3818
3826
|
e.url ? /* @__PURE__ */ D("a", {
|
|
3819
3827
|
"data-inbox-link": "",
|
|
@@ -3825,7 +3833,7 @@ function Va({ item: e, now: t, labels: n = Tt(), icons: r = {}, iconResolver: i,
|
|
|
3825
3833
|
]
|
|
3826
3834
|
}),
|
|
3827
3835
|
e.body && /* @__PURE__ */ D("p", {
|
|
3828
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 line-clamp-3 text-sm wrap-break-word",
|
|
3836
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 line-clamp-3 text-sm wrap-break-word", l.body),
|
|
3829
3837
|
children: e.body
|
|
3830
3838
|
}),
|
|
3831
3839
|
e.image && /* @__PURE__ */ D("img", {
|
|
@@ -3835,7 +3843,7 @@ function Va({ item: e, now: t, labels: n = Tt(), icons: r = {}, iconResolver: i,
|
|
|
3835
3843
|
}),
|
|
3836
3844
|
y && /* @__PURE__ */ O("p", {
|
|
3837
3845
|
"data-inbox-actors": "",
|
|
3838
|
-
className: G("text-iui-inbox-muted-foreground mt-1.5 flex items-center gap-1.5 text-xs",
|
|
3846
|
+
className: G("text-iui-inbox-muted-foreground mt-1.5 flex items-center gap-1.5 text-xs", l.actors),
|
|
3839
3847
|
children: [/* @__PURE__ */ D("span", {
|
|
3840
3848
|
"aria-hidden": "true",
|
|
3841
3849
|
className: "isolate flex",
|
|
@@ -3846,79 +3854,79 @@ function Va({ item: e, now: t, labels: n = Tt(), icons: r = {}, iconResolver: i,
|
|
|
3846
3854
|
src: e.avatar,
|
|
3847
3855
|
alt: "",
|
|
3848
3856
|
className: "size-full object-cover"
|
|
3849
|
-
}) : e.name &&
|
|
3857
|
+
}) : e.name && Pa(e.name)
|
|
3850
3858
|
}, t))
|
|
3851
3859
|
}), y]
|
|
3852
3860
|
}),
|
|
3853
3861
|
v && e.snoozedUntil ? /* @__PURE__ */ O("p", {
|
|
3854
3862
|
"data-inbox-snoozed-until": "",
|
|
3855
3863
|
suppressHydrationWarning: !0,
|
|
3856
|
-
className: G(Di,
|
|
3864
|
+
className: G(Di, l.time),
|
|
3857
3865
|
children: [/* @__PURE__ */ D($, {
|
|
3858
3866
|
name: "snooze",
|
|
3859
3867
|
context: M("snoozed-until"),
|
|
3860
|
-
icons:
|
|
3861
|
-
resolver:
|
|
3868
|
+
icons: s,
|
|
3869
|
+
resolver: c,
|
|
3862
3870
|
className: "size-3.5"
|
|
3863
|
-
}), Z(
|
|
3871
|
+
}), Z(i.snoozedUntil, { time: ut(e.snoozedUntil, r, u) })]
|
|
3864
3872
|
}) : /* @__PURE__ */ D("time", {
|
|
3865
3873
|
dateTime: e.createdAt,
|
|
3866
3874
|
title: P,
|
|
3867
3875
|
suppressHydrationWarning: !0,
|
|
3868
|
-
className: G(Ei,
|
|
3869
|
-
children: xt(e.createdAt,
|
|
3876
|
+
className: G(Ei, l.time),
|
|
3877
|
+
children: xt(e.createdAt, r, u)
|
|
3870
3878
|
}),
|
|
3871
3879
|
e.muted && /* @__PURE__ */ O("p", {
|
|
3872
3880
|
"data-inbox-muted": "",
|
|
3873
|
-
className: G("text-iui-inbox-muted-foreground mt-1 flex items-center gap-1 text-xs",
|
|
3881
|
+
className: G("text-iui-inbox-muted-foreground mt-1 flex items-center gap-1 text-xs", l.time),
|
|
3874
3882
|
children: [/* @__PURE__ */ D($, {
|
|
3875
3883
|
name: "mute",
|
|
3876
3884
|
context: M("muted"),
|
|
3877
|
-
icons:
|
|
3878
|
-
resolver:
|
|
3885
|
+
icons: s,
|
|
3886
|
+
resolver: c,
|
|
3879
3887
|
className: "size-3.5"
|
|
3880
|
-
}), Z(
|
|
3888
|
+
}), Z(i.muted)]
|
|
3881
3889
|
}),
|
|
3882
3890
|
e.result !== null && /* @__PURE__ */ O("p", {
|
|
3883
3891
|
"data-inbox-result": "",
|
|
3884
|
-
className: G("text-iui-inbox-muted-foreground mt-2 flex items-center gap-1.5 text-xs font-medium",
|
|
3892
|
+
className: G("text-iui-inbox-muted-foreground mt-2 flex items-center gap-1.5 text-xs font-medium", l.result),
|
|
3885
3893
|
children: [/* @__PURE__ */ D($, {
|
|
3886
3894
|
name: "result",
|
|
3887
3895
|
context: M("result"),
|
|
3888
|
-
icons:
|
|
3889
|
-
resolver:
|
|
3896
|
+
icons: s,
|
|
3897
|
+
resolver: c,
|
|
3890
3898
|
className: "size-3.5"
|
|
3891
3899
|
}), e.result]
|
|
3892
3900
|
}),
|
|
3893
3901
|
e.result === null && e.actions.length > 0 && /* @__PURE__ */ D("div", {
|
|
3894
3902
|
className: "relative z-10 mt-2 flex flex-wrap gap-2",
|
|
3895
3903
|
children: e.actions.map((t, n) => {
|
|
3896
|
-
let
|
|
3897
|
-
"aria-disabled":
|
|
3898
|
-
"aria-busy":
|
|
3904
|
+
let r = H(t), i = {
|
|
3905
|
+
"aria-disabled": d !== void 0 || void 0,
|
|
3906
|
+
"aria-busy": d === n || void 0,
|
|
3899
3907
|
"data-inbox-action": String(n),
|
|
3900
|
-
className: G(n === 0 ? "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-accent text-iui-inbox-accent hover:bg-iui-inbox-accent-subtle border" : "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border",
|
|
3908
|
+
className: G(n === 0 ? "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-accent text-iui-inbox-accent hover:bg-iui-inbox-accent-subtle border" : "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border", l.action),
|
|
3901
3909
|
onClick: (t) => X.runAction(e, n, t.nativeEvent)
|
|
3902
|
-
},
|
|
3910
|
+
}, a = /* @__PURE__ */ O(E, { children: [d === n && /* @__PURE__ */ D($, {
|
|
3903
3911
|
name: "spinner",
|
|
3904
3912
|
context: {
|
|
3905
3913
|
...M("action"),
|
|
3906
3914
|
action: t
|
|
3907
3915
|
},
|
|
3908
|
-
icons:
|
|
3909
|
-
resolver:
|
|
3916
|
+
icons: s,
|
|
3917
|
+
resolver: c,
|
|
3910
3918
|
className: "size-3.5 motion-safe:animate-spin"
|
|
3911
3919
|
}), t.label] });
|
|
3912
|
-
return
|
|
3920
|
+
return r === void 0 ? /* @__PURE__ */ D("button", {
|
|
3913
3921
|
type: "button",
|
|
3914
|
-
...
|
|
3915
|
-
children:
|
|
3922
|
+
...i,
|
|
3923
|
+
children: a
|
|
3916
3924
|
}, n) : /* @__PURE__ */ D("a", {
|
|
3917
|
-
href:
|
|
3925
|
+
href: r,
|
|
3918
3926
|
target: t.newTab ? "_blank" : void 0,
|
|
3919
3927
|
rel: t.newTab ? "noopener noreferrer" : void 0,
|
|
3920
|
-
...
|
|
3921
|
-
children:
|
|
3928
|
+
...i,
|
|
3929
|
+
children: a
|
|
3922
3930
|
}, n);
|
|
3923
3931
|
})
|
|
3924
3932
|
}),
|
|
@@ -3926,120 +3934,120 @@ function Va({ item: e, now: t, labels: n = Tt(), icons: r = {}, iconResolver: i,
|
|
|
3926
3934
|
id: w,
|
|
3927
3935
|
ref: A,
|
|
3928
3936
|
role: "group",
|
|
3929
|
-
"aria-label": Z(
|
|
3937
|
+
"aria-label": Z(i.snoozeUntil),
|
|
3930
3938
|
"data-inbox-snooze-options": "",
|
|
3931
3939
|
className: "relative z-10 mt-2 flex flex-wrap gap-2",
|
|
3932
|
-
children: T.map((
|
|
3940
|
+
children: T.map((t) => /* @__PURE__ */ O("button", {
|
|
3933
3941
|
type: "button",
|
|
3934
3942
|
"data-inbox-snooze-option": "",
|
|
3935
|
-
className: G("rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border",
|
|
3943
|
+
className: G("rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60 border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border", l.action),
|
|
3936
3944
|
onClick: () => {
|
|
3937
|
-
k(null), X.snooze(e,
|
|
3945
|
+
k(null), X.snooze(e, t.until);
|
|
3938
3946
|
},
|
|
3939
3947
|
children: [
|
|
3940
|
-
|
|
3948
|
+
t.label,
|
|
3941
3949
|
" ",
|
|
3942
3950
|
/* @__PURE__ */ D("span", {
|
|
3943
3951
|
className: "text-iui-inbox-muted-foreground font-normal",
|
|
3944
|
-
children: ut(
|
|
3952
|
+
children: ut(t.until, r, u)
|
|
3945
3953
|
})
|
|
3946
3954
|
]
|
|
3947
|
-
},
|
|
3955
|
+
}, t.label))
|
|
3948
3956
|
})
|
|
3949
3957
|
]
|
|
3950
3958
|
}),
|
|
3951
3959
|
/* @__PURE__ */ O("div", {
|
|
3952
3960
|
className: Ai,
|
|
3953
3961
|
children: [
|
|
3954
|
-
/* @__PURE__ */ D(
|
|
3955
|
-
text: Z(g ?
|
|
3962
|
+
/* @__PURE__ */ D(za, {
|
|
3963
|
+
text: Z(g ? i.markAsRead : i.markAsUnread),
|
|
3956
3964
|
shortcut: "U",
|
|
3957
3965
|
children: /* @__PURE__ */ D("button", {
|
|
3958
3966
|
type: "button",
|
|
3959
3967
|
"data-inbox-toggle-read": "",
|
|
3960
3968
|
"aria-keyshortcuts": "U",
|
|
3961
|
-
"aria-label": S(g ?
|
|
3962
|
-
className: G(Pi,
|
|
3969
|
+
"aria-label": S(g ? i.markAsRead : i.markAsUnread),
|
|
3970
|
+
className: G(Pi, l.control),
|
|
3963
3971
|
onClick: () => void (g ? X.markAsRead(e) : X.markAsUnread(e)),
|
|
3964
3972
|
children: /* @__PURE__ */ D($, {
|
|
3965
3973
|
name: g ? "read" : "unread",
|
|
3966
3974
|
context: M("toggle-read"),
|
|
3967
|
-
icons:
|
|
3968
|
-
resolver:
|
|
3975
|
+
icons: s,
|
|
3976
|
+
resolver: c,
|
|
3969
3977
|
className: "size-4"
|
|
3970
3978
|
})
|
|
3971
3979
|
})
|
|
3972
3980
|
}),
|
|
3973
|
-
C && !_ && /* @__PURE__ */ D(
|
|
3974
|
-
text: Z(v ?
|
|
3981
|
+
C && !_ && /* @__PURE__ */ D(za, {
|
|
3982
|
+
text: Z(v ? i.unsnooze : i.snooze),
|
|
3975
3983
|
shortcut: "H",
|
|
3976
3984
|
children: /* @__PURE__ */ D("button", {
|
|
3977
3985
|
type: "button",
|
|
3978
3986
|
"data-inbox-snooze": "",
|
|
3979
3987
|
"aria-keyshortcuts": "H",
|
|
3980
|
-
"aria-label": S(v ?
|
|
3988
|
+
"aria-label": S(v ? i.unsnooze : i.snooze),
|
|
3981
3989
|
"aria-expanded": v ? void 0 : T !== null,
|
|
3982
3990
|
"aria-controls": v || !T ? void 0 : w,
|
|
3983
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
3991
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", l.control),
|
|
3984
3992
|
onClick: j,
|
|
3985
3993
|
children: /* @__PURE__ */ D($, {
|
|
3986
3994
|
name: v ? "unsnooze" : "snooze",
|
|
3987
3995
|
context: M("snooze"),
|
|
3988
|
-
icons:
|
|
3989
|
-
resolver:
|
|
3996
|
+
icons: s,
|
|
3997
|
+
resolver: c,
|
|
3990
3998
|
className: "size-4"
|
|
3991
3999
|
})
|
|
3992
4000
|
})
|
|
3993
4001
|
}),
|
|
3994
|
-
e.group !== null && x("mute") && /* @__PURE__ */ D(
|
|
3995
|
-
text: Z(e.muted ?
|
|
4002
|
+
e.group !== null && x("mute") && /* @__PURE__ */ D(za, {
|
|
4003
|
+
text: Z(e.muted ? i.unmute : i.mute),
|
|
3996
4004
|
children: /* @__PURE__ */ D("button", {
|
|
3997
4005
|
type: "button",
|
|
3998
4006
|
"data-inbox-mute": "",
|
|
3999
|
-
"aria-label": S(e.muted ?
|
|
4000
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
4007
|
+
"aria-label": S(e.muted ? i.unmute : i.mute),
|
|
4008
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", l.control),
|
|
4001
4009
|
onClick: () => void (e.muted ? X.unmute(e) : X.mute(e)),
|
|
4002
4010
|
children: /* @__PURE__ */ D($, {
|
|
4003
4011
|
name: e.muted ? "unmute" : "mute",
|
|
4004
4012
|
context: M("mute"),
|
|
4005
|
-
icons:
|
|
4006
|
-
resolver:
|
|
4013
|
+
icons: s,
|
|
4014
|
+
resolver: c,
|
|
4007
4015
|
className: "size-4"
|
|
4008
4016
|
})
|
|
4009
4017
|
})
|
|
4010
4018
|
}),
|
|
4011
|
-
x("archive") && /* @__PURE__ */ D(
|
|
4012
|
-
text: Z(_ ?
|
|
4019
|
+
x("archive") && /* @__PURE__ */ D(za, {
|
|
4020
|
+
text: Z(_ ? i.unarchive : i.archive),
|
|
4013
4021
|
shortcut: "E",
|
|
4014
4022
|
children: /* @__PURE__ */ D("button", {
|
|
4015
4023
|
type: "button",
|
|
4016
4024
|
"data-inbox-toggle-archive": "",
|
|
4017
4025
|
"aria-keyshortcuts": "E",
|
|
4018
|
-
"aria-label": S(_ ?
|
|
4019
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
4026
|
+
"aria-label": S(_ ? i.unarchive : i.archive),
|
|
4027
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", l.control),
|
|
4020
4028
|
onClick: () => void (_ ? X.unarchive(e) : X.archive(e)),
|
|
4021
4029
|
children: /* @__PURE__ */ D($, {
|
|
4022
4030
|
name: _ ? "unarchive" : "archive",
|
|
4023
4031
|
context: M("archive"),
|
|
4024
|
-
icons:
|
|
4025
|
-
resolver:
|
|
4032
|
+
icons: s,
|
|
4033
|
+
resolver: c,
|
|
4026
4034
|
className: "size-4"
|
|
4027
4035
|
})
|
|
4028
4036
|
})
|
|
4029
4037
|
}),
|
|
4030
|
-
x("delete") && /* @__PURE__ */ D(
|
|
4031
|
-
text: Z(
|
|
4038
|
+
x("delete") && /* @__PURE__ */ D(za, {
|
|
4039
|
+
text: Z(i.delete),
|
|
4032
4040
|
children: /* @__PURE__ */ D("button", {
|
|
4033
4041
|
type: "button",
|
|
4034
4042
|
"data-inbox-delete": "",
|
|
4035
|
-
"aria-label": S(
|
|
4036
|
-
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1",
|
|
4043
|
+
"aria-label": S(i.delete),
|
|
4044
|
+
className: G("text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", l.control),
|
|
4037
4045
|
onClick: () => void X.delete(e),
|
|
4038
4046
|
children: /* @__PURE__ */ D($, {
|
|
4039
4047
|
name: "delete",
|
|
4040
4048
|
context: M("delete"),
|
|
4041
|
-
icons:
|
|
4042
|
-
resolver:
|
|
4049
|
+
icons: s,
|
|
4050
|
+
resolver: c,
|
|
4043
4051
|
className: "size-4"
|
|
4044
4052
|
})
|
|
4045
4053
|
})
|
|
@@ -4050,22 +4058,22 @@ function Va({ item: e, now: t, labels: n = Tt(), icons: r = {}, iconResolver: i,
|
|
|
4050
4058
|
});
|
|
4051
4059
|
}
|
|
4052
4060
|
// src/ItemGroup.tsx
|
|
4053
|
-
function
|
|
4054
|
-
let [h, g] =
|
|
4061
|
+
function Ua({ group: e, now: t, labels: r, icons: i, iconResolver: a, classes: s, locale: c, pendingActions: l, snooze: u, allowedActions: d, selected: f, select: p, renderItem: m }) {
|
|
4062
|
+
let [h, g] = o(!1), _ = n();
|
|
4055
4063
|
h && e.others.length === 0 && g(!1);
|
|
4056
|
-
let v = (e,
|
|
4057
|
-
let
|
|
4064
|
+
let v = (e, n) => {
|
|
4065
|
+
let o = {
|
|
4058
4066
|
item: e,
|
|
4059
4067
|
now: t,
|
|
4060
|
-
labels:
|
|
4061
|
-
icons:
|
|
4062
|
-
iconResolver:
|
|
4063
|
-
classes:
|
|
4064
|
-
locale:
|
|
4065
|
-
pendingAction:
|
|
4066
|
-
snooze:
|
|
4067
|
-
allowedActions:
|
|
4068
|
-
selected:
|
|
4068
|
+
labels: r,
|
|
4069
|
+
icons: i,
|
|
4070
|
+
iconResolver: a,
|
|
4071
|
+
classes: s,
|
|
4072
|
+
locale: c,
|
|
4073
|
+
pendingAction: l[e.id],
|
|
4074
|
+
snooze: u,
|
|
4075
|
+
allowedActions: d,
|
|
4076
|
+
selected: f?.includes(e.id) ?? !1,
|
|
4069
4077
|
onSelectedChange: p ? (t) => p(e.id, t) : void 0
|
|
4070
4078
|
};
|
|
4071
4079
|
return /* @__PURE__ */ O("li", {
|
|
@@ -4077,7 +4085,7 @@ function Ha({ group: e, now: t, labels: n, icons: r, iconResolver: i, classes: a
|
|
|
4077
4085
|
"data-archived": String(e.archivedAt !== null),
|
|
4078
4086
|
"data-announcement": e.announcement ? "true" : void 0,
|
|
4079
4087
|
className: bi,
|
|
4080
|
-
children: [m ? m(e, t,
|
|
4088
|
+
children: [m ? m(e, t, o) : /* @__PURE__ */ D(Ha, { ...o }), n]
|
|
4081
4089
|
}, e.id);
|
|
4082
4090
|
};
|
|
4083
4091
|
return v(e.item, e.others.length > 0 && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("button", {
|
|
@@ -4087,7 +4095,7 @@ function Ha({ group: e, now: t, labels: n, icons: r, iconResolver: i, classes: a
|
|
|
4087
4095
|
"aria-controls": h ? _ : void 0,
|
|
4088
4096
|
className: "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring ms-15 -mt-2 mb-2.5 rounded-md px-1 py-0.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden",
|
|
4089
4097
|
onClick: () => g(!h),
|
|
4090
|
-
children: h ? Z(
|
|
4098
|
+
children: h ? Z(r.showLess) : Z(r.showMore, { count: e.others.length })
|
|
4091
4099
|
}), h && /* @__PURE__ */ D("ul", {
|
|
4092
4100
|
id: _,
|
|
4093
4101
|
role: "list",
|
|
@@ -4096,13 +4104,13 @@ function Ha({ group: e, now: t, labels: n, icons: r, iconResolver: i, classes: a
|
|
|
4096
4104
|
})] }));
|
|
4097
4105
|
}
|
|
4098
4106
|
// src/SelectionBar.tsx
|
|
4099
|
-
function
|
|
4100
|
-
let _ =
|
|
4101
|
-
S !== null && y.length === 0 && C(null),
|
|
4107
|
+
function Wa({ component: e, items: r, selected: i, onSelectedChange: s, filter: c, allowedActions: l, now: u, labels: d, icons: f, iconResolver: p, classes: m, locale: h, snooze: g }) {
|
|
4108
|
+
let _ = n(), v = (e) => Z(d[e]), y = r.filter((e) => i.includes(e.id)), b = y.length === r.length, x = a(null), [S, C] = o(null);
|
|
4109
|
+
S !== null && y.length === 0 && C(null), t(() => {
|
|
4102
4110
|
S && x.current?.querySelector("button")?.focus();
|
|
4103
4111
|
}, [S]);
|
|
4104
4112
|
let w = (e, t) => {
|
|
4105
|
-
|
|
4113
|
+
s([]), X.batch(e, y, t);
|
|
4106
4114
|
};
|
|
4107
4115
|
return y.length === 0 ? null : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O("div", {
|
|
4108
4116
|
role: "group",
|
|
@@ -4120,14 +4128,14 @@ function Ua({ component: e, items: t, selected: n, onSelectedChange: r, filter:
|
|
|
4120
4128
|
checked: b,
|
|
4121
4129
|
"aria-label": v("selectAll"),
|
|
4122
4130
|
className: Ni,
|
|
4123
|
-
onChange: () =>
|
|
4131
|
+
onChange: () => s(b ? [] : r.map((e) => e.id))
|
|
4124
4132
|
}), /* @__PURE__ */ D("span", {
|
|
4125
4133
|
"aria-live": "polite",
|
|
4126
|
-
children: Z(
|
|
4134
|
+
children: Z(d.selected, { count: y.length })
|
|
4127
4135
|
})]
|
|
4128
4136
|
}), /* @__PURE__ */ O("div", {
|
|
4129
4137
|
className: mi,
|
|
4130
|
-
children: [
|
|
4138
|
+
children: [va(c, l).map((t) => /* @__PURE__ */ D("button", {
|
|
4131
4139
|
type: "button",
|
|
4132
4140
|
"data-inbox-batch": t.action,
|
|
4133
4141
|
"aria-label": v(t.label),
|
|
@@ -4135,7 +4143,7 @@ function Ua({ component: e, items: t, selected: n, onSelectedChange: r, filter:
|
|
|
4135
4143
|
"aria-expanded": t.action === "snooze" ? S !== null : void 0,
|
|
4136
4144
|
"aria-controls": t.action === "snooze" && S ? _ : void 0,
|
|
4137
4145
|
className: G(Pi, m.control),
|
|
4138
|
-
onClick: () => t.action === "snooze" ? C(S ? null :
|
|
4146
|
+
onClick: () => t.action === "snooze" ? C(S ? null : ya(g, d)) : w(t.action),
|
|
4139
4147
|
children: /* @__PURE__ */ D($, {
|
|
4140
4148
|
name: t.icon,
|
|
4141
4149
|
context: {
|
|
@@ -4143,7 +4151,7 @@ function Ua({ component: e, items: t, selected: n, onSelectedChange: r, filter:
|
|
|
4143
4151
|
part: "selection",
|
|
4144
4152
|
action: t.action
|
|
4145
4153
|
},
|
|
4146
|
-
icons:
|
|
4154
|
+
icons: f,
|
|
4147
4155
|
resolver: p,
|
|
4148
4156
|
className: "size-4"
|
|
4149
4157
|
})
|
|
@@ -4153,14 +4161,14 @@ function Ua({ component: e, items: t, selected: n, onSelectedChange: r, filter:
|
|
|
4153
4161
|
"aria-label": v("clearSelection"),
|
|
4154
4162
|
title: v("clearSelection"),
|
|
4155
4163
|
className: G(Pi, m.control),
|
|
4156
|
-
onClick: () =>
|
|
4164
|
+
onClick: () => s([]),
|
|
4157
4165
|
children: /* @__PURE__ */ D($, {
|
|
4158
4166
|
name: "dismiss",
|
|
4159
4167
|
context: {
|
|
4160
4168
|
component: e,
|
|
4161
4169
|
part: "clear-selection"
|
|
4162
4170
|
},
|
|
4163
|
-
icons:
|
|
4171
|
+
icons: f,
|
|
4164
4172
|
resolver: p,
|
|
4165
4173
|
className: "size-4"
|
|
4166
4174
|
})
|
|
@@ -4185,29 +4193,29 @@ function Ua({ component: e, items: t, selected: n, onSelectedChange: r, filter:
|
|
|
4185
4193
|
" ",
|
|
4186
4194
|
/* @__PURE__ */ D("span", {
|
|
4187
4195
|
className: "text-iui-inbox-muted-foreground font-normal",
|
|
4188
|
-
children: ut(e.until,
|
|
4196
|
+
children: ut(e.until, u, h)
|
|
4189
4197
|
})
|
|
4190
4198
|
]
|
|
4191
4199
|
}, e.label))
|
|
4192
4200
|
})] });
|
|
4193
4201
|
}
|
|
4194
4202
|
// src/NotificationCenter.tsx
|
|
4195
|
-
var
|
|
4196
|
-
function
|
|
4197
|
-
let { props: I } =
|
|
4203
|
+
var Ga = () => () => {};
|
|
4204
|
+
function Ka({ labels: e, badge: t = "count", count: i = "unseen", maxCount: c = 99, href: l, icons: u = {}, iconResolver: d, classes: f = {}, locale: p, renderItem: m, renderEmpty: h, group: g = !0, snooze: _, placement: v = "bottom-end", open: y, onOpenChange: b, onItemClick: S, onAction: w, renderTrigger: k, renderBadge: A, renderHeader: j, renderTab: M, renderLoading: N, renderError: P, renderFooter: F }) {
|
|
4205
|
+
let { props: I } = T(), L = n(), R = {
|
|
4198
4206
|
panel: `${L}-panel`,
|
|
4199
4207
|
title: `${L}-title`,
|
|
4200
4208
|
list: `${L}-list`,
|
|
4201
4209
|
tab: (e) => `${L}-tab-${e}`
|
|
4202
|
-
}, z =
|
|
4203
|
-
|
|
4210
|
+
}, z = s(X.subscribe, X.getSnapshot, X.getServerSnapshot), [B, ee] = o(!1), [V] = o(Date.now), te = s(B ? bt.subscribe : Ga, bt.getSnapshot, () => V), H = Tt(e), ne = (e) => Z(H[e]), U = z.counts[i], re = sa(z.filter, H), ie = aa(z), ae = z.categoryFilter, [oe, se] = o([]), W = la(z.items, oe), ce = ct(W, g), le = ie.length > 1, ue = a(null), K = a(null), de = a(null), q = a(null), fe = a(null), pe = a(null), me = a(ie), he = a(ae), ge = a(v), J = a(b);
|
|
4211
|
+
r(() => {
|
|
4204
4212
|
qi(), _t(I);
|
|
4205
|
-
let e, t = !1, n =
|
|
4213
|
+
let e, t = !1, n = Ma(K.current), r = xa(q.current, se, {
|
|
4206
4214
|
scroller: q.current,
|
|
4207
4215
|
listed: (e) => X.getSnapshot().items.some((t) => t.id === e)
|
|
4208
4216
|
});
|
|
4209
|
-
fe.current =
|
|
4210
|
-
let
|
|
4217
|
+
fe.current = r;
|
|
4218
|
+
let i = wa(q.current, () => X.getSnapshot().items), a = Oa(ue.current, K.current, {
|
|
4211
4219
|
onToggle(n) {
|
|
4212
4220
|
ee(n), t = n, J.current?.(n), n ? (e = window.location.href, X.opened(me.current, {
|
|
4213
4221
|
markAllAsSeen: !1,
|
|
@@ -4217,37 +4225,37 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4217
4225
|
onEndReached: () => void X.loadMore(),
|
|
4218
4226
|
placement: () => ge.current
|
|
4219
4227
|
});
|
|
4220
|
-
pe.current =
|
|
4221
|
-
let
|
|
4222
|
-
window.location.href !== e &&
|
|
4228
|
+
pe.current = a;
|
|
4229
|
+
let o = C.on("navigate", () => {
|
|
4230
|
+
window.location.href !== e && a.close();
|
|
4223
4231
|
});
|
|
4224
4232
|
return () => {
|
|
4225
|
-
t && X.closed({ markAllAsSeen: !1 }),
|
|
4233
|
+
t && X.closed({ markAllAsSeen: !1 }), o(), n(), r.destroy(), i.destroy(), a.destroy(), pe.current = null;
|
|
4226
4234
|
};
|
|
4227
|
-
}, []),
|
|
4235
|
+
}, []), r(() => pe.current?.observe(B ? de.current : null), [
|
|
4228
4236
|
z,
|
|
4229
4237
|
B,
|
|
4230
4238
|
W.length > 0
|
|
4231
|
-
]),
|
|
4232
|
-
J.current =
|
|
4233
|
-
}),
|
|
4239
|
+
]), r(() => {
|
|
4240
|
+
J.current = b, me.current = ie, he.current = ae;
|
|
4241
|
+
}), r(() => {
|
|
4234
4242
|
let e = K.current?.matches(":popover-open") ?? !1;
|
|
4235
|
-
|
|
4236
|
-
}, [
|
|
4237
|
-
ge.current =
|
|
4238
|
-
}, [
|
|
4243
|
+
y === !0 && !e ? K.current?.showPopover() : y === !1 && e && pe.current?.close();
|
|
4244
|
+
}, [y]), r(() => {
|
|
4245
|
+
ge.current = v, pe.current?.place();
|
|
4246
|
+
}, [v]), r(() => {
|
|
4239
4247
|
B && ie.length > 0 && !ie.includes(z.filter) && X.load(ie[0], z.category);
|
|
4240
4248
|
}, [ie.join()]);
|
|
4241
4249
|
let _e = () => {
|
|
4242
4250
|
let e = document.getElementById(R.panel);
|
|
4243
4251
|
e?.matches(":popover-open") && e.hidePopover();
|
|
4244
|
-
}, ve = `${z.filter}|${z.category}|${B}|${z.selectable}`, [ye, be] =
|
|
4252
|
+
}, ve = `${z.filter}|${z.category}|${B}|${z.selectable}`, [ye, be] = o([]), [xe, Se] = o(ve);
|
|
4245
4253
|
xe !== ve && (Se(ve), be([]));
|
|
4246
4254
|
let Ce = W.some((e) => ye.includes(e.id));
|
|
4247
|
-
|
|
4248
|
-
let we = (e, t) => be((n) =>
|
|
4249
|
-
let t =
|
|
4250
|
-
t?.action ?
|
|
4255
|
+
r(() => fe.current?.release(), [ve]);
|
|
4256
|
+
let we = (e, t) => be((n) => ba(n, e, t)), Te = (e) => {
|
|
4257
|
+
let t = Ta(e.nativeEvent, z.items);
|
|
4258
|
+
t?.action ? w?.(t.item, t.action, e) : t && S?.(t.item, e);
|
|
4251
4259
|
}, Ee = (e) => /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("p", {
|
|
4252
4260
|
role: "alert",
|
|
4253
4261
|
children: ne("error")
|
|
@@ -4257,7 +4265,7 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4257
4265
|
className: ki,
|
|
4258
4266
|
onClick: e,
|
|
4259
4267
|
children: ne("retry")
|
|
4260
|
-
})] }), De =
|
|
4268
|
+
})] }), De = ua(z, W.length), Oe;
|
|
4261
4269
|
return Oe = De === "loading" ? /* @__PURE__ */ D("div", {
|
|
4262
4270
|
role: "status",
|
|
4263
4271
|
className: Fi,
|
|
@@ -4268,7 +4276,7 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4268
4276
|
part: "loading"
|
|
4269
4277
|
},
|
|
4270
4278
|
icons: u,
|
|
4271
|
-
resolver:
|
|
4279
|
+
resolver: d,
|
|
4272
4280
|
className: G(Ii, "motion-safe:animate-spin")
|
|
4273
4281
|
}), /* @__PURE__ */ D("span", {
|
|
4274
4282
|
className: "sr-only",
|
|
@@ -4284,7 +4292,7 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4284
4292
|
}) : De === "empty" ? /* @__PURE__ */ D("div", {
|
|
4285
4293
|
"data-inbox-empty": "",
|
|
4286
4294
|
className: Fi,
|
|
4287
|
-
children:
|
|
4295
|
+
children: h ? h(z.filter) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D($, {
|
|
4288
4296
|
name: "empty",
|
|
4289
4297
|
context: {
|
|
4290
4298
|
component: "NotificationCenter",
|
|
@@ -4292,28 +4300,28 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4292
4300
|
filter: z.filter
|
|
4293
4301
|
},
|
|
4294
4302
|
icons: u,
|
|
4295
|
-
resolver:
|
|
4303
|
+
resolver: d,
|
|
4296
4304
|
className: Ii
|
|
4297
4305
|
}), /* @__PURE__ */ D("p", { children: re })] })
|
|
4298
4306
|
}) : /* @__PURE__ */ O(E, { children: [
|
|
4299
4307
|
/* @__PURE__ */ D("ul", {
|
|
4300
4308
|
role: "list",
|
|
4301
4309
|
"data-inbox-selecting": Ce || void 0,
|
|
4302
|
-
className: G(yi,
|
|
4303
|
-
children: ce.map((e) => /* @__PURE__ */ D(
|
|
4310
|
+
className: G(yi, f.list),
|
|
4311
|
+
children: ce.map((e) => /* @__PURE__ */ D(Ua, {
|
|
4304
4312
|
group: e,
|
|
4305
4313
|
now: te,
|
|
4306
4314
|
labels: H,
|
|
4307
4315
|
icons: u,
|
|
4308
|
-
iconResolver:
|
|
4309
|
-
classes:
|
|
4310
|
-
locale:
|
|
4316
|
+
iconResolver: d,
|
|
4317
|
+
classes: f,
|
|
4318
|
+
locale: p,
|
|
4311
4319
|
pendingActions: z.pendingActions,
|
|
4312
|
-
snooze:
|
|
4320
|
+
snooze: _,
|
|
4313
4321
|
allowedActions: z.allowedActions,
|
|
4314
4322
|
selected: z.selectable ? ye : void 0,
|
|
4315
4323
|
select: z.selectable ? we : void 0,
|
|
4316
|
-
renderItem:
|
|
4324
|
+
renderItem: m
|
|
4317
4325
|
}, e.key))
|
|
4318
4326
|
}),
|
|
4319
4327
|
z.hasMore && z.moreFailed && /* @__PURE__ */ D("div", {
|
|
@@ -4335,7 +4343,7 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4335
4343
|
part: "loading-more"
|
|
4336
4344
|
},
|
|
4337
4345
|
icons: u,
|
|
4338
|
-
resolver:
|
|
4346
|
+
resolver: d,
|
|
4339
4347
|
className: "size-5 motion-safe:animate-spin"
|
|
4340
4348
|
})
|
|
4341
4349
|
})
|
|
@@ -4349,10 +4357,10 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4349
4357
|
"aria-haspopup": "dialog",
|
|
4350
4358
|
"aria-expanded": B,
|
|
4351
4359
|
"aria-controls": R.panel,
|
|
4352
|
-
"aria-label":
|
|
4360
|
+
"aria-label": Na(H, U, c, p, z.pausedUntil !== null),
|
|
4353
4361
|
"data-inbox-bell": "",
|
|
4354
4362
|
"data-paused": z.pausedUntil === null ? void 0 : "true",
|
|
4355
|
-
className: G(di,
|
|
4363
|
+
className: G(di, f.bell),
|
|
4356
4364
|
children: k ? k({
|
|
4357
4365
|
open: B,
|
|
4358
4366
|
count: U,
|
|
@@ -4365,23 +4373,23 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4365
4373
|
part: "bell"
|
|
4366
4374
|
},
|
|
4367
4375
|
icons: u,
|
|
4368
|
-
resolver:
|
|
4376
|
+
resolver: d,
|
|
4369
4377
|
className: "size-5"
|
|
4370
4378
|
}),
|
|
4371
|
-
|
|
4379
|
+
t !== "none" && U > 0 && A && A({
|
|
4372
4380
|
count: U,
|
|
4373
|
-
text: St(U,
|
|
4381
|
+
text: St(U, c, p)
|
|
4374
4382
|
}),
|
|
4375
|
-
|
|
4383
|
+
t === "count" && U > 0 && !A && /* @__PURE__ */ D("span", {
|
|
4376
4384
|
"data-inbox-badge": "",
|
|
4377
4385
|
"aria-hidden": "true",
|
|
4378
|
-
className: G("bg-iui-inbox-badge text-iui-inbox-badge-foreground absolute -inset-e-0.5 -top-0.5 flex h-4.5 min-w-4.5 items-center justify-center rounded-full px-1 text-[0.6875rem] leading-none font-semibold tabular-nums",
|
|
4379
|
-
children: St(U,
|
|
4386
|
+
className: G("bg-iui-inbox-badge text-iui-inbox-badge-foreground absolute -inset-e-0.5 -top-0.5 flex h-4.5 min-w-4.5 items-center justify-center rounded-full px-1 text-[0.6875rem] leading-none font-semibold tabular-nums", f.badge),
|
|
4387
|
+
children: St(U, c, p)
|
|
4380
4388
|
}),
|
|
4381
|
-
|
|
4389
|
+
t === "dot" && U > 0 && !A && /* @__PURE__ */ D("span", {
|
|
4382
4390
|
"data-inbox-badge": "",
|
|
4383
4391
|
"aria-hidden": "true",
|
|
4384
|
-
className: G("bg-iui-inbox-badge absolute inset-e-1.5 top-1.5 size-2 rounded-full forced-color-adjust-none forced-colors:bg-[Highlight]",
|
|
4392
|
+
className: G("bg-iui-inbox-badge absolute inset-e-1.5 top-1.5 size-2 rounded-full forced-color-adjust-none forced-colors:bg-[Highlight]", f.badge)
|
|
4385
4393
|
})
|
|
4386
4394
|
] })
|
|
4387
4395
|
}), /* @__PURE__ */ D("div", {
|
|
@@ -4392,13 +4400,13 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4392
4400
|
"aria-labelledby": R.title,
|
|
4393
4401
|
tabIndex: -1,
|
|
4394
4402
|
"data-inbox-panel": "",
|
|
4395
|
-
className: G(fi,
|
|
4396
|
-
onKeyDown: (e) =>
|
|
4403
|
+
className: G(fi, f.panel),
|
|
4404
|
+
onKeyDown: (e) => ja(e.nativeEvent, K.current),
|
|
4397
4405
|
onClickCapture: Te,
|
|
4398
4406
|
children: /* @__PURE__ */ O("div", {
|
|
4399
4407
|
className: pi,
|
|
4400
4408
|
children: [
|
|
4401
|
-
/* @__PURE__ */ D(
|
|
4409
|
+
/* @__PURE__ */ D(Ba, {
|
|
4402
4410
|
component: "NotificationCenter",
|
|
4403
4411
|
state: z,
|
|
4404
4412
|
filter: z.filter,
|
|
@@ -4406,10 +4414,10 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4406
4414
|
items: z.items,
|
|
4407
4415
|
labels: H,
|
|
4408
4416
|
icons: u,
|
|
4409
|
-
iconResolver:
|
|
4410
|
-
classes:
|
|
4411
|
-
locale:
|
|
4412
|
-
maxCount:
|
|
4417
|
+
iconResolver: d,
|
|
4418
|
+
classes: f,
|
|
4419
|
+
locale: p,
|
|
4420
|
+
maxCount: c,
|
|
4413
4421
|
now: te,
|
|
4414
4422
|
panel: {
|
|
4415
4423
|
titleId: R.title,
|
|
@@ -4442,7 +4450,7 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4442
4450
|
})
|
|
4443
4451
|
}), Oe]
|
|
4444
4452
|
}),
|
|
4445
|
-
/* @__PURE__ */ D(
|
|
4453
|
+
/* @__PURE__ */ D(Wa, {
|
|
4446
4454
|
component: "NotificationCenter",
|
|
4447
4455
|
items: W,
|
|
4448
4456
|
selected: ye,
|
|
@@ -4452,16 +4460,16 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4452
4460
|
now: te,
|
|
4453
4461
|
labels: H,
|
|
4454
4462
|
icons: u,
|
|
4455
|
-
iconResolver:
|
|
4456
|
-
classes:
|
|
4457
|
-
locale:
|
|
4458
|
-
snooze:
|
|
4463
|
+
iconResolver: d,
|
|
4464
|
+
classes: f,
|
|
4465
|
+
locale: p,
|
|
4466
|
+
snooze: _
|
|
4459
4467
|
}),
|
|
4460
4468
|
F ? F({
|
|
4461
|
-
href:
|
|
4469
|
+
href: l,
|
|
4462
4470
|
close: _e
|
|
4463
|
-
}) :
|
|
4464
|
-
href:
|
|
4471
|
+
}) : l && /* @__PURE__ */ D(x, {
|
|
4472
|
+
href: l,
|
|
4465
4473
|
"data-inbox-view-all": "",
|
|
4466
4474
|
className: "border-iui-inbox-border text-iui-inbox-accent hover:bg-iui-inbox-control-hover focus-visible:ring-iui-inbox-ring block border-t px-4 py-2.5 text-center text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset",
|
|
4467
4475
|
children: ne("viewAll")
|
|
@@ -4472,35 +4480,35 @@ function Ga({ labels: e, badge: n = "count", count: i = "unseen", maxCount: o =
|
|
|
4472
4480
|
});
|
|
4473
4481
|
}
|
|
4474
4482
|
// src/NotificationList.tsx
|
|
4475
|
-
function
|
|
4476
|
-
let A =
|
|
4483
|
+
function qa({ data: e, filter: t, labels: n, icons: c = {}, iconResolver: l, classes: u = {}, locale: d, buffer: f = 250, manual: p = !1, preserveUrl: m = !1, renderItem: h, renderEmpty: g, category: _, group: v = !0, snooze: y, maxCount: x = 99, renderHeader: S, renderTab: C, onItemClick: w, onAction: k }) {
|
|
4484
|
+
let A = T(), j = s(X.subscribe, X.getSnapshot, X.getServerSnapshot), [M] = o(Date.now), N = s(bt.subscribe, bt.getSnapshot, () => M), { filter: P, category: F } = ha(A.url, j, t, _), I = Tt(n), L = sa(P, I), R = a(null), z = A.props[e]?.data, B = i(() => Array.isArray(z) ? z.map(We).filter((e) => e !== void 0) : [], [z]), ee = i(() => st(X, B, P, F), [
|
|
4477
4485
|
B,
|
|
4478
4486
|
P,
|
|
4479
4487
|
F,
|
|
4480
4488
|
j
|
|
4481
|
-
]), [V, te] =
|
|
4489
|
+
]), [V, te] = o([]), H = la(ee, V), ne = ct(H, v), U = !!A.scrollProps?.[e]?.nextPage, re = a(null), ie = a(H), ae = a({
|
|
4482
4490
|
loaded: B,
|
|
4483
4491
|
filter: P,
|
|
4484
4492
|
category: F
|
|
4485
4493
|
});
|
|
4486
|
-
|
|
4494
|
+
r(() => {
|
|
4487
4495
|
ie.current = H, ae.current = {
|
|
4488
4496
|
loaded: B,
|
|
4489
4497
|
filter: P,
|
|
4490
4498
|
category: F
|
|
4491
4499
|
};
|
|
4492
4500
|
});
|
|
4493
|
-
let oe = (
|
|
4501
|
+
let oe = (t, n) => ma(A.url, t, n, A.scrollProps?.[e]?.pageName), se = `${P}|${F}|${j.selectable}`, [W, ce] = o([]), [le, ue] = o(se);
|
|
4494
4502
|
le !== se && (ue(se), ce([]));
|
|
4495
4503
|
let K = H.some((e) => W.includes(e.id));
|
|
4496
|
-
|
|
4497
|
-
let de = (e, t) => ce((n) =>
|
|
4498
|
-
return
|
|
4504
|
+
r(() => re.current?.release(), [se]);
|
|
4505
|
+
let de = (e, t) => ce((n) => ba(n, e, t));
|
|
4506
|
+
return r(() => {
|
|
4499
4507
|
qi(), _t(A.props);
|
|
4500
|
-
}, []),
|
|
4501
|
-
let e =
|
|
4508
|
+
}, []), r(() => X.remember(B), [B]), r(() => Ma(R.current), []), r(() => {
|
|
4509
|
+
let e = xa(R.current, te, { listed: (e) => st(X, ae.current.loaded, ae.current.filter, ae.current.category).some((t) => t.id === e) });
|
|
4502
4510
|
re.current = e;
|
|
4503
|
-
let t =
|
|
4511
|
+
let t = wa(R.current, () => ie.current, null);
|
|
4504
4512
|
return () => {
|
|
4505
4513
|
e.destroy(), t.destroy(), re.current = null;
|
|
4506
4514
|
};
|
|
@@ -4508,28 +4516,28 @@ function Ka({ data: t, filter: n, labels: r, icons: i = {}, iconResolver: o, cla
|
|
|
4508
4516
|
ref: R,
|
|
4509
4517
|
"data-inbox-list": "",
|
|
4510
4518
|
tabIndex: -1,
|
|
4511
|
-
onKeyDown: (e) =>
|
|
4519
|
+
onKeyDown: (e) => ja(e.nativeEvent, R.current),
|
|
4512
4520
|
onClickCapture: (e) => {
|
|
4513
|
-
let t =
|
|
4514
|
-
t?.action ? k?.(t.item, t.action, e) : t &&
|
|
4521
|
+
let t = Ta(e.nativeEvent, H);
|
|
4522
|
+
t?.action ? k?.(t.item, t.action, e) : t && w?.(t.item, e);
|
|
4515
4523
|
},
|
|
4516
4524
|
children: [
|
|
4517
|
-
/* @__PURE__ */ D(
|
|
4525
|
+
/* @__PURE__ */ D(Ba, {
|
|
4518
4526
|
component: "NotificationList",
|
|
4519
4527
|
state: j,
|
|
4520
4528
|
filter: P,
|
|
4521
4529
|
category: F,
|
|
4522
4530
|
items: H,
|
|
4523
4531
|
labels: I,
|
|
4524
|
-
icons:
|
|
4525
|
-
iconResolver:
|
|
4526
|
-
classes:
|
|
4527
|
-
locale:
|
|
4528
|
-
maxCount:
|
|
4532
|
+
icons: c,
|
|
4533
|
+
iconResolver: l,
|
|
4534
|
+
classes: u,
|
|
4535
|
+
locale: d,
|
|
4536
|
+
maxCount: x,
|
|
4529
4537
|
now: N,
|
|
4530
4538
|
href: oe,
|
|
4531
|
-
renderHeader:
|
|
4532
|
-
renderTab:
|
|
4539
|
+
renderHeader: S,
|
|
4540
|
+
renderTab: C
|
|
4533
4541
|
}),
|
|
4534
4542
|
/* @__PURE__ */ D("div", {
|
|
4535
4543
|
"aria-live": "polite",
|
|
@@ -4542,16 +4550,16 @@ function Ka({ data: t, filter: n, labels: r, icons: i = {}, iconResolver: o, cla
|
|
|
4542
4550
|
children: Z(I.showNew, { count: V.length })
|
|
4543
4551
|
})
|
|
4544
4552
|
}),
|
|
4545
|
-
/* @__PURE__ */ D(
|
|
4546
|
-
data:
|
|
4547
|
-
buffer:
|
|
4548
|
-
manual:
|
|
4549
|
-
preserveUrl:
|
|
4553
|
+
/* @__PURE__ */ D(b, {
|
|
4554
|
+
data: e,
|
|
4555
|
+
buffer: f,
|
|
4556
|
+
manual: p,
|
|
4557
|
+
preserveUrl: m,
|
|
4550
4558
|
as: "ul",
|
|
4551
4559
|
role: "list",
|
|
4552
4560
|
hidden: H.length === 0 || void 0,
|
|
4553
4561
|
"data-inbox-selecting": K || void 0,
|
|
4554
|
-
className: G(yi,
|
|
4562
|
+
className: G(yi, u.list),
|
|
4555
4563
|
loading: /* @__PURE__ */ O("div", {
|
|
4556
4564
|
role: "status",
|
|
4557
4565
|
className: Li,
|
|
@@ -4561,15 +4569,15 @@ function Ka({ data: t, filter: n, labels: r, icons: i = {}, iconResolver: o, cla
|
|
|
4561
4569
|
component: "NotificationList",
|
|
4562
4570
|
part: "loading-more"
|
|
4563
4571
|
},
|
|
4564
|
-
icons:
|
|
4565
|
-
resolver:
|
|
4572
|
+
icons: c,
|
|
4573
|
+
resolver: l,
|
|
4566
4574
|
className: ci
|
|
4567
4575
|
}), /* @__PURE__ */ D("span", {
|
|
4568
4576
|
className: "sr-only",
|
|
4569
4577
|
children: Z(I.loading)
|
|
4570
4578
|
})]
|
|
4571
4579
|
}),
|
|
4572
|
-
next:
|
|
4580
|
+
next: p ? ({ fetch: e, hasMore: t, loading: n }) => t && /* @__PURE__ */ D("div", {
|
|
4573
4581
|
className: "text-iui-inbox-muted-foreground flex justify-center py-3",
|
|
4574
4582
|
children: /* @__PURE__ */ D("button", {
|
|
4575
4583
|
type: "button",
|
|
@@ -4580,40 +4588,40 @@ function Ka({ data: t, filter: n, labels: r, icons: i = {}, iconResolver: o, cla
|
|
|
4580
4588
|
children: Z(I.loadMore)
|
|
4581
4589
|
})
|
|
4582
4590
|
}) : void 0,
|
|
4583
|
-
children: ne.map((e) => /* @__PURE__ */ D(
|
|
4591
|
+
children: ne.map((e) => /* @__PURE__ */ D(Ua, {
|
|
4584
4592
|
group: e,
|
|
4585
4593
|
now: N,
|
|
4586
4594
|
labels: I,
|
|
4587
|
-
icons:
|
|
4588
|
-
iconResolver:
|
|
4589
|
-
classes:
|
|
4590
|
-
locale:
|
|
4595
|
+
icons: c,
|
|
4596
|
+
iconResolver: l,
|
|
4597
|
+
classes: u,
|
|
4598
|
+
locale: d,
|
|
4591
4599
|
pendingActions: j.pendingActions,
|
|
4592
|
-
snooze:
|
|
4600
|
+
snooze: y,
|
|
4593
4601
|
allowedActions: j.allowedActions,
|
|
4594
4602
|
selected: j.selectable ? W : void 0,
|
|
4595
4603
|
select: j.selectable ? de : void 0,
|
|
4596
|
-
renderItem:
|
|
4604
|
+
renderItem: h
|
|
4597
4605
|
}, e.key))
|
|
4598
4606
|
}),
|
|
4599
4607
|
H.length === 0 && !U && /* @__PURE__ */ D("div", {
|
|
4600
4608
|
"data-inbox-empty": "",
|
|
4601
4609
|
className: "text-iui-inbox-muted-foreground flex flex-col items-center gap-3 px-6 py-12 text-center text-sm",
|
|
4602
|
-
children:
|
|
4610
|
+
children: g ? g(P) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D($, {
|
|
4603
4611
|
name: "empty",
|
|
4604
4612
|
context: {
|
|
4605
4613
|
component: "NotificationList",
|
|
4606
4614
|
part: "empty",
|
|
4607
4615
|
filter: P
|
|
4608
4616
|
},
|
|
4609
|
-
icons:
|
|
4610
|
-
resolver:
|
|
4617
|
+
icons: c,
|
|
4618
|
+
resolver: l,
|
|
4611
4619
|
className: "text-iui-inbox-icon size-8"
|
|
4612
4620
|
}), /* @__PURE__ */ D("p", { children: L })] })
|
|
4613
4621
|
}),
|
|
4614
4622
|
K && /* @__PURE__ */ D("div", {
|
|
4615
4623
|
className: "bg-iui-inbox-surface sticky bottom-0 z-20",
|
|
4616
|
-
children: /* @__PURE__ */ D(
|
|
4624
|
+
children: /* @__PURE__ */ D(Wa, {
|
|
4617
4625
|
component: "NotificationList",
|
|
4618
4626
|
items: H,
|
|
4619
4627
|
selected: W,
|
|
@@ -4622,26 +4630,26 @@ function Ka({ data: t, filter: n, labels: r, icons: i = {}, iconResolver: o, cla
|
|
|
4622
4630
|
allowedActions: j.allowedActions,
|
|
4623
4631
|
now: N,
|
|
4624
4632
|
labels: I,
|
|
4625
|
-
icons:
|
|
4626
|
-
iconResolver:
|
|
4627
|
-
classes:
|
|
4628
|
-
locale:
|
|
4629
|
-
snooze:
|
|
4633
|
+
icons: c,
|
|
4634
|
+
iconResolver: l,
|
|
4635
|
+
classes: u,
|
|
4636
|
+
locale: d,
|
|
4637
|
+
snooze: y
|
|
4630
4638
|
})
|
|
4631
4639
|
})
|
|
4632
4640
|
]
|
|
4633
4641
|
});
|
|
4634
4642
|
}
|
|
4635
4643
|
// src/usePreferences.ts
|
|
4636
|
-
var
|
|
4637
|
-
function
|
|
4638
|
-
let { props: e } =
|
|
4639
|
-
return
|
|
4640
|
-
qi(), _t(e),
|
|
4644
|
+
var Ja = () => kn.load(X.getSnapshot().url);
|
|
4645
|
+
function Ya() {
|
|
4646
|
+
let { props: e } = T(), t = s(kn.subscribe, kn.getSnapshot, () => qt), n = i(() => tn(t), [t]);
|
|
4647
|
+
return r(() => {
|
|
4648
|
+
qi(), _t(e), Ja();
|
|
4641
4649
|
}, []), {
|
|
4642
4650
|
...t,
|
|
4643
4651
|
sections: n,
|
|
4644
|
-
load:
|
|
4652
|
+
load: Ja,
|
|
4645
4653
|
set: kn.set,
|
|
4646
4654
|
setChannel: kn.setChannel,
|
|
4647
4655
|
setFrequency: kn.setFrequency,
|
|
@@ -4652,10 +4660,10 @@ function Ja() {
|
|
|
4652
4660
|
};
|
|
4653
4661
|
}
|
|
4654
4662
|
// src/usePush.ts
|
|
4655
|
-
var
|
|
4656
|
-
function
|
|
4657
|
-
let { props: e } =
|
|
4658
|
-
return
|
|
4663
|
+
var Xa = () => Mn;
|
|
4664
|
+
function Za() {
|
|
4665
|
+
let { props: e } = T(), t = s(Jn.subscribe, Jn.getSnapshot, Xa);
|
|
4666
|
+
return r(() => {
|
|
4659
4667
|
qi(), _t(e);
|
|
4660
4668
|
}, []), {
|
|
4661
4669
|
...t,
|
|
@@ -4667,16 +4675,16 @@ function Xa() {
|
|
|
4667
4675
|
};
|
|
4668
4676
|
}
|
|
4669
4677
|
// src/NotificationPreferences.tsx
|
|
4670
|
-
function
|
|
4671
|
-
let { status:
|
|
4672
|
-
|
|
4678
|
+
function Qa({ labels: e, classes: r = {}, locale: i, renderCategory: a, renderGroup: c, renderChannel: l, renderEmpty: u }) {
|
|
4679
|
+
let { status: d, channels: f, categories: p, sections: m, notificationHours: h, frequencies: g, load: _, setChannel: v, setFrequency: y, setNotificationHours: b, receives: x, frequencyApplies: S, isDisabled: C } = Ya(), w = Za(), [T, k] = o(null), A = On(e), j = (e) => Z(A[e]), M = An(f, p, g, A), N = f.some((e) => e.push) ? Pn(w) : null, [P] = o(Date.now), F = s(bt.subscribe, bt.getSnapshot, () => P), I = Yn(w.devices, A, F, i), L = n(), R = N !== null;
|
|
4680
|
+
t(() => {
|
|
4673
4681
|
R && Jn.loadDevices();
|
|
4674
4682
|
}, [R]);
|
|
4675
4683
|
let z = (e) => {
|
|
4676
4684
|
let t = vn(h, T, e);
|
|
4677
4685
|
t && (k(t.editing), b({ days: { [e.day]: t.ranges } }));
|
|
4678
4686
|
};
|
|
4679
|
-
return
|
|
4687
|
+
return d === "error" ? /* @__PURE__ */ D("div", {
|
|
4680
4688
|
"data-inbox-preferences": "",
|
|
4681
4689
|
children: /* @__PURE__ */ O("div", {
|
|
4682
4690
|
"data-inbox-preferences-error": "",
|
|
@@ -4688,12 +4696,12 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4688
4696
|
children: j("retry")
|
|
4689
4697
|
})]
|
|
4690
4698
|
})
|
|
4691
|
-
}) :
|
|
4699
|
+
}) : p.length === 0 ? /* @__PURE__ */ D("div", {
|
|
4692
4700
|
"data-inbox-preferences": "",
|
|
4693
|
-
children:
|
|
4701
|
+
children: d === "ready" ? /* @__PURE__ */ D("div", {
|
|
4694
4702
|
"data-inbox-preferences-empty": "",
|
|
4695
4703
|
className: Fi,
|
|
4696
|
-
children:
|
|
4704
|
+
children: u ? u() : /* @__PURE__ */ D("p", { children: j("empty") })
|
|
4697
4705
|
}) : /* @__PURE__ */ O("div", {
|
|
4698
4706
|
role: "status",
|
|
4699
4707
|
className: Fi,
|
|
@@ -4715,7 +4723,7 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4715
4723
|
/* @__PURE__ */ D("div", {
|
|
4716
4724
|
className: Ri,
|
|
4717
4725
|
children: /* @__PURE__ */ O("table", {
|
|
4718
|
-
className: G(zi,
|
|
4726
|
+
className: G(zi, r.table),
|
|
4719
4727
|
children: [
|
|
4720
4728
|
/* @__PURE__ */ D("caption", {
|
|
4721
4729
|
className: "sr-only",
|
|
@@ -4724,37 +4732,37 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4724
4732
|
/* @__PURE__ */ D("thead", { children: /* @__PURE__ */ O("tr", { children: [
|
|
4725
4733
|
/* @__PURE__ */ D("th", {
|
|
4726
4734
|
scope: "col",
|
|
4727
|
-
className: G(Bi,
|
|
4735
|
+
className: G(Bi, r.head),
|
|
4728
4736
|
children: j("category")
|
|
4729
4737
|
}),
|
|
4730
|
-
|
|
4738
|
+
f.map((e) => /* @__PURE__ */ D("th", {
|
|
4731
4739
|
scope: "col",
|
|
4732
|
-
className: G(Vi,
|
|
4733
|
-
children:
|
|
4740
|
+
className: G(Vi, r.head),
|
|
4741
|
+
children: l ? l(e) : e.label
|
|
4734
4742
|
}, e.key)),
|
|
4735
4743
|
M.hasFrequencies && /* @__PURE__ */ D("th", {
|
|
4736
4744
|
scope: "col",
|
|
4737
|
-
className: G("text-iui-inbox-muted-foreground w-40 px-4 py-2.5 text-start text-xs font-medium",
|
|
4745
|
+
className: G("text-iui-inbox-muted-foreground w-40 px-4 py-2.5 text-start text-xs font-medium", r.head),
|
|
4738
4746
|
children: j("frequency")
|
|
4739
4747
|
})
|
|
4740
4748
|
] }) }),
|
|
4741
4749
|
M.hasGlobalSwitches && /* @__PURE__ */ D("tbody", {
|
|
4742
4750
|
"data-inbox-preferences-global": "",
|
|
4743
4751
|
children: /* @__PURE__ */ O("tr", {
|
|
4744
|
-
className: G("border-iui-inbox-border border-t",
|
|
4752
|
+
className: G("border-iui-inbox-border border-t", r.row),
|
|
4745
4753
|
children: [
|
|
4746
4754
|
/* @__PURE__ */ O("th", {
|
|
4747
4755
|
scope: "row",
|
|
4748
4756
|
className: "min-w-36 px-4 py-3 text-start align-top font-normal",
|
|
4749
4757
|
children: [/* @__PURE__ */ D("span", {
|
|
4750
|
-
className: G("text-iui-inbox-foreground font-medium",
|
|
4758
|
+
className: G("text-iui-inbox-foreground font-medium", r.label),
|
|
4751
4759
|
children: j("global")
|
|
4752
4760
|
}), /* @__PURE__ */ D("span", {
|
|
4753
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4761
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4754
4762
|
children: j("globalDescription")
|
|
4755
4763
|
})]
|
|
4756
4764
|
}),
|
|
4757
|
-
|
|
4765
|
+
f.map((e) => /* @__PURE__ */ D("td", {
|
|
4758
4766
|
className: "px-2 py-3 text-center align-middle",
|
|
4759
4767
|
children: e.globalSwitch && /* @__PURE__ */ D("button", {
|
|
4760
4768
|
type: "button",
|
|
@@ -4765,7 +4773,7 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4765
4773
|
channel: e.label
|
|
4766
4774
|
}),
|
|
4767
4775
|
"data-inbox-preference-channel": e.key,
|
|
4768
|
-
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors",
|
|
4776
|
+
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", r.switch),
|
|
4769
4777
|
onClick: () => void v(e.key, !e.enabled),
|
|
4770
4778
|
children: /* @__PURE__ */ D("span", {
|
|
4771
4779
|
"aria-hidden": "true",
|
|
@@ -4784,65 +4792,65 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4784
4792
|
children: /* @__PURE__ */ D("th", {
|
|
4785
4793
|
scope: "rowgroup",
|
|
4786
4794
|
colSpan: M.columns,
|
|
4787
|
-
className: G("bg-iui-inbox-control-hover/50 px-4 pt-4 pb-2 text-start font-normal",
|
|
4788
|
-
children:
|
|
4795
|
+
className: G("bg-iui-inbox-control-hover/50 px-4 pt-4 pb-2 text-start font-normal", r.group),
|
|
4796
|
+
children: c ? c(e.group) : /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("span", {
|
|
4789
4797
|
className: "text-iui-inbox-foreground font-semibold",
|
|
4790
4798
|
children: e.group.label
|
|
4791
4799
|
}), e.group.description && /* @__PURE__ */ D("span", {
|
|
4792
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4800
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4793
4801
|
children: e.group.description
|
|
4794
4802
|
})] })
|
|
4795
4803
|
})
|
|
4796
4804
|
}), e.categories.map((e) => /* @__PURE__ */ O("tr", {
|
|
4797
4805
|
"data-inbox-preference-category": e.key,
|
|
4798
|
-
className: G(Hi,
|
|
4806
|
+
className: G(Hi, r.row),
|
|
4799
4807
|
children: [
|
|
4800
4808
|
/* @__PURE__ */ D("th", {
|
|
4801
4809
|
scope: "row",
|
|
4802
4810
|
className: Ui,
|
|
4803
|
-
children:
|
|
4811
|
+
children: a ? a(e) : /* @__PURE__ */ O(E, { children: [
|
|
4804
4812
|
/* @__PURE__ */ D("span", {
|
|
4805
|
-
className: G(Wi,
|
|
4813
|
+
className: G(Wi, r.label),
|
|
4806
4814
|
children: e.label
|
|
4807
4815
|
}),
|
|
4808
4816
|
e.locked && /* @__PURE__ */ D("span", {
|
|
4809
|
-
className: G("bg-iui-inbox-control-hover text-iui-inbox-muted-foreground inline-block rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap",
|
|
4817
|
+
className: G("bg-iui-inbox-control-hover text-iui-inbox-muted-foreground inline-block rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap", r.badge),
|
|
4810
4818
|
children: j("locked")
|
|
4811
4819
|
}),
|
|
4812
4820
|
e.description && /* @__PURE__ */ D("span", {
|
|
4813
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4821
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4814
4822
|
children: e.description
|
|
4815
4823
|
})
|
|
4816
4824
|
] })
|
|
4817
4825
|
}),
|
|
4818
|
-
|
|
4826
|
+
f.map((t) => /* @__PURE__ */ D("td", {
|
|
4819
4827
|
className: Gi,
|
|
4820
|
-
children: e.channels[
|
|
4828
|
+
children: e.channels[t.key] !== void 0 && /* @__PURE__ */ D("button", {
|
|
4821
4829
|
type: "button",
|
|
4822
4830
|
role: "switch",
|
|
4823
|
-
"aria-checked": x(e,
|
|
4824
|
-
"aria-disabled": C(e,
|
|
4831
|
+
"aria-checked": x(e, t),
|
|
4832
|
+
"aria-disabled": C(e, t) || void 0,
|
|
4825
4833
|
"aria-label": Z(A.toggle, {
|
|
4826
4834
|
category: e.label,
|
|
4827
|
-
channel:
|
|
4835
|
+
channel: t.label
|
|
4828
4836
|
}),
|
|
4829
|
-
"data-inbox-preference": `${e.key}.${
|
|
4830
|
-
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors",
|
|
4831
|
-
onClick: () => jn(e,
|
|
4837
|
+
"data-inbox-preference": `${e.key}.${t.key}`,
|
|
4838
|
+
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", r.switch),
|
|
4839
|
+
onClick: () => jn(e, t, f),
|
|
4832
4840
|
children: /* @__PURE__ */ D("span", {
|
|
4833
4841
|
"aria-hidden": "true",
|
|
4834
4842
|
className: "bg-iui-inbox-surface ms-0.5 size-4 rounded-full shadow-sm forced-color-adjust-none group-aria-checked/switch:translate-x-4 forced-colors:bg-[ButtonText] forced-colors:group-aria-checked/switch:bg-[Highlight] motion-safe:transition-transform rtl:group-aria-checked/switch:-translate-x-4"
|
|
4835
4843
|
})
|
|
4836
4844
|
})
|
|
4837
|
-
},
|
|
4845
|
+
}, t.key)),
|
|
4838
4846
|
M.hasFrequencies && /* @__PURE__ */ D("td", {
|
|
4839
4847
|
className: "px-4 py-3 text-start align-middle",
|
|
4840
4848
|
children: e.frequency !== null && /* @__PURE__ */ D("select", {
|
|
4841
4849
|
value: e.frequency,
|
|
4842
|
-
disabled: !S(e,
|
|
4850
|
+
disabled: !S(e, f),
|
|
4843
4851
|
"aria-label": Z(A.frequencyLabel, { category: e.label }),
|
|
4844
4852
|
"data-inbox-preference-frequency": e.key,
|
|
4845
|
-
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring min-w-full border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50",
|
|
4853
|
+
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring min-w-full border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", r.select),
|
|
4846
4854
|
onChange: (t) => void y(e.key, t.target.value),
|
|
4847
4855
|
children: M.frequencyOptions.map((e) => /* @__PURE__ */ D("option", {
|
|
4848
4856
|
value: e.value,
|
|
@@ -4866,16 +4874,16 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4866
4874
|
children: [/* @__PURE__ */ O("div", {
|
|
4867
4875
|
className: "min-w-0 grow basis-64",
|
|
4868
4876
|
children: [/* @__PURE__ */ D("span", {
|
|
4869
|
-
className: G("text-iui-inbox-foreground font-medium",
|
|
4877
|
+
className: G("text-iui-inbox-foreground font-medium", r.label),
|
|
4870
4878
|
children: j("pushDevice")
|
|
4871
4879
|
}), /* @__PURE__ */ D("div", {
|
|
4872
4880
|
"aria-live": "polite",
|
|
4873
4881
|
"data-inbox-push-device-status": "",
|
|
4874
4882
|
children: N.hint ? /* @__PURE__ */ D("p", {
|
|
4875
|
-
className: G("bg-iui-inbox-control-hover text-iui-inbox-foreground mt-2 rounded-md px-3 py-2",
|
|
4883
|
+
className: G("bg-iui-inbox-control-hover text-iui-inbox-foreground mt-2 rounded-md px-3 py-2", r.description),
|
|
4876
4884
|
children: j(N.text)
|
|
4877
4885
|
}) : /* @__PURE__ */ D("span", {
|
|
4878
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4886
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4879
4887
|
children: j(N.text)
|
|
4880
4888
|
})
|
|
4881
4889
|
})]
|
|
@@ -4910,10 +4918,10 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4910
4918
|
children: [/* @__PURE__ */ O("div", {
|
|
4911
4919
|
className: "min-w-0 grow",
|
|
4912
4920
|
children: [/* @__PURE__ */ D("span", {
|
|
4913
|
-
className: G("text-iui-inbox-foreground font-medium",
|
|
4921
|
+
className: G("text-iui-inbox-foreground font-medium", r.label),
|
|
4914
4922
|
children: e.name
|
|
4915
4923
|
}), /* @__PURE__ */ D("span", {
|
|
4916
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4924
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4917
4925
|
children: e.active
|
|
4918
4926
|
})]
|
|
4919
4927
|
}), /* @__PURE__ */ D("button", {
|
|
@@ -4939,24 +4947,24 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4939
4947
|
"aria-checked": h.enabled,
|
|
4940
4948
|
"aria-label": j("notificationHours"),
|
|
4941
4949
|
"data-inbox-notification-hours": "",
|
|
4942
|
-
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors",
|
|
4950
|
+
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", r.switch),
|
|
4943
4951
|
onClick: () => void b({ enabled: !h.enabled }),
|
|
4944
4952
|
children: /* @__PURE__ */ D("span", {
|
|
4945
4953
|
"aria-hidden": "true",
|
|
4946
4954
|
className: "bg-iui-inbox-surface ms-0.5 size-4 rounded-full shadow-sm forced-color-adjust-none group-aria-checked/switch:translate-x-4 forced-colors:bg-[ButtonText] forced-colors:group-aria-checked/switch:bg-[Highlight] motion-safe:transition-transform rtl:group-aria-checked/switch:-translate-x-4"
|
|
4947
4955
|
})
|
|
4948
4956
|
}), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("span", {
|
|
4949
|
-
className: G("text-iui-inbox-foreground font-medium",
|
|
4957
|
+
className: G("text-iui-inbox-foreground font-medium", r.label),
|
|
4950
4958
|
children: j("notificationHours")
|
|
4951
4959
|
}), /* @__PURE__ */ D("span", {
|
|
4952
|
-
className: G("text-iui-inbox-muted-foreground mt-0.5 block",
|
|
4960
|
+
className: G("text-iui-inbox-muted-foreground mt-0.5 block", r.description),
|
|
4953
4961
|
children: j("notificationHoursDescription")
|
|
4954
4962
|
})] })]
|
|
4955
4963
|
}), /* @__PURE__ */ D("div", {
|
|
4956
4964
|
className: "mt-3 flex flex-col gap-3 sm:gap-2",
|
|
4957
|
-
children: _n(h, T,
|
|
4965
|
+
children: _n(h, T, i).map(({ day: e, name: t, ranges: n, locked: i, canAdd: a }) => /* @__PURE__ */ O("div", {
|
|
4958
4966
|
role: "group",
|
|
4959
|
-
"aria-label":
|
|
4967
|
+
"aria-label": t,
|
|
4960
4968
|
"data-inbox-notification-hours-day": e,
|
|
4961
4969
|
className: "flex flex-wrap items-start gap-x-4 gap-y-2",
|
|
4962
4970
|
onBlur: (e) => {
|
|
@@ -4967,11 +4975,11 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4967
4975
|
children: [/* @__PURE__ */ D("button", {
|
|
4968
4976
|
type: "button",
|
|
4969
4977
|
role: "switch",
|
|
4970
|
-
"aria-checked":
|
|
4978
|
+
"aria-checked": n.length > 0,
|
|
4971
4979
|
"aria-disabled": i || void 0,
|
|
4972
|
-
"aria-label": Z(A.notificationHoursDay, { day:
|
|
4980
|
+
"aria-label": Z(A.notificationHoursDay, { day: t }),
|
|
4973
4981
|
"data-inbox-notification-hours-day-switch": "",
|
|
4974
|
-
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors",
|
|
4982
|
+
className: G("group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", r.switch),
|
|
4975
4983
|
onClick: () => z({
|
|
4976
4984
|
kind: "toggle",
|
|
4977
4985
|
day: e
|
|
@@ -4980,10 +4988,10 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4980
4988
|
"aria-hidden": "true",
|
|
4981
4989
|
className: "bg-iui-inbox-surface ms-0.5 size-4 rounded-full shadow-sm forced-color-adjust-none group-aria-checked/switch:translate-x-4 forced-colors:bg-[ButtonText] forced-colors:group-aria-checked/switch:bg-[Highlight] motion-safe:transition-transform rtl:group-aria-checked/switch:-translate-x-4"
|
|
4982
4990
|
})
|
|
4983
|
-
}), /* @__PURE__ */ D("span", { children:
|
|
4984
|
-
}),
|
|
4991
|
+
}), /* @__PURE__ */ D("span", { children: t })]
|
|
4992
|
+
}), n.length > 0 ? /* @__PURE__ */ D("div", {
|
|
4985
4993
|
className: "flex min-w-0 grow basis-60 flex-col items-start gap-2",
|
|
4986
|
-
children:
|
|
4994
|
+
children: n.map(([i, o], s) => /* @__PURE__ */ O("div", {
|
|
4987
4995
|
className: "flex flex-wrap items-center gap-x-3 gap-y-2",
|
|
4988
4996
|
children: [
|
|
4989
4997
|
/* @__PURE__ */ O("label", {
|
|
@@ -4997,7 +5005,7 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
4997
5005
|
value: i,
|
|
4998
5006
|
disabled: !h.enabled,
|
|
4999
5007
|
"data-inbox-notification-hours-start": "",
|
|
5000
|
-
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50",
|
|
5008
|
+
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", r.time),
|
|
5001
5009
|
onChange: (t) => z({
|
|
5002
5010
|
kind: "time",
|
|
5003
5011
|
day: e,
|
|
@@ -5023,7 +5031,7 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
5023
5031
|
value: o,
|
|
5024
5032
|
disabled: !h.enabled,
|
|
5025
5033
|
"data-inbox-notification-hours-end": "",
|
|
5026
|
-
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50",
|
|
5034
|
+
className: G("rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", r.time),
|
|
5027
5035
|
onChange: (t) => z({
|
|
5028
5036
|
kind: "time",
|
|
5029
5037
|
day: e,
|
|
@@ -5033,13 +5041,13 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
5033
5041
|
})
|
|
5034
5042
|
})]
|
|
5035
5043
|
}),
|
|
5036
|
-
|
|
5044
|
+
n.length > 1 && /* @__PURE__ */ D("button", {
|
|
5037
5045
|
type: "button",
|
|
5038
5046
|
disabled: !h.enabled,
|
|
5039
5047
|
"aria-label": Z(A.notificationHoursRemoveLabel, {
|
|
5040
5048
|
start: i,
|
|
5041
5049
|
end: o,
|
|
5042
|
-
day:
|
|
5050
|
+
day: t
|
|
5043
5051
|
}),
|
|
5044
5052
|
"data-inbox-notification-hours-remove": "",
|
|
5045
5053
|
className: "text-iui-inbox-muted-foreground -ms-2 hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-2 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-iui-inbox-muted-foreground",
|
|
@@ -5050,10 +5058,10 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
5050
5058
|
}),
|
|
5051
5059
|
children: j("notificationHoursRemove")
|
|
5052
5060
|
}),
|
|
5053
|
-
s ===
|
|
5061
|
+
s === n.length - 1 && /* @__PURE__ */ D("button", {
|
|
5054
5062
|
type: "button",
|
|
5055
5063
|
disabled: !a,
|
|
5056
|
-
"aria-label": Z(A.notificationHoursAddLabel, { day:
|
|
5064
|
+
"aria-label": Z(A.notificationHoursAddLabel, { day: t }),
|
|
5057
5065
|
"data-inbox-notification-hours-add": "",
|
|
5058
5066
|
className: "text-iui-inbox-muted-foreground -ms-2 hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-2 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-iui-inbox-muted-foreground",
|
|
5059
5067
|
onClick: () => z({
|
|
@@ -5075,9 +5083,9 @@ function Za({ labels: e, classes: t = {}, locale: n, renderCategory: r, renderGr
|
|
|
5075
5083
|
});
|
|
5076
5084
|
}
|
|
5077
5085
|
// src/useNotifications.ts
|
|
5078
|
-
function
|
|
5079
|
-
let { props: e } =
|
|
5080
|
-
return
|
|
5086
|
+
function $a() {
|
|
5087
|
+
let { props: e } = T(), t = s(X.subscribe, X.getSnapshot, X.getServerSnapshot);
|
|
5088
|
+
return r(() => {
|
|
5081
5089
|
qi(), _t(e);
|
|
5082
5090
|
}, []), {
|
|
5083
5091
|
...t,
|
|
@@ -5086,22 +5094,23 @@ function Qa() {
|
|
|
5086
5094
|
};
|
|
5087
5095
|
}
|
|
5088
5096
|
// src/useToasts.ts
|
|
5089
|
-
var
|
|
5090
|
-
function
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5097
|
+
var eo = [], to = (e, t, n) => n ? Ir(e, t, n.nativeEvent) : Fr(e, t);
|
|
5098
|
+
function no(e) {
|
|
5099
|
+
Ji();
|
|
5100
|
+
let t = s(Q.subscribe, Q.getSnapshot, () => eo);
|
|
5101
|
+
s(Q.subscribe, or, () => 0);
|
|
5102
|
+
let n = i(() => t.filter((t) => t.toaster === e), [t, e]), [a] = o(cr);
|
|
5103
|
+
return r(() => Q.attach(e), [e]), r(() => a.release, []), {
|
|
5104
|
+
toasts: n,
|
|
5096
5105
|
toast: Hr,
|
|
5097
5106
|
update: Q.update,
|
|
5098
5107
|
dismiss: Q.dismiss,
|
|
5099
|
-
pause:
|
|
5100
|
-
resume:
|
|
5108
|
+
pause: a.pause,
|
|
5109
|
+
resume: a.resume,
|
|
5101
5110
|
timer: Q.timer,
|
|
5102
|
-
runAction:
|
|
5111
|
+
runAction: to
|
|
5103
5112
|
};
|
|
5104
5113
|
}
|
|
5105
5114
|
// src/iconResolver.ts
|
|
5106
|
-
var
|
|
5107
|
-
export { xr as DEFAULT_ERROR_MESSAGES, wt as DEFAULT_INBOX_LABELS, En as DEFAULT_PREFERENCES_LABELS,
|
|
5115
|
+
var ro = _e, io = ve;
|
|
5116
|
+
export { xr as DEFAULT_ERROR_MESSAGES, wt as DEFAULT_INBOX_LABELS, En as DEFAULT_PREFERENCES_LABELS, Ka as NotificationCenter, Ha as NotificationItem, qa as NotificationList, Qa as NotificationPreferences, ta as Toaster, ct as groupItems, X as inboxStore, qi as initNotifications, Re as isSnoozed, ft as pauseEnd, mt as pauseTime, kn as preferencesStore, xt as relativeTime, Vt as requestNotificationPermission, io as resolveIcon, ro as setIconResolver, Se as setTranslations, lt as snoozeOptions, Hr as toast, Te as trans, $a as useNotifications, Ya as usePreferences, Za as usePush, no as useToasts };
|