@moontra/moonui-pro 2.18.1 → 2.18.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/index.mjs
CHANGED
|
@@ -2184,8 +2184,8 @@ function MoonUIBadgePro({
|
|
|
2184
2184
|
{
|
|
2185
2185
|
type: "button",
|
|
2186
2186
|
className: "ml-1 -mr-1 h-3.5 w-3.5 rounded-full inline-flex items-center justify-center hover:bg-black/10 dark:hover:bg-white/10",
|
|
2187
|
-
onClick: (
|
|
2188
|
-
|
|
2187
|
+
onClick: (e) => {
|
|
2188
|
+
e.stopPropagation();
|
|
2189
2189
|
onRemove();
|
|
2190
2190
|
},
|
|
2191
2191
|
"aria-label": "Remove badge",
|
|
@@ -3775,7 +3775,7 @@ var MoonUIColorPickerPro = ({
|
|
|
3775
3775
|
{
|
|
3776
3776
|
type: "color",
|
|
3777
3777
|
value: currentColor,
|
|
3778
|
-
onChange: (
|
|
3778
|
+
onChange: (e) => handleColorChange(e.target.value),
|
|
3779
3779
|
className: cn("rounded border cursor-pointer", sizeClasses[size4] || sizeClasses.default)
|
|
3780
3780
|
}
|
|
3781
3781
|
),
|
|
@@ -3784,7 +3784,7 @@ var MoonUIColorPickerPro = ({
|
|
|
3784
3784
|
{
|
|
3785
3785
|
type: "text",
|
|
3786
3786
|
value: currentColor,
|
|
3787
|
-
onChange: (
|
|
3787
|
+
onChange: (e) => handleColorChange(e.target.value),
|
|
3788
3788
|
className: "px-2 py-1 border rounded text-sm font-mono",
|
|
3789
3789
|
placeholder: "#000000"
|
|
3790
3790
|
}
|
|
@@ -3795,7 +3795,7 @@ var MoonUIColorPickerPro = ({
|
|
|
3795
3795
|
{
|
|
3796
3796
|
type: "color",
|
|
3797
3797
|
value: currentColor,
|
|
3798
|
-
onChange: (
|
|
3798
|
+
onChange: (e) => handleColorChange(e.target.value),
|
|
3799
3799
|
className: cn("rounded border cursor-pointer", sizeClasses[size4] || sizeClasses.default)
|
|
3800
3800
|
}
|
|
3801
3801
|
),
|
|
@@ -3938,23 +3938,23 @@ var ee = () => t.useContext(de);
|
|
|
3938
3938
|
var fe = t.createContext(void 0);
|
|
3939
3939
|
var me = t.forwardRef((r2, o) => {
|
|
3940
3940
|
let n = L(() => {
|
|
3941
|
-
var
|
|
3942
|
-
return { search: "", value: (a = (
|
|
3941
|
+
var e, a;
|
|
3942
|
+
return { search: "", value: (a = (e = r2.value) != null ? e : r2.defaultValue) != null ? a : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
3943
3943
|
}), u2 = L(() => /* @__PURE__ */ new Set()), c2 = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r2), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r2, $2 = useId3(), q = useId3(), _ = useId3(), I = t.useRef(null), v = ke();
|
|
3944
3944
|
k2(() => {
|
|
3945
3945
|
if (R !== void 0) {
|
|
3946
|
-
let
|
|
3947
|
-
n.current.value =
|
|
3946
|
+
let e = R.trim();
|
|
3947
|
+
n.current.value = e, E.emit();
|
|
3948
3948
|
}
|
|
3949
3949
|
}, [R]), k2(() => {
|
|
3950
3950
|
v(6, ne);
|
|
3951
3951
|
}, []);
|
|
3952
|
-
let E = t.useMemo(() => ({ subscribe: (
|
|
3952
|
+
let E = t.useMemo(() => ({ subscribe: (e) => (f.current.add(e), () => f.current.delete(e)), snapshot: () => n.current, setState: (e, a, s) => {
|
|
3953
3953
|
var i, l, g, y;
|
|
3954
|
-
if (!Object.is(n.current[
|
|
3955
|
-
if (n.current[
|
|
3954
|
+
if (!Object.is(n.current[e], a)) {
|
|
3955
|
+
if (n.current[e] = a, e === "search")
|
|
3956
3956
|
J2(), z(), v(1, W2);
|
|
3957
|
-
else if (
|
|
3957
|
+
else if (e === "value") {
|
|
3958
3958
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
3959
3959
|
let h2 = document.getElementById(_);
|
|
3960
3960
|
h2 ? h2.focus() : (i = document.getElementById($2)) == null || i.focus();
|
|
@@ -3971,36 +3971,36 @@ var me = t.forwardRef((r2, o) => {
|
|
|
3971
3971
|
E.emit();
|
|
3972
3972
|
}
|
|
3973
3973
|
}, emit: () => {
|
|
3974
|
-
f.current.forEach((
|
|
3975
|
-
} }), []), U2 = t.useMemo(() => ({ value: (
|
|
3974
|
+
f.current.forEach((e) => e());
|
|
3975
|
+
} }), []), U2 = t.useMemo(() => ({ value: (e, a, s) => {
|
|
3976
3976
|
var i;
|
|
3977
|
-
a !== ((i = d.current.get(
|
|
3977
|
+
a !== ((i = d.current.get(e)) == null ? void 0 : i.value) && (d.current.set(e, { value: a, keywords: s }), n.current.filtered.items.set(e, te(a, s)), v(2, () => {
|
|
3978
3978
|
z(), E.emit();
|
|
3979
3979
|
}));
|
|
3980
|
-
}, item: (
|
|
3980
|
+
}, item: (e, a) => (u2.current.add(e), a && (c2.current.has(a) ? c2.current.get(a).add(e) : c2.current.set(a, /* @__PURE__ */ new Set([e]))), v(3, () => {
|
|
3981
3981
|
J2(), z(), n.current.value || W2(), E.emit();
|
|
3982
3982
|
}), () => {
|
|
3983
|
-
d.current.delete(
|
|
3983
|
+
d.current.delete(e), u2.current.delete(e), n.current.filtered.items.delete(e);
|
|
3984
3984
|
let s = M();
|
|
3985
3985
|
v(4, () => {
|
|
3986
|
-
J2(), (s == null ? void 0 : s.getAttribute("id")) ===
|
|
3986
|
+
J2(), (s == null ? void 0 : s.getAttribute("id")) === e && W2(), E.emit();
|
|
3987
3987
|
});
|
|
3988
|
-
}), group: (
|
|
3989
|
-
d.current.delete(
|
|
3988
|
+
}), group: (e) => (c2.current.has(e) || c2.current.set(e, /* @__PURE__ */ new Set()), () => {
|
|
3989
|
+
d.current.delete(e), c2.current.delete(e);
|
|
3990
3990
|
}), filter: () => p2.current.shouldFilter, label: b || r2["aria-label"], getDisablePointerSelection: () => p2.current.disablePointerSelection, listId: $2, inputId: _, labelId: q, listInnerRef: I }), []);
|
|
3991
|
-
function te(
|
|
3991
|
+
function te(e, a) {
|
|
3992
3992
|
var i, l;
|
|
3993
3993
|
let s = (l = (i = p2.current) == null ? void 0 : i.filter) != null ? l : Re;
|
|
3994
|
-
return
|
|
3994
|
+
return e ? s(e, n.current.search, a) : 0;
|
|
3995
3995
|
}
|
|
3996
3996
|
function z() {
|
|
3997
3997
|
if (!n.current.search || p2.current.shouldFilter === false)
|
|
3998
3998
|
return;
|
|
3999
|
-
let
|
|
3999
|
+
let e = n.current.filtered.items, a = [];
|
|
4000
4000
|
n.current.filtered.groups.forEach((i) => {
|
|
4001
4001
|
let l = c2.current.get(i), g = 0;
|
|
4002
4002
|
l.forEach((y) => {
|
|
4003
|
-
let h2 =
|
|
4003
|
+
let h2 = e.get(y);
|
|
4004
4004
|
g = Math.max(h2, g);
|
|
4005
4005
|
}), a.push([i, g]);
|
|
4006
4006
|
});
|
|
@@ -4008,7 +4008,7 @@ var me = t.forwardRef((r2, o) => {
|
|
|
4008
4008
|
V().sort((i, l) => {
|
|
4009
4009
|
var h2, F;
|
|
4010
4010
|
let g = i.getAttribute("id"), y = l.getAttribute("id");
|
|
4011
|
-
return ((h2 =
|
|
4011
|
+
return ((h2 = e.get(y)) != null ? h2 : 0) - ((F = e.get(g)) != null ? F : 0);
|
|
4012
4012
|
}).forEach((i) => {
|
|
4013
4013
|
let l = i.closest(Y2);
|
|
4014
4014
|
l ? l.appendChild(i.parentElement === l ? i : i.closest(`${Y2} > *`)) : s.appendChild(i.parentElement === s ? i : i.closest(`${Y2} > *`));
|
|
@@ -4019,7 +4019,7 @@ var me = t.forwardRef((r2, o) => {
|
|
|
4019
4019
|
});
|
|
4020
4020
|
}
|
|
4021
4021
|
function W2() {
|
|
4022
|
-
let
|
|
4022
|
+
let e = V().find((s) => s.getAttribute("aria-disabled") !== "true"), a = e == null ? void 0 : e.getAttribute(T);
|
|
4023
4023
|
E.setState("value", a || void 0);
|
|
4024
4024
|
}
|
|
4025
4025
|
function J2() {
|
|
@@ -4029,10 +4029,10 @@ var me = t.forwardRef((r2, o) => {
|
|
|
4029
4029
|
return;
|
|
4030
4030
|
}
|
|
4031
4031
|
n.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
4032
|
-
let
|
|
4032
|
+
let e = 0;
|
|
4033
4033
|
for (let g of u2.current) {
|
|
4034
4034
|
let y = (s = (a = d.current.get(g)) == null ? void 0 : a.value) != null ? s : "", h2 = (l = (i = d.current.get(g)) == null ? void 0 : i.keywords) != null ? l : [], F = te(y, h2);
|
|
4035
|
-
n.current.filtered.items.set(g, F), F > 0 &&
|
|
4035
|
+
n.current.filtered.items.set(g, F), F > 0 && e++;
|
|
4036
4036
|
}
|
|
4037
4037
|
for (let [g, y] of c2.current)
|
|
4038
4038
|
for (let h2 of y)
|
|
@@ -4040,75 +4040,75 @@ var me = t.forwardRef((r2, o) => {
|
|
|
4040
4040
|
n.current.filtered.groups.add(g);
|
|
4041
4041
|
break;
|
|
4042
4042
|
}
|
|
4043
|
-
n.current.filtered.count =
|
|
4043
|
+
n.current.filtered.count = e;
|
|
4044
4044
|
}
|
|
4045
4045
|
function ne() {
|
|
4046
4046
|
var a, s, i;
|
|
4047
|
-
let
|
|
4048
|
-
|
|
4047
|
+
let e = M();
|
|
4048
|
+
e && (((a = e.parentElement) == null ? void 0 : a.firstChild) === e && ((i = (s = e.closest(N)) == null ? void 0 : s.querySelector(be)) == null || i.scrollIntoView({ block: "nearest" })), e.scrollIntoView({ block: "nearest" }));
|
|
4049
4049
|
}
|
|
4050
4050
|
function M() {
|
|
4051
|
-
var
|
|
4052
|
-
return (
|
|
4051
|
+
var e;
|
|
4052
|
+
return (e = I.current) == null ? void 0 : e.querySelector(`${le}[aria-selected="true"]`);
|
|
4053
4053
|
}
|
|
4054
4054
|
function V() {
|
|
4055
|
-
var
|
|
4056
|
-
return Array.from(((
|
|
4055
|
+
var e;
|
|
4056
|
+
return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
|
|
4057
4057
|
}
|
|
4058
|
-
function X23(
|
|
4059
|
-
let s = V()[
|
|
4058
|
+
function X23(e) {
|
|
4059
|
+
let s = V()[e];
|
|
4060
4060
|
s && E.setState("value", s.getAttribute(T));
|
|
4061
4061
|
}
|
|
4062
|
-
function Q(
|
|
4062
|
+
function Q(e) {
|
|
4063
4063
|
var g;
|
|
4064
|
-
let a = M(), s = V(), i = s.findIndex((y) => y === a), l = s[i +
|
|
4065
|
-
(g = p2.current) != null && g.loop && (l = i +
|
|
4064
|
+
let a = M(), s = V(), i = s.findIndex((y) => y === a), l = s[i + e];
|
|
4065
|
+
(g = p2.current) != null && g.loop && (l = i + e < 0 ? s[s.length - 1] : i + e === s.length ? s[0] : s[i + e]), l && E.setState("value", l.getAttribute(T));
|
|
4066
4066
|
}
|
|
4067
|
-
function re(
|
|
4067
|
+
function re(e) {
|
|
4068
4068
|
let a = M(), s = a == null ? void 0 : a.closest(N), i;
|
|
4069
4069
|
for (; s && !i; )
|
|
4070
|
-
s =
|
|
4071
|
-
i ? E.setState("value", i.getAttribute(T)) : Q(
|
|
4070
|
+
s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
|
|
4071
|
+
i ? E.setState("value", i.getAttribute(T)) : Q(e);
|
|
4072
4072
|
}
|
|
4073
|
-
let oe = () => X23(V().length - 1), ie3 = (
|
|
4074
|
-
|
|
4075
|
-
}, se = (
|
|
4076
|
-
|
|
4073
|
+
let oe = () => X23(V().length - 1), ie3 = (e) => {
|
|
4074
|
+
e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
|
|
4075
|
+
}, se = (e) => {
|
|
4076
|
+
e.preventDefault(), e.metaKey ? X23(0) : e.altKey ? re(-1) : Q(-1);
|
|
4077
4077
|
};
|
|
4078
|
-
return t.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (
|
|
4078
|
+
return t.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
|
|
4079
4079
|
var s;
|
|
4080
|
-
(s = O.onKeyDown) == null || s.call(O,
|
|
4081
|
-
let a =
|
|
4082
|
-
if (!(
|
|
4083
|
-
switch (
|
|
4080
|
+
(s = O.onKeyDown) == null || s.call(O, e);
|
|
4081
|
+
let a = e.nativeEvent.isComposing || e.keyCode === 229;
|
|
4082
|
+
if (!(e.defaultPrevented || a))
|
|
4083
|
+
switch (e.key) {
|
|
4084
4084
|
case "n":
|
|
4085
4085
|
case "j": {
|
|
4086
|
-
j &&
|
|
4086
|
+
j && e.ctrlKey && ie3(e);
|
|
4087
4087
|
break;
|
|
4088
4088
|
}
|
|
4089
4089
|
case "ArrowDown": {
|
|
4090
|
-
ie3(
|
|
4090
|
+
ie3(e);
|
|
4091
4091
|
break;
|
|
4092
4092
|
}
|
|
4093
4093
|
case "p":
|
|
4094
4094
|
case "k": {
|
|
4095
|
-
j &&
|
|
4095
|
+
j && e.ctrlKey && se(e);
|
|
4096
4096
|
break;
|
|
4097
4097
|
}
|
|
4098
4098
|
case "ArrowUp": {
|
|
4099
|
-
se(
|
|
4099
|
+
se(e);
|
|
4100
4100
|
break;
|
|
4101
4101
|
}
|
|
4102
4102
|
case "Home": {
|
|
4103
|
-
|
|
4103
|
+
e.preventDefault(), X23(0);
|
|
4104
4104
|
break;
|
|
4105
4105
|
}
|
|
4106
4106
|
case "End": {
|
|
4107
|
-
|
|
4107
|
+
e.preventDefault(), oe();
|
|
4108
4108
|
break;
|
|
4109
4109
|
}
|
|
4110
4110
|
case "Enter": {
|
|
4111
|
-
|
|
4111
|
+
e.preventDefault();
|
|
4112
4112
|
let i = M();
|
|
4113
4113
|
if (i) {
|
|
4114
4114
|
let l = new Event(Z);
|
|
@@ -4116,7 +4116,7 @@ var me = t.forwardRef((r2, o) => {
|
|
|
4116
4116
|
}
|
|
4117
4117
|
}
|
|
4118
4118
|
}
|
|
4119
|
-
} }, t.createElement("label", { "cmdk-label": "", htmlFor: U2.inputId, id: U2.labelId, style: Te }, b), B2(r2, (
|
|
4119
|
+
} }, t.createElement("label", { "cmdk-label": "", htmlFor: U2.inputId, id: U2.labelId, style: Te }, b), B2(r2, (e) => t.createElement(de.Provider, { value: E }, t.createElement(ue.Provider, { value: U2 }, e))));
|
|
4120
4120
|
});
|
|
4121
4121
|
var he = t.forwardRef((r2, o) => {
|
|
4122
4122
|
var _, I;
|
|
@@ -5054,9 +5054,9 @@ var MoonUIPopoverContentPro = t.forwardRef(({
|
|
|
5054
5054
|
ref,
|
|
5055
5055
|
sideOffset,
|
|
5056
5056
|
collisionPadding: 8,
|
|
5057
|
-
onInteractOutside: (
|
|
5057
|
+
onInteractOutside: (e) => {
|
|
5058
5058
|
if (!closeOnInteractOutside) {
|
|
5059
|
-
|
|
5059
|
+
e.preventDefault();
|
|
5060
5060
|
}
|
|
5061
5061
|
},
|
|
5062
5062
|
className: cn(
|
|
@@ -5283,12 +5283,12 @@ var MoonUIRadioGroupItemPro = t.forwardRef(({ className, variant, size: size4, i
|
|
|
5283
5283
|
const generatedId = t.useId();
|
|
5284
5284
|
const radioId = id || generatedId;
|
|
5285
5285
|
const isChecked = radioGroup.value === value;
|
|
5286
|
-
const handleChange = (
|
|
5286
|
+
const handleChange = (e) => {
|
|
5287
5287
|
if (radioGroup.onValueChange) {
|
|
5288
|
-
radioGroup.onValueChange(
|
|
5288
|
+
radioGroup.onValueChange(e.target.value);
|
|
5289
5289
|
}
|
|
5290
5290
|
if (props.onChange) {
|
|
5291
|
-
props.onChange(
|
|
5291
|
+
props.onChange(e);
|
|
5292
5292
|
}
|
|
5293
5293
|
};
|
|
5294
5294
|
return /* @__PURE__ */ jsxs("div", { className: "relative flex items-center", children: [
|
|
@@ -9537,14 +9537,14 @@ var AnimatedButtonInternal = t__default.forwardRef(
|
|
|
9537
9537
|
({ className, variant, size: size4, state = "idle", onStateChange, children, onClick, ...props }, ref) => {
|
|
9538
9538
|
const [internalState, setInternalState] = useState("idle");
|
|
9539
9539
|
const currentState = state !== "idle" ? state : internalState;
|
|
9540
|
-
const handleClick2 = async (
|
|
9540
|
+
const handleClick2 = async (e) => {
|
|
9541
9541
|
if (currentState === "loading")
|
|
9542
9542
|
return;
|
|
9543
9543
|
setInternalState("loading");
|
|
9544
9544
|
onStateChange?.("loading");
|
|
9545
9545
|
if (onClick) {
|
|
9546
9546
|
try {
|
|
9547
|
-
await onClick(
|
|
9547
|
+
await onClick(e);
|
|
9548
9548
|
setInternalState("success");
|
|
9549
9549
|
onStateChange?.("success");
|
|
9550
9550
|
setTimeout(() => {
|
|
@@ -9754,11 +9754,11 @@ var FloatingActionButtonInternal = t__default.forwardRef(
|
|
|
9754
9754
|
"top-right": { x: -60, y: 0 },
|
|
9755
9755
|
"top-left": { x: 60, y: 0 }
|
|
9756
9756
|
};
|
|
9757
|
-
const handleMainClick = (
|
|
9757
|
+
const handleMainClick = (e) => {
|
|
9758
9758
|
if (actions.length > 0) {
|
|
9759
9759
|
setIsOpen(!isOpen);
|
|
9760
9760
|
} else if (onClick) {
|
|
9761
|
-
onClick(
|
|
9761
|
+
onClick(e);
|
|
9762
9762
|
}
|
|
9763
9763
|
};
|
|
9764
9764
|
return /* @__PURE__ */ jsxs("div", { className: cn("fixed z-50", positionClasses[position]), children: [
|
|
@@ -9894,14 +9894,14 @@ var HoverCard3DInternal = t__default.forwardRef(
|
|
|
9894
9894
|
const springY = useSpring(y, springConfig);
|
|
9895
9895
|
const rotateX = useTransform(springY, [-0.5, 0.5], [rotationIntensity, -rotationIntensity]);
|
|
9896
9896
|
const rotateY = useTransform(springX, [-0.5, 0.5], [-rotationIntensity, rotationIntensity]);
|
|
9897
|
-
const handleMouseMove2 = (
|
|
9897
|
+
const handleMouseMove2 = (e) => {
|
|
9898
9898
|
if (!cardRef.current)
|
|
9899
9899
|
return;
|
|
9900
9900
|
const rect = cardRef.current.getBoundingClientRect();
|
|
9901
9901
|
const centerX = rect.left + rect.width / 2;
|
|
9902
9902
|
const centerY = rect.top + rect.height / 2;
|
|
9903
|
-
const rotateXValue = (
|
|
9904
|
-
const rotateYValue = (
|
|
9903
|
+
const rotateXValue = (e.clientY - centerY) / (rect.height / 2);
|
|
9904
|
+
const rotateYValue = (e.clientX - centerX) / (rect.width / 2);
|
|
9905
9905
|
x.set(rotateYValue);
|
|
9906
9906
|
y.set(rotateXValue);
|
|
9907
9907
|
};
|
|
@@ -10018,14 +10018,14 @@ var MagneticButtonInternal = t__default.forwardRef(
|
|
|
10018
10018
|
const springY = useSpring(y, springConfig);
|
|
10019
10019
|
const rotateX = useTransform(springY, [-range, range], [5, -5]);
|
|
10020
10020
|
const rotateY = useTransform(springX, [-range, range], [-5, 5]);
|
|
10021
|
-
const handleMouseMove2 = (
|
|
10021
|
+
const handleMouseMove2 = (e) => {
|
|
10022
10022
|
if (!buttonRef.current)
|
|
10023
10023
|
return;
|
|
10024
10024
|
const rect = buttonRef.current.getBoundingClientRect();
|
|
10025
10025
|
const centerX = rect.left + rect.width / 2;
|
|
10026
10026
|
const centerY = rect.top + rect.height / 2;
|
|
10027
|
-
const deltaX =
|
|
10028
|
-
const deltaY =
|
|
10027
|
+
const deltaX = e.clientX - centerX;
|
|
10028
|
+
const deltaY = e.clientY - centerY;
|
|
10029
10029
|
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
10030
10030
|
if (distance < range) {
|
|
10031
10031
|
x.set(deltaX * strength);
|
|
@@ -10257,12 +10257,12 @@ var SpotlightCardInternal = t__default.forwardRef(
|
|
|
10257
10257
|
const cardRef = useRef(null);
|
|
10258
10258
|
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 });
|
|
10259
10259
|
const [isHovered, setIsHovered] = useState(false);
|
|
10260
|
-
const handleMouseMove2 = (
|
|
10260
|
+
const handleMouseMove2 = (e) => {
|
|
10261
10261
|
if (!cardRef.current)
|
|
10262
10262
|
return;
|
|
10263
10263
|
const rect = cardRef.current.getBoundingClientRect();
|
|
10264
|
-
const x =
|
|
10265
|
-
const y =
|
|
10264
|
+
const x = e.clientX - rect.left;
|
|
10265
|
+
const y = e.clientY - rect.top;
|
|
10266
10266
|
setMousePosition({ x, y });
|
|
10267
10267
|
};
|
|
10268
10268
|
const handleMouseEnter = () => {
|
|
@@ -10483,8 +10483,8 @@ function EventDialog({
|
|
|
10483
10483
|
setErrors(newErrors);
|
|
10484
10484
|
return Object.keys(newErrors).length === 0;
|
|
10485
10485
|
};
|
|
10486
|
-
const handleSubmit = async (
|
|
10487
|
-
|
|
10486
|
+
const handleSubmit = async (e) => {
|
|
10487
|
+
e.preventDefault();
|
|
10488
10488
|
if (!validateForm()) {
|
|
10489
10489
|
return;
|
|
10490
10490
|
}
|
|
@@ -10540,7 +10540,7 @@ function EventDialog({
|
|
|
10540
10540
|
{
|
|
10541
10541
|
id: "title",
|
|
10542
10542
|
value: formData.title,
|
|
10543
|
-
onChange: (
|
|
10543
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, title: e.target.value })),
|
|
10544
10544
|
placeholder: "Event title",
|
|
10545
10545
|
className: cn(errors.title && "border-red-500")
|
|
10546
10546
|
}
|
|
@@ -10554,7 +10554,7 @@ function EventDialog({
|
|
|
10554
10554
|
{
|
|
10555
10555
|
id: "description",
|
|
10556
10556
|
value: formData.description,
|
|
10557
|
-
onChange: (
|
|
10557
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, description: e.target.value })),
|
|
10558
10558
|
placeholder: "Event description (optional)",
|
|
10559
10559
|
rows: 3
|
|
10560
10560
|
}
|
|
@@ -10569,7 +10569,7 @@ function EventDialog({
|
|
|
10569
10569
|
id: "date",
|
|
10570
10570
|
type: "date",
|
|
10571
10571
|
value: formData.date,
|
|
10572
|
-
onChange: (
|
|
10572
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, date: e.target.value })),
|
|
10573
10573
|
className: cn(errors.date && "border-red-500")
|
|
10574
10574
|
}
|
|
10575
10575
|
),
|
|
@@ -10583,7 +10583,7 @@ function EventDialog({
|
|
|
10583
10583
|
id: "startTime",
|
|
10584
10584
|
type: "time",
|
|
10585
10585
|
value: formData.startTime,
|
|
10586
|
-
onChange: (
|
|
10586
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, startTime: e.target.value })),
|
|
10587
10587
|
placeholder: "09:00"
|
|
10588
10588
|
}
|
|
10589
10589
|
)
|
|
@@ -10596,7 +10596,7 @@ function EventDialog({
|
|
|
10596
10596
|
id: "endTime",
|
|
10597
10597
|
type: "time",
|
|
10598
10598
|
value: formData.endTime,
|
|
10599
|
-
onChange: (
|
|
10599
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, endTime: e.target.value })),
|
|
10600
10600
|
placeholder: "10:00",
|
|
10601
10601
|
className: cn(errors.endTime && "border-red-500")
|
|
10602
10602
|
}
|
|
@@ -10614,7 +10614,7 @@ function EventDialog({
|
|
|
10614
10614
|
{
|
|
10615
10615
|
id: "location",
|
|
10616
10616
|
value: formData.location,
|
|
10617
|
-
onChange: (
|
|
10617
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, location: e.target.value })),
|
|
10618
10618
|
placeholder: "Meeting room, address, or link"
|
|
10619
10619
|
}
|
|
10620
10620
|
)
|
|
@@ -10650,7 +10650,7 @@ function EventDialog({
|
|
|
10650
10650
|
{
|
|
10651
10651
|
type: "color",
|
|
10652
10652
|
value: formData.color,
|
|
10653
|
-
onChange: (
|
|
10653
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, color: e.target.value })),
|
|
10654
10654
|
className: "w-8 h-8 rounded border cursor-pointer"
|
|
10655
10655
|
}
|
|
10656
10656
|
),
|
|
@@ -10677,7 +10677,7 @@ function EventDialog({
|
|
|
10677
10677
|
{
|
|
10678
10678
|
id: "attendees",
|
|
10679
10679
|
value: formData.attendees,
|
|
10680
|
-
onChange: (
|
|
10680
|
+
onChange: (e) => setFormData((prev) => ({ ...prev, attendees: e.target.value })),
|
|
10681
10681
|
placeholder: "John Doe, Jane Smith (comma-separated)"
|
|
10682
10682
|
}
|
|
10683
10683
|
)
|
|
@@ -10932,32 +10932,32 @@ function Calendar3({
|
|
|
10932
10932
|
onEventClick?.(dateEvents[0]);
|
|
10933
10933
|
}
|
|
10934
10934
|
};
|
|
10935
|
-
const handleEventClick = (event,
|
|
10936
|
-
|
|
10935
|
+
const handleEventClick = (event, e) => {
|
|
10936
|
+
e.stopPropagation();
|
|
10937
10937
|
onEventClick?.(event);
|
|
10938
10938
|
};
|
|
10939
|
-
const handleEventDragStart = (event,
|
|
10939
|
+
const handleEventDragStart = (event, e) => {
|
|
10940
10940
|
setDraggedEvent(event);
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
const target =
|
|
10941
|
+
e.dataTransfer.effectAllowed = "move";
|
|
10942
|
+
e.dataTransfer.setData("text/plain", event.id);
|
|
10943
|
+
const target = e.target;
|
|
10944
10944
|
target.style.opacity = "0.5";
|
|
10945
10945
|
};
|
|
10946
|
-
const handleEventDragEnd = (
|
|
10946
|
+
const handleEventDragEnd = (e) => {
|
|
10947
10947
|
setDraggedEvent(null);
|
|
10948
10948
|
setDragTargetDate(null);
|
|
10949
|
-
const target =
|
|
10949
|
+
const target = e.target;
|
|
10950
10950
|
target.style.opacity = "1";
|
|
10951
10951
|
};
|
|
10952
|
-
const handleDateDragOver = (date,
|
|
10952
|
+
const handleDateDragOver = (date, e) => {
|
|
10953
10953
|
if (isDisabled(date) || !draggedEvent)
|
|
10954
10954
|
return;
|
|
10955
|
-
|
|
10956
|
-
|
|
10955
|
+
e.preventDefault();
|
|
10956
|
+
e.dataTransfer.dropEffect = "move";
|
|
10957
10957
|
setDragTargetDate(date);
|
|
10958
10958
|
};
|
|
10959
|
-
const handleDateDrop = (date,
|
|
10960
|
-
|
|
10959
|
+
const handleDateDrop = (date, e) => {
|
|
10960
|
+
e.preventDefault();
|
|
10961
10961
|
if (!draggedEvent || isDisabled(date))
|
|
10962
10962
|
return;
|
|
10963
10963
|
if (draggedEvent.date.toDateString() !== date.toDateString()) {
|
|
@@ -10970,14 +10970,14 @@ function Calendar3({
|
|
|
10970
10970
|
setDraggedEvent(null);
|
|
10971
10971
|
setDragTargetDate(null);
|
|
10972
10972
|
};
|
|
10973
|
-
const handleEventEdit = (event,
|
|
10974
|
-
|
|
10973
|
+
const handleEventEdit = (event, e) => {
|
|
10974
|
+
e.stopPropagation();
|
|
10975
10975
|
setEventDialogMode("edit");
|
|
10976
10976
|
setSelectedEvent(event);
|
|
10977
10977
|
setEventDialogOpen(true);
|
|
10978
10978
|
};
|
|
10979
|
-
const handleEventDelete = (event,
|
|
10980
|
-
|
|
10979
|
+
const handleEventDelete = (event, e) => {
|
|
10980
|
+
e.stopPropagation();
|
|
10981
10981
|
onEventDelete?.(event.id);
|
|
10982
10982
|
};
|
|
10983
10983
|
const handleEventSave = (eventData) => {
|
|
@@ -11088,8 +11088,8 @@ function Calendar3({
|
|
|
11088
11088
|
dragTargetDate && dragTargetDate.toDateString() === date.toDateString() && "bg-primary/30 border-primary"
|
|
11089
11089
|
),
|
|
11090
11090
|
onClick: () => handleDateClick(date),
|
|
11091
|
-
onDragOver: (
|
|
11092
|
-
onDrop: (
|
|
11091
|
+
onDragOver: (e) => handleDateDragOver(date, e),
|
|
11092
|
+
onDrop: (e) => handleDateDrop(date, e),
|
|
11093
11093
|
children: [
|
|
11094
11094
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-1", children: [
|
|
11095
11095
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
@@ -11113,8 +11113,8 @@ function Calendar3({
|
|
|
11113
11113
|
event.status && STATUS_STYLES[event.status]
|
|
11114
11114
|
),
|
|
11115
11115
|
draggable: !disabled && enableDragDrop,
|
|
11116
|
-
onClick: (
|
|
11117
|
-
onDragStart: (
|
|
11116
|
+
onClick: (e) => handleEventClick(event, e),
|
|
11117
|
+
onDragStart: (e) => handleEventDragStart(event, e),
|
|
11118
11118
|
onDragEnd: handleEventDragEnd,
|
|
11119
11119
|
style: {
|
|
11120
11120
|
backgroundColor: event.color || void 0
|
|
@@ -11133,7 +11133,7 @@ function Calendar3({
|
|
|
11133
11133
|
variant: "ghost",
|
|
11134
11134
|
size: "sm",
|
|
11135
11135
|
className: "h-4 w-4 p-0 text-white/80 hover:text-white",
|
|
11136
|
-
onClick: (
|
|
11136
|
+
onClick: (e) => handleEventEdit(event, e),
|
|
11137
11137
|
children: /* @__PURE__ */ jsx(Edit, { className: "h-3 w-3" })
|
|
11138
11138
|
}
|
|
11139
11139
|
),
|
|
@@ -11143,7 +11143,7 @@ function Calendar3({
|
|
|
11143
11143
|
variant: "ghost",
|
|
11144
11144
|
size: "sm",
|
|
11145
11145
|
className: "h-4 w-4 p-0 text-white/80 hover:text-white",
|
|
11146
|
-
onClick: (
|
|
11146
|
+
onClick: (e) => handleEventDelete(event, e),
|
|
11147
11147
|
children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
|
|
11148
11148
|
}
|
|
11149
11149
|
)
|
|
@@ -11210,7 +11210,7 @@ function Calendar3({
|
|
|
11210
11210
|
"text-xs p-1 rounded text-white mb-1 cursor-pointer",
|
|
11211
11211
|
event.color || EVENT_COLORS[event.type || "event"]
|
|
11212
11212
|
),
|
|
11213
|
-
onClick: (
|
|
11213
|
+
onClick: (e) => handleEventClick(event, e),
|
|
11214
11214
|
children: [
|
|
11215
11215
|
/* @__PURE__ */ jsx("div", { className: "font-medium truncate", children: event.title }),
|
|
11216
11216
|
event.location && /* @__PURE__ */ jsx("div", { className: "text-[10px] opacity-80 truncate", children: event.location })
|
|
@@ -11247,7 +11247,7 @@ function Calendar3({
|
|
|
11247
11247
|
"p-2 rounded text-white mb-2 cursor-pointer",
|
|
11248
11248
|
event.color || EVENT_COLORS[event.type || "event"]
|
|
11249
11249
|
),
|
|
11250
|
-
onClick: (
|
|
11250
|
+
onClick: (e) => handleEventClick(event, e),
|
|
11251
11251
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
11252
11252
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
11253
11253
|
/* @__PURE__ */ jsx("div", { className: "font-medium", children: event.title }),
|
|
@@ -11272,7 +11272,7 @@ function Calendar3({
|
|
|
11272
11272
|
variant: "ghost",
|
|
11273
11273
|
size: "sm",
|
|
11274
11274
|
className: "h-6 w-6 p-0 text-white/80 hover:text-white",
|
|
11275
|
-
onClick: (
|
|
11275
|
+
onClick: (e) => handleEventEdit(event, e),
|
|
11276
11276
|
children: /* @__PURE__ */ jsx(Edit, { className: "h-3 w-3" })
|
|
11277
11277
|
}
|
|
11278
11278
|
),
|
|
@@ -11282,7 +11282,7 @@ function Calendar3({
|
|
|
11282
11282
|
variant: "ghost",
|
|
11283
11283
|
size: "sm",
|
|
11284
11284
|
className: "h-6 w-6 p-0 text-white/80 hover:text-white",
|
|
11285
|
-
onClick: (
|
|
11285
|
+
onClick: (e) => handleEventDelete(event, e),
|
|
11286
11286
|
children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
|
|
11287
11287
|
}
|
|
11288
11288
|
)
|
|
@@ -11327,7 +11327,7 @@ function Calendar3({
|
|
|
11327
11327
|
variant: "ghost",
|
|
11328
11328
|
size: "sm",
|
|
11329
11329
|
className: "h-7 w-7 p-0",
|
|
11330
|
-
onClick: (
|
|
11330
|
+
onClick: (e) => handleEventEdit(event, e),
|
|
11331
11331
|
children: /* @__PURE__ */ jsx(Edit, { className: "h-3 w-3" })
|
|
11332
11332
|
}
|
|
11333
11333
|
),
|
|
@@ -11337,7 +11337,7 @@ function Calendar3({
|
|
|
11337
11337
|
variant: "ghost",
|
|
11338
11338
|
size: "sm",
|
|
11339
11339
|
className: "h-7 w-7 p-0",
|
|
11340
|
-
onClick: (
|
|
11340
|
+
onClick: (e) => handleEventDelete(event, e),
|
|
11341
11341
|
children: /* @__PURE__ */ jsx(Trash2, { className: "h-3 w-3" })
|
|
11342
11342
|
}
|
|
11343
11343
|
)
|
|
@@ -11390,7 +11390,7 @@ function Calendar3({
|
|
|
11390
11390
|
{
|
|
11391
11391
|
variant: "ghost",
|
|
11392
11392
|
size: "sm",
|
|
11393
|
-
onClick: (
|
|
11393
|
+
onClick: (e) => handleEventEdit(event, e),
|
|
11394
11394
|
children: /* @__PURE__ */ jsx(Edit, { className: "h-4 w-4" })
|
|
11395
11395
|
}
|
|
11396
11396
|
),
|
|
@@ -11399,7 +11399,7 @@ function Calendar3({
|
|
|
11399
11399
|
{
|
|
11400
11400
|
variant: "ghost",
|
|
11401
11401
|
size: "sm",
|
|
11402
|
-
onClick: (
|
|
11402
|
+
onClick: (e) => handleEventDelete(event, e),
|
|
11403
11403
|
children: /* @__PURE__ */ jsx(Trash2, { className: "h-4 w-4" })
|
|
11404
11404
|
}
|
|
11405
11405
|
)
|
|
@@ -11629,13 +11629,13 @@ var CalendarPro = t.forwardRef(({
|
|
|
11629
11629
|
setIsEventDialogOpen(true);
|
|
11630
11630
|
}
|
|
11631
11631
|
}, [allowEventCreation, currentViewConfig, onDateSelect]);
|
|
11632
|
-
const handleEventClick = useCallback((event,
|
|
11633
|
-
|
|
11632
|
+
const handleEventClick = useCallback((event, e) => {
|
|
11633
|
+
e.stopPropagation();
|
|
11634
11634
|
setSelectedEvent(event);
|
|
11635
11635
|
setEditingEvent(event);
|
|
11636
11636
|
setIsEventDialogOpen(true);
|
|
11637
11637
|
setIsCreating(false);
|
|
11638
|
-
onEventClick?.(event,
|
|
11638
|
+
onEventClick?.(event, e);
|
|
11639
11639
|
}, [onEventClick]);
|
|
11640
11640
|
const handleEventSave = useCallback(() => {
|
|
11641
11641
|
if (isCreating && onEventCreate) {
|
|
@@ -11658,15 +11658,15 @@ var CalendarPro = t.forwardRef(({
|
|
|
11658
11658
|
setEditingEvent({});
|
|
11659
11659
|
}
|
|
11660
11660
|
}, [selectedEvent, onEventDelete]);
|
|
11661
|
-
const handleDragStart = useCallback((
|
|
11661
|
+
const handleDragStart = useCallback((e, event) => {
|
|
11662
11662
|
if (!allowEventDragging)
|
|
11663
11663
|
return;
|
|
11664
11664
|
setDraggedEventId(event.id);
|
|
11665
11665
|
setIsDragging(true);
|
|
11666
|
-
|
|
11667
|
-
|
|
11668
|
-
const dragImage =
|
|
11669
|
-
const originalRect =
|
|
11666
|
+
e.dataTransfer.effectAllowed = "move";
|
|
11667
|
+
e.dataTransfer.setData("text/plain", event.id);
|
|
11668
|
+
const dragImage = e.currentTarget.cloneNode(true);
|
|
11669
|
+
const originalRect = e.currentTarget.getBoundingClientRect();
|
|
11670
11670
|
dragImage.style.opacity = "0.8";
|
|
11671
11671
|
dragImage.style.position = "absolute";
|
|
11672
11672
|
dragImage.style.top = "-1000px";
|
|
@@ -11674,25 +11674,25 @@ var CalendarPro = t.forwardRef(({
|
|
|
11674
11674
|
dragImage.style.height = `${originalRect.height}px`;
|
|
11675
11675
|
dragImage.style.boxSizing = "border-box";
|
|
11676
11676
|
document.body.appendChild(dragImage);
|
|
11677
|
-
|
|
11677
|
+
e.dataTransfer.setDragImage(dragImage, e.nativeEvent.offsetX, e.nativeEvent.offsetY);
|
|
11678
11678
|
setTimeout(() => document.body.removeChild(dragImage), 0);
|
|
11679
11679
|
}, [allowEventDragging]);
|
|
11680
|
-
const handleDragOver = useCallback((
|
|
11681
|
-
|
|
11682
|
-
|
|
11680
|
+
const handleDragOver = useCallback((e, date, hour) => {
|
|
11681
|
+
e.preventDefault();
|
|
11682
|
+
e.dataTransfer.dropEffect = "move";
|
|
11683
11683
|
setDragOverInfo({ date, hour });
|
|
11684
11684
|
}, []);
|
|
11685
|
-
const handleDragLeave = useCallback((
|
|
11686
|
-
const rect =
|
|
11687
|
-
const x =
|
|
11688
|
-
const y =
|
|
11685
|
+
const handleDragLeave = useCallback((e) => {
|
|
11686
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
11687
|
+
const x = e.clientX;
|
|
11688
|
+
const y = e.clientY;
|
|
11689
11689
|
if (x < rect.left || x >= rect.right || y < rect.top || y >= rect.bottom) {
|
|
11690
11690
|
setDragOverInfo(null);
|
|
11691
11691
|
}
|
|
11692
11692
|
}, []);
|
|
11693
|
-
const handleDrop = useCallback((
|
|
11694
|
-
|
|
11695
|
-
const eventId =
|
|
11693
|
+
const handleDrop = useCallback((e, date, hour) => {
|
|
11694
|
+
e.preventDefault();
|
|
11695
|
+
const eventId = e.dataTransfer.getData("text/plain");
|
|
11696
11696
|
const draggedEvent2 = events.find((ev) => ev.id === eventId);
|
|
11697
11697
|
if (!draggedEvent2 || !onEventDrop)
|
|
11698
11698
|
return;
|
|
@@ -11790,16 +11790,16 @@ END:VCALENDAR`;
|
|
|
11790
11790
|
"border-b p-2",
|
|
11791
11791
|
dragOverInfo?.date && !dragOverInfo?.hour && isSameDay(dragOverInfo.date, currentDate) && "bg-primary/10"
|
|
11792
11792
|
),
|
|
11793
|
-
onDragOver: (
|
|
11793
|
+
onDragOver: (e) => handleDragOver(e, currentDate),
|
|
11794
11794
|
onDragLeave: handleDragLeave,
|
|
11795
|
-
onDrop: (
|
|
11795
|
+
onDrop: (e) => handleDrop(e, currentDate),
|
|
11796
11796
|
children: [
|
|
11797
11797
|
/* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground mb-1", children: "All Day" }),
|
|
11798
11798
|
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: dayEvents.filter((event) => event.allDay).map((event) => /* @__PURE__ */ jsx(
|
|
11799
11799
|
"div",
|
|
11800
11800
|
{
|
|
11801
11801
|
draggable: allowEventDragging,
|
|
11802
|
-
onDragStart: (
|
|
11802
|
+
onDragStart: (e) => handleDragStart(e, event),
|
|
11803
11803
|
onDragEnd: handleDragEnd,
|
|
11804
11804
|
className: "p-2 rounded text-xs cursor-pointer hover:opacity-80",
|
|
11805
11805
|
style: {
|
|
@@ -11807,7 +11807,7 @@ END:VCALENDAR`;
|
|
|
11807
11807
|
color: "#ffffff",
|
|
11808
11808
|
opacity: draggedEventId === event.id ? 0.5 : 1
|
|
11809
11809
|
},
|
|
11810
|
-
onClick: (
|
|
11810
|
+
onClick: (e) => handleEventClick(event, e),
|
|
11811
11811
|
children: event.title
|
|
11812
11812
|
},
|
|
11813
11813
|
event.id
|
|
@@ -11824,9 +11824,9 @@ END:VCALENDAR`;
|
|
|
11824
11824
|
"flex-1 relative border-l cursor-pointer hover:bg-muted/20",
|
|
11825
11825
|
dragOverInfo?.date && dragOverInfo?.hour === hour && isSameDay(dragOverInfo.date, currentDate) && "bg-primary/10"
|
|
11826
11826
|
),
|
|
11827
|
-
onDragOver: (
|
|
11827
|
+
onDragOver: (e) => handleDragOver(e, currentDate, hour),
|
|
11828
11828
|
onDragLeave: handleDragLeave,
|
|
11829
|
-
onDrop: (
|
|
11829
|
+
onDrop: (e) => handleDrop(e, currentDate, hour),
|
|
11830
11830
|
onClick: () => {
|
|
11831
11831
|
if (allowEventCreation) {
|
|
11832
11832
|
const clickedTime = setHours(setMinutes(currentDate, 0), hour);
|
|
@@ -11856,7 +11856,7 @@ END:VCALENDAR`;
|
|
|
11856
11856
|
"div",
|
|
11857
11857
|
{
|
|
11858
11858
|
draggable: allowEventDragging,
|
|
11859
|
-
onDragStart: (
|
|
11859
|
+
onDragStart: (e) => handleDragStart(e, event),
|
|
11860
11860
|
onDragEnd: handleDragEnd,
|
|
11861
11861
|
className: "absolute left-0 right-0 mx-1 p-1 rounded text-xs cursor-pointer hover:opacity-80 overflow-hidden",
|
|
11862
11862
|
style: {
|
|
@@ -11868,9 +11868,9 @@ END:VCALENDAR`;
|
|
|
11868
11868
|
opacity: draggedEventId === event.id ? 0.5 : 1,
|
|
11869
11869
|
cursor: allowEventDragging ? "move" : "pointer"
|
|
11870
11870
|
},
|
|
11871
|
-
onClick: (
|
|
11872
|
-
|
|
11873
|
-
handleEventClick(event,
|
|
11871
|
+
onClick: (e) => {
|
|
11872
|
+
e.stopPropagation();
|
|
11873
|
+
handleEventClick(event, e);
|
|
11874
11874
|
},
|
|
11875
11875
|
children: [
|
|
11876
11876
|
/* @__PURE__ */ jsx("div", { className: "font-medium", children: event.title }),
|
|
@@ -11928,9 +11928,9 @@ END:VCALENDAR`;
|
|
|
11928
11928
|
isToday(day) && "bg-primary/5",
|
|
11929
11929
|
dragOverInfo?.date && dragOverInfo?.hour === hour && isSameDay(dragOverInfo.date, day) && "bg-primary/10"
|
|
11930
11930
|
),
|
|
11931
|
-
onDragOver: (
|
|
11931
|
+
onDragOver: (e) => handleDragOver(e, day, hour),
|
|
11932
11932
|
onDragLeave: handleDragLeave,
|
|
11933
|
-
onDrop: (
|
|
11933
|
+
onDrop: (e) => handleDrop(e, day, hour),
|
|
11934
11934
|
onClick: () => {
|
|
11935
11935
|
if (allowEventCreation) {
|
|
11936
11936
|
const clickedTime = setHours(setMinutes(day, 0), hour);
|
|
@@ -11958,7 +11958,7 @@ END:VCALENDAR`;
|
|
|
11958
11958
|
"div",
|
|
11959
11959
|
{
|
|
11960
11960
|
draggable: allowEventDragging,
|
|
11961
|
-
onDragStart: (
|
|
11961
|
+
onDragStart: (e) => handleDragStart(e, event),
|
|
11962
11962
|
onDragEnd: handleDragEnd,
|
|
11963
11963
|
className: "absolute left-0 right-0 mx-1 p-1 rounded text-xs cursor-pointer hover:opacity-80 overflow-hidden",
|
|
11964
11964
|
style: {
|
|
@@ -11970,9 +11970,9 @@ END:VCALENDAR`;
|
|
|
11970
11970
|
opacity: draggedEventId === event.id ? 0.5 : 1,
|
|
11971
11971
|
cursor: allowEventDragging ? "move" : "pointer"
|
|
11972
11972
|
},
|
|
11973
|
-
onClick: (
|
|
11974
|
-
|
|
11975
|
-
handleEventClick(event,
|
|
11973
|
+
onClick: (e) => {
|
|
11974
|
+
e.stopPropagation();
|
|
11975
|
+
handleEventClick(event, e);
|
|
11976
11976
|
},
|
|
11977
11977
|
children: event.title
|
|
11978
11978
|
},
|
|
@@ -12020,9 +12020,9 @@ END:VCALENDAR`;
|
|
|
12020
12020
|
"hover:bg-muted/50",
|
|
12021
12021
|
dragOverInfo?.date && !dragOverInfo?.hour && isSameDay(dragOverInfo.date, day) && "bg-primary/20 border-primary"
|
|
12022
12022
|
),
|
|
12023
|
-
onDragOver: (
|
|
12023
|
+
onDragOver: (e) => handleDragOver(e, day),
|
|
12024
12024
|
onDragLeave: handleDragLeave,
|
|
12025
|
-
onDrop: (
|
|
12025
|
+
onDrop: (e) => handleDrop(e, day),
|
|
12026
12026
|
onClick: () => handleDateSelect(day),
|
|
12027
12027
|
children: [
|
|
12028
12028
|
/* @__PURE__ */ jsx("div", { className: cn(
|
|
@@ -12035,7 +12035,7 @@ END:VCALENDAR`;
|
|
|
12035
12035
|
motion.div,
|
|
12036
12036
|
{
|
|
12037
12037
|
draggable: allowEventDragging,
|
|
12038
|
-
onDragStart: (
|
|
12038
|
+
onDragStart: (e) => handleDragStart(e, event),
|
|
12039
12039
|
onDragEnd: handleDragEnd,
|
|
12040
12040
|
className: "text-xs p-1 rounded cursor-pointer truncate",
|
|
12041
12041
|
style: {
|
|
@@ -12046,9 +12046,9 @@ END:VCALENDAR`;
|
|
|
12046
12046
|
},
|
|
12047
12047
|
whileHover: { scale: 1.02 },
|
|
12048
12048
|
whileTap: { scale: 0.98 },
|
|
12049
|
-
onClick: (
|
|
12050
|
-
|
|
12051
|
-
handleEventClick(event,
|
|
12049
|
+
onClick: (e) => {
|
|
12050
|
+
e.stopPropagation();
|
|
12051
|
+
handleEventClick(event, e);
|
|
12052
12052
|
},
|
|
12053
12053
|
children: event.allDay ? event.title : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12054
12054
|
format(new Date(event.start), "HH:mm"),
|
|
@@ -12145,7 +12145,7 @@ END:VCALENDAR`;
|
|
|
12145
12145
|
"div",
|
|
12146
12146
|
{
|
|
12147
12147
|
className: "flex items-start gap-3 p-3 rounded-lg hover:bg-muted/50 cursor-pointer",
|
|
12148
|
-
onClick: (
|
|
12148
|
+
onClick: (e) => handleEventClick(event, e),
|
|
12149
12149
|
children: [
|
|
12150
12150
|
/* @__PURE__ */ jsx(
|
|
12151
12151
|
"div",
|
|
@@ -12332,7 +12332,7 @@ END:VCALENDAR`;
|
|
|
12332
12332
|
{
|
|
12333
12333
|
placeholder: "Search events...",
|
|
12334
12334
|
value: searchQuery,
|
|
12335
|
-
onChange: (
|
|
12335
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
12336
12336
|
className: "pl-9 w-64"
|
|
12337
12337
|
}
|
|
12338
12338
|
)
|
|
@@ -12428,7 +12428,7 @@ END:VCALENDAR`;
|
|
|
12428
12428
|
{
|
|
12429
12429
|
id: "title",
|
|
12430
12430
|
value: editingEvent.title || "",
|
|
12431
|
-
onChange: (
|
|
12431
|
+
onChange: (e) => setEditingEvent({ ...editingEvent, title: e.target.value }),
|
|
12432
12432
|
placeholder: "Event title"
|
|
12433
12433
|
}
|
|
12434
12434
|
)
|
|
@@ -12442,7 +12442,7 @@ END:VCALENDAR`;
|
|
|
12442
12442
|
id: "start",
|
|
12443
12443
|
type: "datetime-local",
|
|
12444
12444
|
value: editingEvent.start ? format(editingEvent.start, "yyyy-MM-dd'T'HH:mm") : "",
|
|
12445
|
-
onChange: (
|
|
12445
|
+
onChange: (e) => setEditingEvent({ ...editingEvent, start: new Date(e.target.value) })
|
|
12446
12446
|
}
|
|
12447
12447
|
)
|
|
12448
12448
|
] }),
|
|
@@ -12454,7 +12454,7 @@ END:VCALENDAR`;
|
|
|
12454
12454
|
id: "end",
|
|
12455
12455
|
type: "datetime-local",
|
|
12456
12456
|
value: editingEvent.end ? format(editingEvent.end, "yyyy-MM-dd'T'HH:mm") : "",
|
|
12457
|
-
onChange: (
|
|
12457
|
+
onChange: (e) => setEditingEvent({ ...editingEvent, end: new Date(e.target.value) })
|
|
12458
12458
|
}
|
|
12459
12459
|
)
|
|
12460
12460
|
] })
|
|
@@ -12500,7 +12500,7 @@ END:VCALENDAR`;
|
|
|
12500
12500
|
{
|
|
12501
12501
|
id: "location",
|
|
12502
12502
|
value: editingEvent.location || "",
|
|
12503
|
-
onChange: (
|
|
12503
|
+
onChange: (e) => setEditingEvent({ ...editingEvent, location: e.target.value }),
|
|
12504
12504
|
placeholder: "Event location"
|
|
12505
12505
|
}
|
|
12506
12506
|
)
|
|
@@ -12512,7 +12512,7 @@ END:VCALENDAR`;
|
|
|
12512
12512
|
{
|
|
12513
12513
|
id: "description",
|
|
12514
12514
|
value: editingEvent.description || "",
|
|
12515
|
-
onChange: (
|
|
12515
|
+
onChange: (e) => setEditingEvent({ ...editingEvent, description: e.target.value }),
|
|
12516
12516
|
placeholder: "Event description"
|
|
12517
12517
|
}
|
|
12518
12518
|
)
|
|
@@ -12671,8 +12671,8 @@ function CardDetailModal({
|
|
|
12671
12671
|
const completedChecklistItems = card.checklist?.items.filter((item) => item.completed).length || 0;
|
|
12672
12672
|
const totalChecklistItems = card.checklist?.items.length || 0;
|
|
12673
12673
|
const checklistProgress = totalChecklistItems > 0 ? completedChecklistItems / totalChecklistItems * 100 : 0;
|
|
12674
|
-
const handleFileUpload = (
|
|
12675
|
-
const files =
|
|
12674
|
+
const handleFileUpload = (e) => {
|
|
12675
|
+
const files = e.target.files;
|
|
12676
12676
|
if (!files)
|
|
12677
12677
|
return;
|
|
12678
12678
|
const newAttachments = Array.from(files).map((file) => ({
|
|
@@ -12697,12 +12697,12 @@ function CardDetailModal({
|
|
|
12697
12697
|
MoonUIInputPro,
|
|
12698
12698
|
{
|
|
12699
12699
|
value: card.title,
|
|
12700
|
-
onChange: (
|
|
12700
|
+
onChange: (e) => updateCard({ title: e.target.value }),
|
|
12701
12701
|
onBlur: () => setIsEditingTitle(false),
|
|
12702
|
-
onKeyDown: (
|
|
12703
|
-
if (
|
|
12702
|
+
onKeyDown: (e) => {
|
|
12703
|
+
if (e.key === "Enter")
|
|
12704
12704
|
setIsEditingTitle(false);
|
|
12705
|
-
if (
|
|
12705
|
+
if (e.key === "Escape") {
|
|
12706
12706
|
setCard(initialCard);
|
|
12707
12707
|
setIsEditingTitle(false);
|
|
12708
12708
|
}
|
|
@@ -12744,7 +12744,7 @@ function CardDetailModal({
|
|
|
12744
12744
|
MoonUITextareaPro,
|
|
12745
12745
|
{
|
|
12746
12746
|
value: card.description || "",
|
|
12747
|
-
onChange: (
|
|
12747
|
+
onChange: (e) => updateCard({ description: e.target.value }),
|
|
12748
12748
|
placeholder: "Add a description...",
|
|
12749
12749
|
className: "min-h-[100px]",
|
|
12750
12750
|
autoFocus: true
|
|
@@ -12961,10 +12961,10 @@ function CardDetailModal({
|
|
|
12961
12961
|
{
|
|
12962
12962
|
placeholder: "Add an item...",
|
|
12963
12963
|
value: newChecklistItem,
|
|
12964
|
-
onChange: (
|
|
12965
|
-
onKeyDown: (
|
|
12966
|
-
if (
|
|
12967
|
-
|
|
12964
|
+
onChange: (e) => setNewChecklistItem(e.target.value),
|
|
12965
|
+
onKeyDown: (e) => {
|
|
12966
|
+
if (e.key === "Enter") {
|
|
12967
|
+
e.preventDefault();
|
|
12968
12968
|
addChecklistItem();
|
|
12969
12969
|
}
|
|
12970
12970
|
}
|
|
@@ -13070,7 +13070,7 @@ function CardDetailModal({
|
|
|
13070
13070
|
{
|
|
13071
13071
|
placeholder: "Add a comment...",
|
|
13072
13072
|
value: newComment,
|
|
13073
|
-
onChange: (
|
|
13073
|
+
onChange: (e) => setNewComment(e.target.value),
|
|
13074
13074
|
className: "min-h-[80px]"
|
|
13075
13075
|
}
|
|
13076
13076
|
),
|
|
@@ -13286,7 +13286,7 @@ function AddCardModal({
|
|
|
13286
13286
|
id: "title",
|
|
13287
13287
|
placeholder: "Enter card title...",
|
|
13288
13288
|
value: title,
|
|
13289
|
-
onChange: (
|
|
13289
|
+
onChange: (e) => setTitle(e.target.value),
|
|
13290
13290
|
autoFocus: true
|
|
13291
13291
|
}
|
|
13292
13292
|
)
|
|
@@ -13299,7 +13299,7 @@ function AddCardModal({
|
|
|
13299
13299
|
id: "description",
|
|
13300
13300
|
placeholder: "Add a more detailed description...",
|
|
13301
13301
|
value: description,
|
|
13302
|
-
onChange: (
|
|
13302
|
+
onChange: (e) => setDescription(e.target.value),
|
|
13303
13303
|
className: "min-h-[100px]"
|
|
13304
13304
|
}
|
|
13305
13305
|
)
|
|
@@ -13460,10 +13460,10 @@ function AddCardModal({
|
|
|
13460
13460
|
{
|
|
13461
13461
|
placeholder: "Add a tag...",
|
|
13462
13462
|
value: tagInput,
|
|
13463
|
-
onChange: (
|
|
13464
|
-
onKeyDown: (
|
|
13465
|
-
if (
|
|
13466
|
-
|
|
13463
|
+
onChange: (e) => setTagInput(e.target.value),
|
|
13464
|
+
onKeyDown: (e) => {
|
|
13465
|
+
if (e.key === "Enter") {
|
|
13466
|
+
e.preventDefault();
|
|
13467
13467
|
handleAddTag();
|
|
13468
13468
|
}
|
|
13469
13469
|
}
|
|
@@ -13687,7 +13687,7 @@ var KanbanCardComponent = ({
|
|
|
13687
13687
|
"div",
|
|
13688
13688
|
{
|
|
13689
13689
|
className: "absolute left-0 top-0 bottom-0 w-1 bg-gradient-to-b from-primary/20 to-primary/10 opacity-0 group-hover:opacity-100 transition-opacity cursor-move",
|
|
13690
|
-
onPointerDown: (
|
|
13690
|
+
onPointerDown: (e) => dragControls.start(e)
|
|
13691
13691
|
}
|
|
13692
13692
|
),
|
|
13693
13693
|
cardShowCoverImage && card.coverImage && /* @__PURE__ */ jsxs("div", { className: "relative h-32 -mx-px -mt-px rounded-t-lg overflow-hidden", children: [
|
|
@@ -13716,20 +13716,20 @@ var KanbanCardComponent = ({
|
|
|
13716
13716
|
MoonUIInputPro,
|
|
13717
13717
|
{
|
|
13718
13718
|
value: title,
|
|
13719
|
-
onChange: (
|
|
13719
|
+
onChange: (e) => setTitle(e.target.value),
|
|
13720
13720
|
onBlur: () => setIsEditingTitle(false),
|
|
13721
|
-
onKeyDown: (
|
|
13722
|
-
if (
|
|
13721
|
+
onKeyDown: (e) => {
|
|
13722
|
+
if (e.key === "Enter") {
|
|
13723
13723
|
setIsEditingTitle(false);
|
|
13724
13724
|
}
|
|
13725
|
-
if (
|
|
13725
|
+
if (e.key === "Escape") {
|
|
13726
13726
|
setTitle(card.title);
|
|
13727
13727
|
setIsEditingTitle(false);
|
|
13728
13728
|
}
|
|
13729
13729
|
},
|
|
13730
13730
|
className: "h-6 px-1 py-0 text-sm font-medium",
|
|
13731
13731
|
autoFocus: true,
|
|
13732
|
-
onClick: (
|
|
13732
|
+
onClick: (e) => e.stopPropagation()
|
|
13733
13733
|
}
|
|
13734
13734
|
) : /* @__PURE__ */ jsx("h4", { className: "font-medium text-sm line-clamp-2", children: card.title }) }),
|
|
13735
13735
|
renderCardActions ? /* @__PURE__ */ jsx("div", { className: "opacity-0 group-hover:opacity-100 transition-opacity", children: renderCardActions(card) }) : /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", children: /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
@@ -13739,7 +13739,7 @@ var KanbanCardComponent = ({
|
|
|
13739
13739
|
variant: "ghost",
|
|
13740
13740
|
size: "sm",
|
|
13741
13741
|
className: "h-6 w-6 p-0",
|
|
13742
|
-
onClick: (
|
|
13742
|
+
onClick: (e) => e.stopPropagation(),
|
|
13743
13743
|
children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-3 w-3" })
|
|
13744
13744
|
}
|
|
13745
13745
|
) }),
|
|
@@ -13976,19 +13976,19 @@ function Kanban({
|
|
|
13976
13976
|
useEffect(() => {
|
|
13977
13977
|
if (!enableKeyboardShortcuts)
|
|
13978
13978
|
return;
|
|
13979
|
-
const handleKeyDown3 = (
|
|
13980
|
-
if ((
|
|
13981
|
-
|
|
13979
|
+
const handleKeyDown3 = (e) => {
|
|
13980
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "f") {
|
|
13981
|
+
e.preventDefault();
|
|
13982
13982
|
document.getElementById("kanban-search")?.focus();
|
|
13983
13983
|
}
|
|
13984
|
-
if ((
|
|
13985
|
-
|
|
13984
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "n") {
|
|
13985
|
+
e.preventDefault();
|
|
13986
13986
|
const firstColumn = columns[0];
|
|
13987
13987
|
if (firstColumn && onAddCard) {
|
|
13988
13988
|
onAddCard(firstColumn.id);
|
|
13989
13989
|
}
|
|
13990
13990
|
}
|
|
13991
|
-
if (
|
|
13991
|
+
if (e.key === "Escape") {
|
|
13992
13992
|
setSelectedCards([]);
|
|
13993
13993
|
}
|
|
13994
13994
|
};
|
|
@@ -14008,7 +14008,7 @@ function Kanban({
|
|
|
14008
14008
|
onDragStart(card, column);
|
|
14009
14009
|
}
|
|
14010
14010
|
};
|
|
14011
|
-
const handleDragOver = (
|
|
14011
|
+
const handleDragOver = (e, columnId) => {
|
|
14012
14012
|
if (disabled)
|
|
14013
14013
|
return;
|
|
14014
14014
|
const column = columns.find((col) => col.id === columnId);
|
|
@@ -14016,13 +14016,13 @@ function Kanban({
|
|
|
14016
14016
|
return;
|
|
14017
14017
|
if (dropDisabled === true)
|
|
14018
14018
|
return;
|
|
14019
|
-
|
|
14019
|
+
e.preventDefault();
|
|
14020
14020
|
setDraggedOverColumn(columnId);
|
|
14021
14021
|
const container = scrollRef.current;
|
|
14022
14022
|
if (!container)
|
|
14023
14023
|
return;
|
|
14024
14024
|
const rect = container.getBoundingClientRect();
|
|
14025
|
-
const x =
|
|
14025
|
+
const x = e.clientX;
|
|
14026
14026
|
if (x < rect.left + 100) {
|
|
14027
14027
|
startAutoScroll("left");
|
|
14028
14028
|
} else if (x > rect.right - 100) {
|
|
@@ -14043,10 +14043,10 @@ function Kanban({
|
|
|
14043
14043
|
setDraggedOverColumn(null);
|
|
14044
14044
|
stopAutoScroll();
|
|
14045
14045
|
};
|
|
14046
|
-
const handleDrop = (
|
|
14046
|
+
const handleDrop = (e, targetColumnId, targetIndex) => {
|
|
14047
14047
|
if (disabled || !draggedCard)
|
|
14048
14048
|
return;
|
|
14049
|
-
|
|
14049
|
+
e.preventDefault();
|
|
14050
14050
|
const targetColumn = columns.find((col) => col.id === targetColumnId);
|
|
14051
14051
|
const draggedCardObj = columns.flatMap((col) => col.cards).find((card) => card.id === draggedCard);
|
|
14052
14052
|
if (targetColumn && draggedCardObj && canDrop && !canDrop(draggedCardObj, targetColumn, targetIndex)) {
|
|
@@ -14312,7 +14312,7 @@ function Kanban({
|
|
|
14312
14312
|
id: "kanban-search",
|
|
14313
14313
|
placeholder: "Search cards...",
|
|
14314
14314
|
value: searchQuery,
|
|
14315
|
-
onChange: (
|
|
14315
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
14316
14316
|
className: "pl-9"
|
|
14317
14317
|
}
|
|
14318
14318
|
)
|
|
@@ -14410,7 +14410,7 @@ function Kanban({
|
|
|
14410
14410
|
ref: scrollRef,
|
|
14411
14411
|
className: "flex overflow-x-auto pb-4",
|
|
14412
14412
|
style: { gap: `${columnGap}px` },
|
|
14413
|
-
onDragOver: (
|
|
14413
|
+
onDragOver: (e) => e.preventDefault(),
|
|
14414
14414
|
children: [
|
|
14415
14415
|
/* @__PURE__ */ jsx(AnimatePresence, { mode: "sync", children: filteredColumns.map((column) => {
|
|
14416
14416
|
const isOverLimit = column.limit && column.cards.length >= column.limit;
|
|
@@ -14431,9 +14431,9 @@ function Kanban({
|
|
|
14431
14431
|
minWidth: columnWidth === "auto" ? "300px" : void 0,
|
|
14432
14432
|
transitionDuration: enableAnimations ? `${animationDuration}s` : "0s"
|
|
14433
14433
|
},
|
|
14434
|
-
onDragOver: (
|
|
14434
|
+
onDragOver: (e) => handleDragOver(e, column.id),
|
|
14435
14435
|
onDragLeave: () => setDraggedOverColumn(null),
|
|
14436
|
-
onDrop: (
|
|
14436
|
+
onDrop: (e) => handleDrop(e, column.id, column.cards.length),
|
|
14437
14437
|
children: /* @__PURE__ */ jsxs(MoonUICardPro, { className: cn(
|
|
14438
14438
|
"h-full transition-all duration-200",
|
|
14439
14439
|
isDraggedOver && "ring-2 ring-primary ring-offset-2 bg-primary/5",
|
|
@@ -14453,20 +14453,20 @@ function Kanban({
|
|
|
14453
14453
|
MoonUIInputPro,
|
|
14454
14454
|
{
|
|
14455
14455
|
value: editingColumnTitle,
|
|
14456
|
-
onChange: (
|
|
14456
|
+
onChange: (e) => setEditingColumnTitle(e.target.value),
|
|
14457
14457
|
onBlur: () => handleColumnRename(column.id),
|
|
14458
|
-
onKeyDown: (
|
|
14459
|
-
if (
|
|
14458
|
+
onKeyDown: (e) => {
|
|
14459
|
+
if (e.key === "Enter") {
|
|
14460
14460
|
handleColumnRename(column.id);
|
|
14461
14461
|
}
|
|
14462
|
-
if (
|
|
14462
|
+
if (e.key === "Escape") {
|
|
14463
14463
|
setEditingColumnId(null);
|
|
14464
14464
|
setEditingColumnTitle("");
|
|
14465
14465
|
}
|
|
14466
14466
|
},
|
|
14467
14467
|
className: "h-6 w-32 text-sm",
|
|
14468
14468
|
autoFocus: true,
|
|
14469
|
-
onClick: (
|
|
14469
|
+
onClick: (e) => e.stopPropagation()
|
|
14470
14470
|
}
|
|
14471
14471
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14472
14472
|
column.title,
|
|
@@ -14564,10 +14564,10 @@ function Kanban({
|
|
|
14564
14564
|
draggable: !disabled && (typeof dragDisabled === "function" ? !dragDisabled(card) : !dragDisabled),
|
|
14565
14565
|
onDragStart: () => handleDragStart(card, column.id),
|
|
14566
14566
|
onDragEnd: handleDragEnd,
|
|
14567
|
-
onDrop: (
|
|
14568
|
-
|
|
14569
|
-
|
|
14570
|
-
handleDrop(
|
|
14567
|
+
onDrop: (e) => {
|
|
14568
|
+
e.preventDefault();
|
|
14569
|
+
e.stopPropagation();
|
|
14570
|
+
handleDrop(e, column.id, index2);
|
|
14571
14571
|
},
|
|
14572
14572
|
className: "mb-3",
|
|
14573
14573
|
children: /* @__PURE__ */ jsx(
|
|
@@ -14576,12 +14576,12 @@ function Kanban({
|
|
|
14576
14576
|
card,
|
|
14577
14577
|
column,
|
|
14578
14578
|
isDragging: draggedCard === card.id,
|
|
14579
|
-
onEdit: (
|
|
14580
|
-
|
|
14579
|
+
onEdit: (e) => {
|
|
14580
|
+
e.stopPropagation();
|
|
14581
14581
|
onCardEdit?.(card);
|
|
14582
14582
|
},
|
|
14583
|
-
onDelete: (
|
|
14584
|
-
|
|
14583
|
+
onDelete: (e) => {
|
|
14584
|
+
e.stopPropagation();
|
|
14585
14585
|
onCardDelete?.(card);
|
|
14586
14586
|
},
|
|
14587
14587
|
onClick: () => handleCardClick(card),
|
|
@@ -14659,14 +14659,14 @@ function Kanban({
|
|
|
14659
14659
|
{
|
|
14660
14660
|
placeholder: "Enter column title...",
|
|
14661
14661
|
value: newColumnTitle,
|
|
14662
|
-
onChange: (
|
|
14663
|
-
onKeyDown: (
|
|
14664
|
-
if (
|
|
14662
|
+
onChange: (e) => setNewColumnTitle(e.target.value),
|
|
14663
|
+
onKeyDown: (e) => {
|
|
14664
|
+
if (e.key === "Enter" && newColumnTitle) {
|
|
14665
14665
|
onAddColumn({ title: newColumnTitle });
|
|
14666
14666
|
setNewColumnTitle("");
|
|
14667
14667
|
setIsCreatingColumn(false);
|
|
14668
14668
|
}
|
|
14669
|
-
if (
|
|
14669
|
+
if (e.key === "Escape") {
|
|
14670
14670
|
setNewColumnTitle("");
|
|
14671
14671
|
setIsCreatingColumn(false);
|
|
14672
14672
|
}
|
|
@@ -14796,7 +14796,7 @@ function Kanban({
|
|
|
14796
14796
|
type: "number",
|
|
14797
14797
|
min: "0",
|
|
14798
14798
|
value: wipLimit || "",
|
|
14799
|
-
onChange: (
|
|
14799
|
+
onChange: (e) => setWipLimit(e.target.value ? parseInt(e.target.value) : void 0),
|
|
14800
14800
|
placeholder: "Enter a number (leave empty to remove limit)"
|
|
14801
14801
|
}
|
|
14802
14802
|
),
|
|
@@ -18519,10 +18519,10 @@ var StepResult = class {
|
|
|
18519
18519
|
static fromReplace(doc3, from2, to, slice2) {
|
|
18520
18520
|
try {
|
|
18521
18521
|
return StepResult.ok(doc3.replace(from2, to, slice2));
|
|
18522
|
-
} catch (
|
|
18523
|
-
if (
|
|
18524
|
-
return StepResult.fail(
|
|
18525
|
-
throw
|
|
18522
|
+
} catch (e) {
|
|
18523
|
+
if (e instanceof ReplaceError)
|
|
18524
|
+
return StepResult.fail(e.message);
|
|
18525
|
+
throw e;
|
|
18526
18526
|
}
|
|
18527
18527
|
}
|
|
18528
18528
|
};
|
|
@@ -19149,7 +19149,7 @@ function canSplit(doc3, pos, depth = 1, typesAfter) {
|
|
|
19149
19149
|
}
|
|
19150
19150
|
function split(tr2, pos, depth = 1, typesAfter) {
|
|
19151
19151
|
let $pos = tr2.doc.resolve(pos), before = Fragment8.empty, after = Fragment8.empty;
|
|
19152
|
-
for (let d = $pos.depth,
|
|
19152
|
+
for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {
|
|
19153
19153
|
before = Fragment8.from($pos.node(d).copy(before));
|
|
19154
19154
|
let typeAfter = typesAfter && typesAfter[i];
|
|
19155
19155
|
after = Fragment8.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
|
|
@@ -22570,7 +22570,7 @@ var ViewTreeUpdater = class {
|
|
|
22570
22570
|
if (index2 >= this.preMatch.index && (targetDesc = this.preMatch.matches[index2 - this.preMatch.index]).parent == this.top && targetDesc.matchesNode(node, outerDeco, innerDeco)) {
|
|
22571
22571
|
found2 = this.top.children.indexOf(targetDesc, this.index);
|
|
22572
22572
|
} else {
|
|
22573
|
-
for (let i = this.index,
|
|
22573
|
+
for (let i = this.index, e = Math.min(this.top.children.length, i + 5); i < e; i++) {
|
|
22574
22574
|
let child = this.top.children[i];
|
|
22575
22575
|
if (child.matchesNode(node, outerDeco, innerDeco) && !this.preMatch.matched.has(child)) {
|
|
22576
22576
|
found2 = i;
|
|
@@ -23620,7 +23620,7 @@ function addContext(slice2, context) {
|
|
|
23620
23620
|
let schema = slice2.content.firstChild.type.schema, array;
|
|
23621
23621
|
try {
|
|
23622
23622
|
array = JSON.parse(context);
|
|
23623
|
-
} catch (
|
|
23623
|
+
} catch (e) {
|
|
23624
23624
|
return slice2;
|
|
23625
23625
|
}
|
|
23626
23626
|
let { content, openStart, openEnd } = slice2;
|
|
@@ -24237,7 +24237,7 @@ handlers.dragend = (view) => {
|
|
|
24237
24237
|
view.dragging = null;
|
|
24238
24238
|
}, 50);
|
|
24239
24239
|
};
|
|
24240
|
-
editHandlers.dragover = editHandlers.dragenter = (_,
|
|
24240
|
+
editHandlers.dragover = editHandlers.dragenter = (_, e) => e.preventDefault();
|
|
24241
24241
|
editHandlers.drop = (view, _event) => {
|
|
24242
24242
|
let event = _event;
|
|
24243
24243
|
let dragging = view.dragging;
|
|
@@ -25013,8 +25013,8 @@ var DOMObserver = class {
|
|
|
25013
25013
|
this.flush();
|
|
25014
25014
|
});
|
|
25015
25015
|
if (useCharData) {
|
|
25016
|
-
this.onCharData = (
|
|
25017
|
-
this.queue.push({ target:
|
|
25016
|
+
this.onCharData = (e) => {
|
|
25017
|
+
this.queue.push({ target: e.target, type: "characterData", oldValue: e.prevValue });
|
|
25018
25018
|
this.flushSoon();
|
|
25019
25019
|
};
|
|
25020
25020
|
}
|
|
@@ -26748,7 +26748,7 @@ function doWrapInList(tr2, range, wrappers, joinBefore, listType) {
|
|
|
26748
26748
|
found2 = i + 1;
|
|
26749
26749
|
let splitDepth = wrappers.length - found2;
|
|
26750
26750
|
let splitPos = range.start + wrappers.length - (joinBefore ? 2 : 0), parent = range.parent;
|
|
26751
|
-
for (let i = range.startIndex,
|
|
26751
|
+
for (let i = range.startIndex, e = range.endIndex, first2 = true; i < e; i++, first2 = false) {
|
|
26752
26752
|
if (!first2 && canSplit(tr2.doc, splitPos, splitDepth)) {
|
|
26753
26753
|
tr2.split(splitPos, splitDepth);
|
|
26754
26754
|
splitPos += 2 * splitDepth;
|
|
@@ -26789,7 +26789,7 @@ function liftToOuterList(state, dispatch2, itemType, range) {
|
|
|
26789
26789
|
}
|
|
26790
26790
|
function liftOutOfList(state, dispatch2, range) {
|
|
26791
26791
|
let tr2 = state.tr, list = range.parent;
|
|
26792
|
-
for (let pos = range.end, i = range.endIndex - 1,
|
|
26792
|
+
for (let pos = range.end, i = range.endIndex - 1, e = range.startIndex; i > e; i--) {
|
|
26793
26793
|
pos -= list.child(i).nodeSize;
|
|
26794
26794
|
tr2.delete(pos - 1, pos + 1);
|
|
26795
26795
|
}
|
|
@@ -27083,9 +27083,9 @@ function createNodeFromContent(content, schema, options) {
|
|
|
27083
27083
|
parseDOM: [
|
|
27084
27084
|
{
|
|
27085
27085
|
tag: "*",
|
|
27086
|
-
getAttrs: (
|
|
27086
|
+
getAttrs: (e) => {
|
|
27087
27087
|
hasInvalidContent = true;
|
|
27088
|
-
invalidContent = typeof
|
|
27088
|
+
invalidContent = typeof e === "string" ? e : e.outerHTML;
|
|
27089
27089
|
return null;
|
|
27090
27090
|
}
|
|
27091
27091
|
}
|
|
@@ -27415,8 +27415,8 @@ function getSchemaByResolvedExtensions(extensions, editor) {
|
|
|
27415
27415
|
storage: extension.storage,
|
|
27416
27416
|
editor
|
|
27417
27417
|
};
|
|
27418
|
-
const extraNodeFields = extensions.reduce((fields,
|
|
27419
|
-
const extendNodeSchema = getExtensionField(
|
|
27418
|
+
const extraNodeFields = extensions.reduce((fields, e) => {
|
|
27419
|
+
const extendNodeSchema = getExtensionField(e, "extendNodeSchema", context);
|
|
27420
27420
|
return {
|
|
27421
27421
|
...fields,
|
|
27422
27422
|
...extendNodeSchema ? extendNodeSchema(extension) : {}
|
|
@@ -27477,8 +27477,8 @@ function getSchemaByResolvedExtensions(extensions, editor) {
|
|
|
27477
27477
|
storage: extension.storage,
|
|
27478
27478
|
editor
|
|
27479
27479
|
};
|
|
27480
|
-
const extraMarkFields = extensions.reduce((fields,
|
|
27481
|
-
const extendMarkSchema = getExtensionField(
|
|
27480
|
+
const extraMarkFields = extensions.reduce((fields, e) => {
|
|
27481
|
+
const extendMarkSchema = getExtensionField(e, "extendMarkSchema", context);
|
|
27482
27482
|
return {
|
|
27483
27483
|
...fields,
|
|
27484
27484
|
...extendMarkSchema ? extendMarkSchema(extension) : {}
|
|
@@ -29188,8 +29188,8 @@ var insertContentAt = (position, value, options) => ({ tr: tr2, dispatch: dispat
|
|
|
29188
29188
|
parseOptions,
|
|
29189
29189
|
errorOnInvalidContent: true
|
|
29190
29190
|
});
|
|
29191
|
-
} catch (
|
|
29192
|
-
emitContentError(
|
|
29191
|
+
} catch (e) {
|
|
29192
|
+
emitContentError(e);
|
|
29193
29193
|
}
|
|
29194
29194
|
}
|
|
29195
29195
|
try {
|
|
@@ -29197,8 +29197,8 @@ var insertContentAt = (position, value, options) => ({ tr: tr2, dispatch: dispat
|
|
|
29197
29197
|
parseOptions,
|
|
29198
29198
|
errorOnInvalidContent: (_a = options.errorOnInvalidContent) != null ? _a : editor.options.enableContentCheck
|
|
29199
29199
|
});
|
|
29200
|
-
} catch (
|
|
29201
|
-
emitContentError(
|
|
29200
|
+
} catch (e) {
|
|
29201
|
+
emitContentError(e);
|
|
29202
29202
|
return false;
|
|
29203
29203
|
}
|
|
29204
29204
|
let { from: from2, to } = typeof position === "number" ? { from: position, to: position } : { from: position.from, to: position.to };
|
|
@@ -30108,10 +30108,10 @@ var Drop = Extension.create({
|
|
|
30108
30108
|
new Plugin({
|
|
30109
30109
|
key: new PluginKey("tiptapDrop"),
|
|
30110
30110
|
props: {
|
|
30111
|
-
handleDrop: (_,
|
|
30111
|
+
handleDrop: (_, e, slice2, moved) => {
|
|
30112
30112
|
this.editor.emit("drop", {
|
|
30113
30113
|
editor: this.editor,
|
|
30114
|
-
event:
|
|
30114
|
+
event: e,
|
|
30115
30115
|
slice: slice2,
|
|
30116
30116
|
moved
|
|
30117
30117
|
});
|
|
@@ -30281,10 +30281,10 @@ var Paste = Extension.create({
|
|
|
30281
30281
|
new Plugin({
|
|
30282
30282
|
key: new PluginKey("tiptapPaste"),
|
|
30283
30283
|
props: {
|
|
30284
|
-
handlePaste: (_view,
|
|
30284
|
+
handlePaste: (_view, e, slice2) => {
|
|
30285
30285
|
this.editor.emit("paste", {
|
|
30286
30286
|
editor: this.editor,
|
|
30287
|
-
event:
|
|
30287
|
+
event: e,
|
|
30288
30288
|
slice: slice2
|
|
30289
30289
|
});
|
|
30290
30290
|
}
|
|
@@ -30872,13 +30872,13 @@ var Editor = class extends EventEmitter {
|
|
|
30872
30872
|
doc3 = createDocument(this.options.content, this.schema, this.options.parseOptions, {
|
|
30873
30873
|
errorOnInvalidContent: this.options.enableContentCheck
|
|
30874
30874
|
});
|
|
30875
|
-
} catch (
|
|
30876
|
-
if (!(
|
|
30877
|
-
throw
|
|
30875
|
+
} catch (e) {
|
|
30876
|
+
if (!(e instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(e.message)) {
|
|
30877
|
+
throw e;
|
|
30878
30878
|
}
|
|
30879
30879
|
this.emit("contentError", {
|
|
30880
30880
|
editor: this,
|
|
30881
|
-
error:
|
|
30881
|
+
error: e,
|
|
30882
30882
|
disableCollaboration: () => {
|
|
30883
30883
|
if ("collaboration" in this.storage && typeof this.storage.collaboration === "object" && this.storage.collaboration) {
|
|
30884
30884
|
this.storage.collaboration.isDisabled = true;
|
|
@@ -34839,8 +34839,8 @@ var DropCursorView = class {
|
|
|
34839
34839
|
this.color = options.color === false ? void 0 : options.color || "black";
|
|
34840
34840
|
this.class = options.class;
|
|
34841
34841
|
this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((name) => {
|
|
34842
|
-
let handler = (
|
|
34843
|
-
this[name](
|
|
34842
|
+
let handler = (e) => {
|
|
34843
|
+
this[name](e);
|
|
34844
34844
|
};
|
|
34845
34845
|
editorView.dom.addEventListener(name, handler);
|
|
34846
34846
|
return { name, handler };
|
|
@@ -35679,12 +35679,12 @@ function history(config = {}) {
|
|
|
35679
35679
|
config,
|
|
35680
35680
|
props: {
|
|
35681
35681
|
handleDOMEvents: {
|
|
35682
|
-
beforeinput(view,
|
|
35683
|
-
let inputType =
|
|
35682
|
+
beforeinput(view, e) {
|
|
35683
|
+
let inputType = e.inputType;
|
|
35684
35684
|
let command2 = inputType == "historyUndo" ? undo : inputType == "historyRedo" ? redo : null;
|
|
35685
35685
|
if (!command2)
|
|
35686
35686
|
return false;
|
|
35687
|
-
|
|
35687
|
+
e.preventDefault();
|
|
35688
35688
|
return command2(view.state, view.dispatch);
|
|
35689
35689
|
}
|
|
35690
35690
|
}
|
|
@@ -36491,7 +36491,7 @@ function computeMap(table) {
|
|
|
36491
36491
|
let mapPos = 0;
|
|
36492
36492
|
let problems = null;
|
|
36493
36493
|
const colWidths = [];
|
|
36494
|
-
for (let i = 0,
|
|
36494
|
+
for (let i = 0, e = width * height; i < e; i++)
|
|
36495
36495
|
map2[i] = 0;
|
|
36496
36496
|
for (let row = 0, pos = 0; row < height; row++) {
|
|
36497
36497
|
const rowNode = table.child(row);
|
|
@@ -37063,7 +37063,7 @@ function changedDescendants(old, cur, offset4, f) {
|
|
|
37063
37063
|
outer:
|
|
37064
37064
|
for (let i = 0, j = 0; i < curSize; i++) {
|
|
37065
37065
|
const child = cur.child(i);
|
|
37066
|
-
for (let scan = j,
|
|
37066
|
+
for (let scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) {
|
|
37067
37067
|
if (old.child(scan) == child) {
|
|
37068
37068
|
j = scan + 1;
|
|
37069
37069
|
offset4 += child.nodeSize;
|
|
@@ -53905,8 +53905,8 @@ function RichTextEditor({
|
|
|
53905
53905
|
console.log("[RichTextEditor] Final settings with props override:", settings);
|
|
53906
53906
|
return settings;
|
|
53907
53907
|
}
|
|
53908
|
-
} catch (
|
|
53909
|
-
console.error("Failed to load AI settings from localStorage:",
|
|
53908
|
+
} catch (e) {
|
|
53909
|
+
console.error("Failed to load AI settings from localStorage:", e);
|
|
53910
53910
|
}
|
|
53911
53911
|
}
|
|
53912
53912
|
const defaultSettings = {
|
|
@@ -54699,11 +54699,11 @@ function RichTextEditor({
|
|
|
54699
54699
|
{
|
|
54700
54700
|
id: "url",
|
|
54701
54701
|
value: linkUrl,
|
|
54702
|
-
onChange: (
|
|
54702
|
+
onChange: (e) => setLinkUrl(e.target.value),
|
|
54703
54703
|
placeholder: "https://example.com",
|
|
54704
|
-
onKeyDown: (
|
|
54705
|
-
if (
|
|
54706
|
-
|
|
54704
|
+
onKeyDown: (e) => {
|
|
54705
|
+
if (e.key === "Enter") {
|
|
54706
|
+
e.preventDefault();
|
|
54707
54707
|
addLink();
|
|
54708
54708
|
}
|
|
54709
54709
|
}
|
|
@@ -54756,11 +54756,11 @@ function RichTextEditor({
|
|
|
54756
54756
|
{
|
|
54757
54757
|
id: "image-url",
|
|
54758
54758
|
value: imageUrl,
|
|
54759
|
-
onChange: (
|
|
54759
|
+
onChange: (e) => setImageUrl(e.target.value),
|
|
54760
54760
|
placeholder: "https://example.com/image.jpg",
|
|
54761
|
-
onKeyDown: (
|
|
54762
|
-
if (
|
|
54763
|
-
|
|
54761
|
+
onKeyDown: (e) => {
|
|
54762
|
+
if (e.key === "Enter") {
|
|
54763
|
+
e.preventDefault();
|
|
54764
54764
|
addImage();
|
|
54765
54765
|
}
|
|
54766
54766
|
}
|
|
@@ -54801,7 +54801,7 @@ function RichTextEditor({
|
|
|
54801
54801
|
min: "1",
|
|
54802
54802
|
max: "20",
|
|
54803
54803
|
value: tableRows,
|
|
54804
|
-
onChange: (
|
|
54804
|
+
onChange: (e) => setTableRows(parseInt(e.target.value) || 3)
|
|
54805
54805
|
}
|
|
54806
54806
|
)
|
|
54807
54807
|
] }),
|
|
@@ -54815,7 +54815,7 @@ function RichTextEditor({
|
|
|
54815
54815
|
min: "1",
|
|
54816
54816
|
max: "10",
|
|
54817
54817
|
value: tableCols,
|
|
54818
|
-
onChange: (
|
|
54818
|
+
onChange: (e) => setTableCols(parseInt(e.target.value) || 3)
|
|
54819
54819
|
}
|
|
54820
54820
|
)
|
|
54821
54821
|
] })
|
|
@@ -55163,8 +55163,8 @@ function RichTextEditor({
|
|
|
55163
55163
|
id: "apiKey",
|
|
55164
55164
|
type: "password",
|
|
55165
55165
|
value: aiSettings.apiKey,
|
|
55166
|
-
onChange: (
|
|
55167
|
-
const newSettings = { ...aiSettings, apiKey:
|
|
55166
|
+
onChange: (e) => {
|
|
55167
|
+
const newSettings = { ...aiSettings, apiKey: e.target.value };
|
|
55168
55168
|
setAiSettings(newSettings);
|
|
55169
55169
|
if (persistAISettings) {
|
|
55170
55170
|
localStorage.setItem("moonui-ai-settings", JSON.stringify(newSettings));
|
|
@@ -55225,8 +55225,8 @@ function RichTextEditor({
|
|
|
55225
55225
|
max: "2",
|
|
55226
55226
|
step: "0.1",
|
|
55227
55227
|
value: aiSettings.temperature,
|
|
55228
|
-
onChange: (
|
|
55229
|
-
const newSettings = { ...aiSettings, temperature: parseFloat(
|
|
55228
|
+
onChange: (e) => {
|
|
55229
|
+
const newSettings = { ...aiSettings, temperature: parseFloat(e.target.value) };
|
|
55230
55230
|
setAiSettings(newSettings);
|
|
55231
55231
|
if (persistAISettings) {
|
|
55232
55232
|
localStorage.setItem("moonui-ai-settings", JSON.stringify(newSettings));
|
|
@@ -55245,8 +55245,8 @@ function RichTextEditor({
|
|
|
55245
55245
|
min: "1",
|
|
55246
55246
|
max: "4000",
|
|
55247
55247
|
value: aiSettings.maxTokens,
|
|
55248
|
-
onChange: (
|
|
55249
|
-
const newSettings = { ...aiSettings, maxTokens: parseInt(
|
|
55248
|
+
onChange: (e) => {
|
|
55249
|
+
const newSettings = { ...aiSettings, maxTokens: parseInt(e.target.value) };
|
|
55250
55250
|
setAiSettings(newSettings);
|
|
55251
55251
|
if (persistAISettings) {
|
|
55252
55252
|
localStorage.setItem("moonui-ai-settings", JSON.stringify(newSettings));
|
|
@@ -55544,7 +55544,7 @@ function RichTextEditor({
|
|
|
55544
55544
|
"textarea",
|
|
55545
55545
|
{
|
|
55546
55546
|
value: sourceContent,
|
|
55547
|
-
onChange: (
|
|
55547
|
+
onChange: (e) => setSourceContent(e.target.value),
|
|
55548
55548
|
className: "w-full h-full p-4 font-mono text-sm resize-none focus:outline-none bg-gray-50 dark:bg-gray-900",
|
|
55549
55549
|
placeholder: "HTML source code..."
|
|
55550
55550
|
}
|
|
@@ -55940,12 +55940,12 @@ function MemoryEfficientData({
|
|
|
55940
55940
|
}
|
|
55941
55941
|
}
|
|
55942
55942
|
}, [variableHeight]);
|
|
55943
|
-
const handleScroll = useCallback((
|
|
55943
|
+
const handleScroll = useCallback((e) => {
|
|
55944
55944
|
if (performanceTracking) {
|
|
55945
55945
|
performanceTrackerRef.current.recordFrame();
|
|
55946
55946
|
}
|
|
55947
|
-
const scrollTop =
|
|
55948
|
-
const containerHeight =
|
|
55947
|
+
const scrollTop = e.currentTarget.scrollTop;
|
|
55948
|
+
const containerHeight = e.currentTarget.clientHeight;
|
|
55949
55949
|
let newStart, newEnd;
|
|
55950
55950
|
if (variableHeight) {
|
|
55951
55951
|
const range = heightManagerRef.current.getVisibleRange(scrollTop, containerHeight, processedData.length);
|
|
@@ -56055,7 +56055,7 @@ function MemoryEfficientData({
|
|
|
56055
56055
|
type: "text",
|
|
56056
56056
|
placeholder: searchPlaceholder,
|
|
56057
56057
|
value: tableFeatures.searchTerm,
|
|
56058
|
-
onChange: (
|
|
56058
|
+
onChange: (e) => handleSearch(e.target.value),
|
|
56059
56059
|
className: "w-full pl-10 pr-4 py-2 border rounded-md bg-background text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
|
|
56060
56060
|
}
|
|
56061
56061
|
)
|
|
@@ -56473,10 +56473,10 @@ function VirtualList({
|
|
|
56473
56473
|
}
|
|
56474
56474
|
return result;
|
|
56475
56475
|
}, [items, visibleRange, itemPositions, variableHeight]);
|
|
56476
|
-
const handleScroll = useCallback((
|
|
56477
|
-
const scrollTop2 =
|
|
56478
|
-
const scrollHeight =
|
|
56479
|
-
const clientHeight =
|
|
56476
|
+
const handleScroll = useCallback((e) => {
|
|
56477
|
+
const scrollTop2 = e.currentTarget.scrollTop;
|
|
56478
|
+
const scrollHeight = e.currentTarget.scrollHeight;
|
|
56479
|
+
const clientHeight = e.currentTarget.clientHeight;
|
|
56480
56480
|
setScrollTop(scrollTop2);
|
|
56481
56481
|
setIsScrolling(true);
|
|
56482
56482
|
if (onScroll) {
|
|
@@ -56522,32 +56522,32 @@ function VirtualList({
|
|
|
56522
56522
|
return () => resizeObserver.disconnect();
|
|
56523
56523
|
}, [variableHeight, itemHeights, visibleItems]);
|
|
56524
56524
|
useEffect(() => {
|
|
56525
|
-
const handleKeyDown3 = (
|
|
56525
|
+
const handleKeyDown3 = (e) => {
|
|
56526
56526
|
if (!containerRef.current)
|
|
56527
56527
|
return;
|
|
56528
|
-
switch (
|
|
56528
|
+
switch (e.key) {
|
|
56529
56529
|
case "ArrowUp":
|
|
56530
|
-
|
|
56530
|
+
e.preventDefault();
|
|
56531
56531
|
scrollElementRef.current?.scrollBy({ top: -itemHeight, behavior: "smooth" });
|
|
56532
56532
|
break;
|
|
56533
56533
|
case "ArrowDown":
|
|
56534
|
-
|
|
56534
|
+
e.preventDefault();
|
|
56535
56535
|
scrollElementRef.current?.scrollBy({ top: itemHeight, behavior: "smooth" });
|
|
56536
56536
|
break;
|
|
56537
56537
|
case "PageUp":
|
|
56538
|
-
|
|
56538
|
+
e.preventDefault();
|
|
56539
56539
|
scrollElementRef.current?.scrollBy({ top: -height, behavior: "smooth" });
|
|
56540
56540
|
break;
|
|
56541
56541
|
case "PageDown":
|
|
56542
|
-
|
|
56542
|
+
e.preventDefault();
|
|
56543
56543
|
scrollElementRef.current?.scrollBy({ top: height, behavior: "smooth" });
|
|
56544
56544
|
break;
|
|
56545
56545
|
case "Home":
|
|
56546
|
-
|
|
56546
|
+
e.preventDefault();
|
|
56547
56547
|
scrollElementRef.current?.scrollTo({ top: 0, behavior: "smooth" });
|
|
56548
56548
|
break;
|
|
56549
56549
|
case "End":
|
|
56550
|
-
|
|
56550
|
+
e.preventDefault();
|
|
56551
56551
|
scrollElementRef.current?.scrollTo({ top: totalHeight, behavior: "smooth" });
|
|
56552
56552
|
break;
|
|
56553
56553
|
}
|
|
@@ -56847,7 +56847,7 @@ function SelectableVirtualList({
|
|
|
56847
56847
|
isSelected && "bg-primary/10 border-l-4 border-primary",
|
|
56848
56848
|
isFocused && "ring-2 ring-ring ring-offset-2"
|
|
56849
56849
|
),
|
|
56850
|
-
onClick: (
|
|
56850
|
+
onClick: (e) => selectable && handleItemClick(index2, e),
|
|
56851
56851
|
onKeyDown: handleKeyDown3,
|
|
56852
56852
|
tabIndex: selectable ? 0 : void 0,
|
|
56853
56853
|
role: selectable ? "option" : void 0,
|
|
@@ -57045,12 +57045,12 @@ function Timeline({
|
|
|
57045
57045
|
useEffect(() => {
|
|
57046
57046
|
if (!keyboardNavigation)
|
|
57047
57047
|
return;
|
|
57048
|
-
const handleKeyDown3 = (
|
|
57048
|
+
const handleKeyDown3 = (e) => {
|
|
57049
57049
|
const currentIndex = events.findIndex((event) => event.id === focusedEventId);
|
|
57050
|
-
switch (
|
|
57050
|
+
switch (e.key) {
|
|
57051
57051
|
case "ArrowDown":
|
|
57052
57052
|
case "ArrowRight":
|
|
57053
|
-
|
|
57053
|
+
e.preventDefault();
|
|
57054
57054
|
if (currentIndex < events.length - 1) {
|
|
57055
57055
|
const nextEvent = events[currentIndex + 1];
|
|
57056
57056
|
setFocusedEventId(nextEvent.id);
|
|
@@ -57059,7 +57059,7 @@ function Timeline({
|
|
|
57059
57059
|
break;
|
|
57060
57060
|
case "ArrowUp":
|
|
57061
57061
|
case "ArrowLeft":
|
|
57062
|
-
|
|
57062
|
+
e.preventDefault();
|
|
57063
57063
|
if (currentIndex > 0) {
|
|
57064
57064
|
const prevEvent = events[currentIndex - 1];
|
|
57065
57065
|
setFocusedEventId(prevEvent.id);
|
|
@@ -57068,9 +57068,9 @@ function Timeline({
|
|
|
57068
57068
|
break;
|
|
57069
57069
|
case "Enter":
|
|
57070
57070
|
case " ":
|
|
57071
|
-
|
|
57071
|
+
e.preventDefault();
|
|
57072
57072
|
if (focusedEventId) {
|
|
57073
|
-
const event = events.find((
|
|
57073
|
+
const event = events.find((e2) => e2.id === focusedEventId);
|
|
57074
57074
|
if (event && onEventClick) {
|
|
57075
57075
|
onEventClick(event);
|
|
57076
57076
|
}
|
|
@@ -57078,7 +57078,7 @@ function Timeline({
|
|
|
57078
57078
|
break;
|
|
57079
57079
|
case "Delete":
|
|
57080
57080
|
if (editable && focusedEventId && onEventDelete) {
|
|
57081
|
-
const event = events.find((
|
|
57081
|
+
const event = events.find((e2) => e2.id === focusedEventId);
|
|
57082
57082
|
if (event) {
|
|
57083
57083
|
onEventDelete(event);
|
|
57084
57084
|
}
|
|
@@ -57457,8 +57457,8 @@ function Timeline({
|
|
|
57457
57457
|
variant: "ghost",
|
|
57458
57458
|
size: "sm",
|
|
57459
57459
|
className: "mt-2 h-6 text-xs",
|
|
57460
|
-
onClick: (
|
|
57461
|
-
|
|
57460
|
+
onClick: (e) => {
|
|
57461
|
+
e.stopPropagation();
|
|
57462
57462
|
setExpandedEvents((prev) => {
|
|
57463
57463
|
const newSet = new Set(prev);
|
|
57464
57464
|
if (newSet.has(event.id)) {
|
|
@@ -57672,7 +57672,7 @@ function Timeline({
|
|
|
57672
57672
|
type: "search",
|
|
57673
57673
|
placeholder: "Search events...",
|
|
57674
57674
|
value: searchQuery,
|
|
57675
|
-
onChange: (
|
|
57675
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
57676
57676
|
className: "pl-9"
|
|
57677
57677
|
}
|
|
57678
57678
|
)
|
|
@@ -58977,7 +58977,7 @@ function MetricCard({
|
|
|
58977
58977
|
variant: "ghost",
|
|
58978
58978
|
size: "sm",
|
|
58979
58979
|
className: "h-8 w-8 p-0",
|
|
58980
|
-
onClick: (
|
|
58980
|
+
onClick: (e) => e.stopPropagation(),
|
|
58981
58981
|
children: /* @__PURE__ */ jsx(MoreVertical, { className: "h-4 w-4" })
|
|
58982
58982
|
}
|
|
58983
58983
|
) }),
|
|
@@ -59475,8 +59475,8 @@ function ActivityFeed({
|
|
|
59475
59475
|
variant: "ghost",
|
|
59476
59476
|
size: "sm",
|
|
59477
59477
|
className: "h-6 w-6 p-0",
|
|
59478
|
-
onClick: (
|
|
59479
|
-
|
|
59478
|
+
onClick: (e) => {
|
|
59479
|
+
e.stopPropagation();
|
|
59480
59480
|
onAction?.("more", item);
|
|
59481
59481
|
},
|
|
59482
59482
|
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-3 w-3" })
|
|
@@ -60112,8 +60112,8 @@ function TimeRangePicker({
|
|
|
60112
60112
|
{
|
|
60113
60113
|
type: "checkbox",
|
|
60114
60114
|
checked: comparisonEnabled,
|
|
60115
|
-
onChange: (
|
|
60116
|
-
|
|
60115
|
+
onChange: (e) => setComparisonEnabled(
|
|
60116
|
+
e.target.checked
|
|
60117
60117
|
),
|
|
60118
60118
|
className: "rounded w-3 h-3"
|
|
60119
60119
|
}
|
|
@@ -60143,8 +60143,8 @@ function TimeRangePicker({
|
|
|
60143
60143
|
{
|
|
60144
60144
|
type: "checkbox",
|
|
60145
60145
|
checked: comparisonEnabled,
|
|
60146
|
-
onChange: (
|
|
60147
|
-
|
|
60146
|
+
onChange: (e) => setComparisonEnabled(
|
|
60147
|
+
e.target.checked
|
|
60148
60148
|
),
|
|
60149
60149
|
className: "rounded w-4 h-4"
|
|
60150
60150
|
}
|
|
@@ -60498,9 +60498,9 @@ function Dashboard({
|
|
|
60498
60498
|
{
|
|
60499
60499
|
placeholder: "Search widgets...",
|
|
60500
60500
|
value: searchQuery,
|
|
60501
|
-
onChange: (
|
|
60502
|
-
setSearchQuery(
|
|
60503
|
-
onSearch?.(
|
|
60501
|
+
onChange: (e) => {
|
|
60502
|
+
setSearchQuery(e.target.value);
|
|
60503
|
+
onSearch?.(e.target.value);
|
|
60504
60504
|
},
|
|
60505
60505
|
className: "pl-10"
|
|
60506
60506
|
}
|
|
@@ -60722,8 +60722,8 @@ function Dashboard({
|
|
|
60722
60722
|
variant: "ghost",
|
|
60723
60723
|
size: "sm",
|
|
60724
60724
|
className: "h-6 w-6 p-0",
|
|
60725
|
-
onClick: (
|
|
60726
|
-
|
|
60725
|
+
onClick: (e) => {
|
|
60726
|
+
e.stopPropagation();
|
|
60727
60727
|
onNotificationClear?.(notification.id);
|
|
60728
60728
|
},
|
|
60729
60729
|
children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
|
|
@@ -61259,7 +61259,7 @@ var AdvancedFormsInternal = ({
|
|
|
61259
61259
|
type: "file",
|
|
61260
61260
|
multiple: true,
|
|
61261
61261
|
className: "hidden",
|
|
61262
|
-
onChange: (
|
|
61262
|
+
onChange: (e) => handleFileUpload(field.name, e.target.files)
|
|
61263
61263
|
}
|
|
61264
61264
|
)
|
|
61265
61265
|
]
|
|
@@ -61688,15 +61688,23 @@ function useGitHubData({
|
|
|
61688
61688
|
const previousStarsRef = useRef(/* @__PURE__ */ new Map());
|
|
61689
61689
|
const errorCountRef = useRef(0);
|
|
61690
61690
|
const maxErrorCount = 2;
|
|
61691
|
+
const milestonesRef = useRef(milestones);
|
|
61692
|
+
const onMilestoneReachedRef = useRef(onMilestoneReached);
|
|
61693
|
+
useEffect(() => {
|
|
61694
|
+
milestonesRef.current = milestones;
|
|
61695
|
+
}, [milestones]);
|
|
61696
|
+
useEffect(() => {
|
|
61697
|
+
onMilestoneReachedRef.current = onMilestoneReached;
|
|
61698
|
+
}, [onMilestoneReached]);
|
|
61691
61699
|
const checkMilestones = useCallback((repos2) => {
|
|
61692
|
-
if (!
|
|
61700
|
+
if (!onMilestoneReachedRef.current)
|
|
61693
61701
|
return;
|
|
61694
61702
|
repos2.forEach((repo) => {
|
|
61695
61703
|
const previousStars = previousStarsRef.current.get(repo.full_name) || 0;
|
|
61696
61704
|
const currentStars = repo.stargazers_count;
|
|
61697
|
-
|
|
61705
|
+
milestonesRef.current.forEach((milestone) => {
|
|
61698
61706
|
if (previousStars < milestone && currentStars >= milestone) {
|
|
61699
|
-
|
|
61707
|
+
onMilestoneReachedRef.current?.({
|
|
61700
61708
|
count: milestone,
|
|
61701
61709
|
reached: true,
|
|
61702
61710
|
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -61706,7 +61714,7 @@ function useGitHubData({
|
|
|
61706
61714
|
});
|
|
61707
61715
|
previousStarsRef.current.set(repo.full_name, currentStars);
|
|
61708
61716
|
});
|
|
61709
|
-
}, [
|
|
61717
|
+
}, []);
|
|
61710
61718
|
const fetchData = useCallback(async () => {
|
|
61711
61719
|
if (errorCountRef.current >= maxErrorCount) {
|
|
61712
61720
|
console.warn("Maximum error count reached. Stopping requests.");
|
|
@@ -61818,11 +61826,13 @@ function useGitHubData({
|
|
|
61818
61826
|
}, [
|
|
61819
61827
|
username,
|
|
61820
61828
|
repository,
|
|
61821
|
-
repositories,
|
|
61829
|
+
repositories?.join(","),
|
|
61830
|
+
// Array'i string'e çevir ki referans değişmesin
|
|
61822
61831
|
token,
|
|
61823
61832
|
sortBy,
|
|
61824
61833
|
maxItems,
|
|
61825
61834
|
checkMilestones,
|
|
61835
|
+
// Artık stable
|
|
61826
61836
|
onDataUpdate,
|
|
61827
61837
|
onError
|
|
61828
61838
|
]);
|
|
@@ -61901,27 +61911,48 @@ var MinimalVariant = ({ repos, stats, className }) => {
|
|
|
61901
61911
|
if (!stats)
|
|
61902
61912
|
return null;
|
|
61903
61913
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-4 text-sm", className), children: [
|
|
61904
|
-
/* @__PURE__ */ jsxs(
|
|
61905
|
-
|
|
61906
|
-
|
|
61907
|
-
|
|
61908
|
-
|
|
61909
|
-
|
|
61910
|
-
|
|
61911
|
-
|
|
61912
|
-
|
|
61913
|
-
|
|
61914
|
-
|
|
61915
|
-
|
|
61916
|
-
|
|
61917
|
-
|
|
61918
|
-
/* @__PURE__ */ jsxs(
|
|
61919
|
-
|
|
61920
|
-
|
|
61921
|
-
|
|
61922
|
-
|
|
61923
|
-
|
|
61924
|
-
|
|
61914
|
+
/* @__PURE__ */ jsxs(
|
|
61915
|
+
"button",
|
|
61916
|
+
{
|
|
61917
|
+
className: "flex items-center gap-2 hover:text-primary transition-colors",
|
|
61918
|
+
onClick: () => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}`, "_blank"),
|
|
61919
|
+
children: [
|
|
61920
|
+
/* @__PURE__ */ jsx(Github, { className: "h-4 w-4" }),
|
|
61921
|
+
/* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
|
|
61922
|
+
repos.length,
|
|
61923
|
+
" repositories"
|
|
61924
|
+
] })
|
|
61925
|
+
]
|
|
61926
|
+
}
|
|
61927
|
+
),
|
|
61928
|
+
/* @__PURE__ */ jsxs(
|
|
61929
|
+
"button",
|
|
61930
|
+
{
|
|
61931
|
+
className: "flex items-center gap-2 hover:text-yellow-600 transition-colors",
|
|
61932
|
+
onClick: () => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=stargazers`, "_blank"),
|
|
61933
|
+
children: [
|
|
61934
|
+
/* @__PURE__ */ jsx(Star, { className: "h-4 w-4 text-yellow-500" }),
|
|
61935
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
61936
|
+
formatNumber(stats.totalStars),
|
|
61937
|
+
" stars"
|
|
61938
|
+
] })
|
|
61939
|
+
]
|
|
61940
|
+
}
|
|
61941
|
+
),
|
|
61942
|
+
/* @__PURE__ */ jsxs(
|
|
61943
|
+
"button",
|
|
61944
|
+
{
|
|
61945
|
+
className: "flex items-center gap-2 hover:text-blue-600 transition-colors",
|
|
61946
|
+
onClick: () => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=fork&language=&sort=`, "_blank"),
|
|
61947
|
+
children: [
|
|
61948
|
+
/* @__PURE__ */ jsx(GitFork, { className: "h-4 w-4 text-blue-500" }),
|
|
61949
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
61950
|
+
formatNumber(stats.totalForks),
|
|
61951
|
+
" forks"
|
|
61952
|
+
] })
|
|
61953
|
+
]
|
|
61954
|
+
}
|
|
61955
|
+
)
|
|
61925
61956
|
] });
|
|
61926
61957
|
};
|
|
61927
61958
|
var CompactVariant = ({
|
|
@@ -61943,21 +61974,35 @@ var CompactVariant = ({
|
|
|
61943
61974
|
] })
|
|
61944
61975
|
] }),
|
|
61945
61976
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-sm", children: [
|
|
61946
|
-
/* @__PURE__ */ jsxs(
|
|
61947
|
-
|
|
61948
|
-
|
|
61949
|
-
|
|
61950
|
-
|
|
61951
|
-
|
|
61952
|
-
|
|
61953
|
-
|
|
61977
|
+
/* @__PURE__ */ jsxs(
|
|
61978
|
+
"button",
|
|
61979
|
+
{
|
|
61980
|
+
className: "flex items-center gap-1 hover:text-yellow-600 transition-colors cursor-pointer",
|
|
61981
|
+
onClick: () => window.open(`https://github.com/${repos[0]?.owner?.login}/${repos[0]?.name}/stargazers`, "_blank"),
|
|
61982
|
+
children: [
|
|
61983
|
+
/* @__PURE__ */ jsx(Star, { className: "h-4 w-4 text-yellow-500" }),
|
|
61984
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(stats.totalStars) })
|
|
61985
|
+
]
|
|
61986
|
+
}
|
|
61987
|
+
),
|
|
61988
|
+
/* @__PURE__ */ jsxs(
|
|
61989
|
+
"button",
|
|
61990
|
+
{
|
|
61991
|
+
className: "flex items-center gap-1 hover:text-blue-600 transition-colors cursor-pointer",
|
|
61992
|
+
onClick: () => window.open(`https://github.com/${repos[0]?.owner?.login}/${repos[0]?.name}/forks`, "_blank"),
|
|
61993
|
+
children: [
|
|
61994
|
+
/* @__PURE__ */ jsx(GitFork, { className: "h-4 w-4 text-blue-500" }),
|
|
61995
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(stats.totalForks) })
|
|
61996
|
+
]
|
|
61997
|
+
}
|
|
61998
|
+
)
|
|
61954
61999
|
] })
|
|
61955
62000
|
] }),
|
|
61956
62001
|
/* @__PURE__ */ jsx("div", { className: "space-y-2", children: topRepos.map((repo) => /* @__PURE__ */ jsxs(
|
|
61957
62002
|
"div",
|
|
61958
62003
|
{
|
|
61959
62004
|
className: "flex items-center justify-between p-2 rounded-md hover:bg-accent cursor-pointer transition-colors",
|
|
61960
|
-
onClick: () =>
|
|
62005
|
+
onClick: () => window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank"),
|
|
61961
62006
|
children: [
|
|
61962
62007
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
61963
62008
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: repo.name }),
|
|
@@ -61999,12 +62044,15 @@ var CardVariant = ({
|
|
|
61999
62044
|
children: /* @__PURE__ */ jsx(
|
|
62000
62045
|
MoonUICardPro,
|
|
62001
62046
|
{
|
|
62002
|
-
className: "h-full hover:shadow-lg transition-shadow cursor-pointer",
|
|
62003
|
-
onClick: () =>
|
|
62047
|
+
className: "h-full hover:shadow-lg transition-shadow cursor-pointer group",
|
|
62048
|
+
onClick: () => window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank"),
|
|
62004
62049
|
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
62005
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
62006
|
-
/* @__PURE__ */
|
|
62007
|
-
|
|
62050
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
62051
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
62052
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-lg mb-1", children: repo.name }),
|
|
62053
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground line-clamp-2", children: repo.description || "No description available" })
|
|
62054
|
+
] }),
|
|
62055
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
|
|
62008
62056
|
] }),
|
|
62009
62057
|
repo.topics.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1", children: repo.topics.slice(0, 3).map((topic) => /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: topic }, topic)) }),
|
|
62010
62058
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
@@ -62019,14 +62067,34 @@ var CardVariant = ({
|
|
|
62019
62067
|
/* @__PURE__ */ jsx("span", { children: repo.language })
|
|
62020
62068
|
] }) }),
|
|
62021
62069
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
62022
|
-
/* @__PURE__ */ jsxs(
|
|
62023
|
-
|
|
62024
|
-
|
|
62025
|
-
|
|
62026
|
-
|
|
62027
|
-
|
|
62028
|
-
|
|
62029
|
-
|
|
62070
|
+
/* @__PURE__ */ jsxs(
|
|
62071
|
+
"button",
|
|
62072
|
+
{
|
|
62073
|
+
className: "flex items-center gap-1 hover:text-yellow-600 transition-colors",
|
|
62074
|
+
onClick: (e) => {
|
|
62075
|
+
e.stopPropagation();
|
|
62076
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/stargazers`, "_blank");
|
|
62077
|
+
},
|
|
62078
|
+
children: [
|
|
62079
|
+
/* @__PURE__ */ jsx(Star, { className: "h-4 w-4 text-yellow-500" }),
|
|
62080
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(repo.stargazers_count) })
|
|
62081
|
+
]
|
|
62082
|
+
}
|
|
62083
|
+
),
|
|
62084
|
+
/* @__PURE__ */ jsxs(
|
|
62085
|
+
"button",
|
|
62086
|
+
{
|
|
62087
|
+
className: "flex items-center gap-1 hover:text-blue-600 transition-colors",
|
|
62088
|
+
onClick: (e) => {
|
|
62089
|
+
e.stopPropagation();
|
|
62090
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/forks`, "_blank");
|
|
62091
|
+
},
|
|
62092
|
+
children: [
|
|
62093
|
+
/* @__PURE__ */ jsx(GitFork, { className: "h-4 w-4 text-blue-500" }),
|
|
62094
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(repo.forks_count) })
|
|
62095
|
+
]
|
|
62096
|
+
}
|
|
62097
|
+
)
|
|
62030
62098
|
] })
|
|
62031
62099
|
] })
|
|
62032
62100
|
] }) })
|
|
@@ -62046,24 +62114,38 @@ var DetailedVariant = ({
|
|
|
62046
62114
|
if (!stats)
|
|
62047
62115
|
return null;
|
|
62048
62116
|
return /* @__PURE__ */ jsxs(MoonUICardPro, { className: cn("w-full", className), children: [
|
|
62049
|
-
/* @__PURE__ */ jsx(MoonUICardHeaderPro, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
62117
|
+
/* @__PURE__ */ jsx(MoonUICardHeaderPro, { className: "pb-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
62050
62118
|
/* @__PURE__ */ jsxs(MoonUICardTitlePro, { className: "flex items-center gap-2", children: [
|
|
62051
62119
|
/* @__PURE__ */ jsx(Github, { className: "h-6 w-6" }),
|
|
62052
62120
|
"GitHub Repository Analytics"
|
|
62053
62121
|
] }),
|
|
62054
|
-
|
|
62055
|
-
/* @__PURE__ */
|
|
62056
|
-
|
|
62122
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
62123
|
+
repos[0] && /* @__PURE__ */ jsxs(
|
|
62124
|
+
MoonUIButtonPro,
|
|
62125
|
+
{
|
|
62126
|
+
onClick: () => window.open(`https://github.com/${repos[0].owner?.login}`, "_blank"),
|
|
62127
|
+
variant: "outline",
|
|
62128
|
+
size: "sm",
|
|
62129
|
+
children: [
|
|
62130
|
+
/* @__PURE__ */ jsx(Github, { className: "h-4 w-4 mr-2" }),
|
|
62131
|
+
"View Profile"
|
|
62132
|
+
]
|
|
62133
|
+
}
|
|
62134
|
+
),
|
|
62135
|
+
onExport && /* @__PURE__ */ jsxs(MoonUIButtonPro, { onClick: onExport, variant: "outline", size: "sm", children: [
|
|
62136
|
+
/* @__PURE__ */ jsx(Download, { className: "h-4 w-4 mr-2" }),
|
|
62137
|
+
"Export"
|
|
62138
|
+
] })
|
|
62057
62139
|
] })
|
|
62058
62140
|
] }) }),
|
|
62059
|
-
/* @__PURE__ */ jsx(MoonUICardContentPro, { children: /* @__PURE__ */ jsxs(MoonUITabsPro, { defaultValue: "overview", className: "w-full", children: [
|
|
62060
|
-
/* @__PURE__ */ jsxs(MoonUITabsListPro, { className: "grid w-full grid-cols-4", children: [
|
|
62141
|
+
/* @__PURE__ */ jsx(MoonUICardContentPro, { className: "pt-0", children: /* @__PURE__ */ jsxs(MoonUITabsPro, { defaultValue: "overview", className: "w-full mt-4", children: [
|
|
62142
|
+
/* @__PURE__ */ jsxs(MoonUITabsListPro, { className: "grid w-full grid-cols-4 mb-6", children: [
|
|
62061
62143
|
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "overview", children: "Overview" }),
|
|
62062
62144
|
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "repositories", children: "Repositories" }),
|
|
62063
62145
|
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "languages", children: "Languages" }),
|
|
62064
62146
|
/* @__PURE__ */ jsx(MoonUITabsTriggerPro, { value: "activity", children: "Activity" })
|
|
62065
62147
|
] }),
|
|
62066
|
-
/* @__PURE__ */ jsxs(MoonUITabsContentPro, { value: "overview", className: "space-y-
|
|
62148
|
+
/* @__PURE__ */ jsxs(MoonUITabsContentPro, { value: "overview", className: "space-y-6 mt-6", children: [
|
|
62067
62149
|
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [
|
|
62068
62150
|
/* @__PURE__ */ jsx(
|
|
62069
62151
|
StatCard,
|
|
@@ -62078,7 +62160,8 @@ var DetailedVariant = ({
|
|
|
62078
62160
|
{
|
|
62079
62161
|
icon: /* @__PURE__ */ jsx(Star, { className: "h-4 w-4 text-yellow-500" }),
|
|
62080
62162
|
label: "Total Stars",
|
|
62081
|
-
value: formatNumber(stats.totalStars)
|
|
62163
|
+
value: formatNumber(stats.totalStars),
|
|
62164
|
+
onClick: () => repos[0] && window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=stargazers`, "_blank")
|
|
62082
62165
|
}
|
|
62083
62166
|
),
|
|
62084
62167
|
/* @__PURE__ */ jsx(
|
|
@@ -62098,27 +62181,40 @@ var DetailedVariant = ({
|
|
|
62098
62181
|
}
|
|
62099
62182
|
)
|
|
62100
62183
|
] }),
|
|
62101
|
-
stats.mostStarredRepo && /* @__PURE__ */ jsx(
|
|
62102
|
-
|
|
62103
|
-
|
|
62104
|
-
|
|
62105
|
-
|
|
62106
|
-
|
|
62107
|
-
"
|
|
62108
|
-
|
|
62109
|
-
|
|
62110
|
-
|
|
62111
|
-
|
|
62184
|
+
stats.mostStarredRepo && /* @__PURE__ */ jsx(
|
|
62185
|
+
MoonUICardPro,
|
|
62186
|
+
{
|
|
62187
|
+
className: "hover:shadow-md transition-shadow cursor-pointer",
|
|
62188
|
+
onClick: () => window.open(`https://github.com/${stats.mostStarredRepo.owner?.login}/${stats.mostStarredRepo.name}`, "_blank"),
|
|
62189
|
+
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
62190
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
62191
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-2", children: "Most Starred Repository" }),
|
|
62192
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-lg mb-1", children: stats.mostStarredRepo.name }),
|
|
62193
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
62194
|
+
formatNumber(stats.mostStarredRepo.stargazers_count),
|
|
62195
|
+
" stars"
|
|
62196
|
+
] })
|
|
62197
|
+
] }),
|
|
62198
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
62199
|
+
/* @__PURE__ */ jsx(TrendingUp, { className: "h-8 w-8 text-muted-foreground" }),
|
|
62200
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-4 w-4 text-muted-foreground" })
|
|
62201
|
+
] })
|
|
62202
|
+
] }) })
|
|
62203
|
+
}
|
|
62204
|
+
)
|
|
62112
62205
|
] }),
|
|
62113
|
-
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "repositories", className: "space-y-4", children: /* @__PURE__ */ jsx("div", { className: "space-y-
|
|
62206
|
+
/* @__PURE__ */ jsx(MoonUITabsContentPro, { value: "repositories", className: "space-y-4 mt-6", children: /* @__PURE__ */ jsx("div", { className: "space-y-3", children: repos.map((repo) => /* @__PURE__ */ jsx(
|
|
62114
62207
|
MoonUICardPro,
|
|
62115
62208
|
{
|
|
62116
|
-
className: "hover:shadow-md transition-shadow cursor-pointer",
|
|
62117
|
-
onClick: () =>
|
|
62118
|
-
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-
|
|
62209
|
+
className: "hover:shadow-md transition-shadow cursor-pointer group",
|
|
62210
|
+
onClick: () => window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank"),
|
|
62211
|
+
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
62119
62212
|
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
62120
|
-
/* @__PURE__ */
|
|
62121
|
-
|
|
62213
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
62214
|
+
/* @__PURE__ */ jsx("h4", { className: "font-semibold text-base", children: repo.name }),
|
|
62215
|
+
repo.private && /* @__PURE__ */ jsx(MoonUIBadgePro, { variant: "secondary", className: "text-xs", children: "Private" })
|
|
62216
|
+
] }),
|
|
62217
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-3", children: repo.description || "No description" }),
|
|
62122
62218
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-sm", children: [
|
|
62123
62219
|
repo.language && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
62124
62220
|
/* @__PURE__ */ jsx(
|
|
@@ -62132,67 +62228,166 @@ var DetailedVariant = ({
|
|
|
62132
62228
|
),
|
|
62133
62229
|
/* @__PURE__ */ jsx("span", { children: repo.language })
|
|
62134
62230
|
] }),
|
|
62135
|
-
/* @__PURE__ */ jsxs(
|
|
62136
|
-
|
|
62137
|
-
|
|
62138
|
-
|
|
62139
|
-
|
|
62140
|
-
|
|
62141
|
-
|
|
62142
|
-
|
|
62231
|
+
/* @__PURE__ */ jsxs(
|
|
62232
|
+
"button",
|
|
62233
|
+
{
|
|
62234
|
+
className: "flex items-center gap-1 hover:text-yellow-600 transition-colors",
|
|
62235
|
+
onClick: (e) => {
|
|
62236
|
+
e.stopPropagation();
|
|
62237
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/stargazers`, "_blank");
|
|
62238
|
+
},
|
|
62239
|
+
children: [
|
|
62240
|
+
/* @__PURE__ */ jsx(Star, { className: "h-3 w-3" }),
|
|
62241
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(repo.stargazers_count) })
|
|
62242
|
+
]
|
|
62243
|
+
}
|
|
62244
|
+
),
|
|
62245
|
+
/* @__PURE__ */ jsxs(
|
|
62246
|
+
"button",
|
|
62247
|
+
{
|
|
62248
|
+
className: "flex items-center gap-1 hover:text-blue-600 transition-colors",
|
|
62249
|
+
onClick: (e) => {
|
|
62250
|
+
e.stopPropagation();
|
|
62251
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/forks`, "_blank");
|
|
62252
|
+
},
|
|
62253
|
+
children: [
|
|
62254
|
+
/* @__PURE__ */ jsx(GitFork, { className: "h-3 w-3" }),
|
|
62255
|
+
/* @__PURE__ */ jsx("span", { children: formatNumber(repo.forks_count) })
|
|
62256
|
+
]
|
|
62257
|
+
}
|
|
62258
|
+
),
|
|
62259
|
+
/* @__PURE__ */ jsxs(
|
|
62260
|
+
"button",
|
|
62261
|
+
{
|
|
62262
|
+
className: "flex items-center gap-1 hover:text-purple-600 transition-colors",
|
|
62263
|
+
onClick: (e) => {
|
|
62264
|
+
e.stopPropagation();
|
|
62265
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}/issues`, "_blank");
|
|
62266
|
+
},
|
|
62267
|
+
children: [
|
|
62268
|
+
/* @__PURE__ */ jsx(Users, { className: "h-3 w-3" }),
|
|
62269
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
62270
|
+
repo.open_issues_count,
|
|
62271
|
+
" issues"
|
|
62272
|
+
] })
|
|
62273
|
+
]
|
|
62274
|
+
}
|
|
62275
|
+
),
|
|
62143
62276
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
62144
62277
|
/* @__PURE__ */ jsx(Calendar$1, { className: "h-3 w-3" }),
|
|
62145
62278
|
/* @__PURE__ */ jsx("span", { children: formatDate2(repo.updated_at) })
|
|
62146
62279
|
] })
|
|
62147
62280
|
] })
|
|
62148
62281
|
] }),
|
|
62149
|
-
/* @__PURE__ */ jsx(
|
|
62282
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(
|
|
62283
|
+
MoonUIButtonPro,
|
|
62284
|
+
{
|
|
62285
|
+
size: "sm",
|
|
62286
|
+
variant: "ghost",
|
|
62287
|
+
className: "opacity-0 group-hover:opacity-100 transition-opacity",
|
|
62288
|
+
onClick: (e) => {
|
|
62289
|
+
e.stopPropagation();
|
|
62290
|
+
window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank");
|
|
62291
|
+
},
|
|
62292
|
+
children: /* @__PURE__ */ jsx(ExternalLink, { className: "h-4 w-4" })
|
|
62293
|
+
}
|
|
62294
|
+
) })
|
|
62150
62295
|
] }) })
|
|
62151
62296
|
},
|
|
62152
62297
|
repo.id
|
|
62153
62298
|
)) }) }),
|
|
62154
|
-
/* @__PURE__ */
|
|
62155
|
-
/* @__PURE__ */
|
|
62156
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center
|
|
62157
|
-
/* @__PURE__ */
|
|
62158
|
-
|
|
62159
|
-
|
|
62160
|
-
|
|
62161
|
-
|
|
62162
|
-
|
|
62163
|
-
|
|
62164
|
-
|
|
62299
|
+
/* @__PURE__ */ jsxs(MoonUITabsContentPro, { value: "languages", className: "space-y-6 mt-6", children: [
|
|
62300
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-4", children: stats.languages.map((lang) => /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
62301
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
62302
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
62303
|
+
/* @__PURE__ */ jsx(
|
|
62304
|
+
"div",
|
|
62305
|
+
{
|
|
62306
|
+
className: "w-3 h-3 rounded-full shadow-sm",
|
|
62307
|
+
style: { backgroundColor: lang.color }
|
|
62308
|
+
}
|
|
62309
|
+
),
|
|
62310
|
+
/* @__PURE__ */ jsx("span", { className: "font-medium", children: lang.language })
|
|
62311
|
+
] }),
|
|
62312
|
+
/* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
62313
|
+
lang.count,
|
|
62314
|
+
" repos (",
|
|
62315
|
+
lang.percentage.toFixed(1),
|
|
62316
|
+
"%)"
|
|
62317
|
+
] })
|
|
62165
62318
|
] }),
|
|
62166
|
-
/* @__PURE__ */
|
|
62167
|
-
|
|
62168
|
-
|
|
62169
|
-
|
|
62170
|
-
|
|
62171
|
-
|
|
62172
|
-
|
|
62173
|
-
|
|
62174
|
-
|
|
62175
|
-
|
|
62176
|
-
|
|
62177
|
-
|
|
62178
|
-
|
|
62179
|
-
|
|
62180
|
-
|
|
62181
|
-
|
|
62182
|
-
|
|
62183
|
-
|
|
62184
|
-
|
|
62185
|
-
|
|
62319
|
+
/* @__PURE__ */ jsx("div", { className: "px-1", children: /* @__PURE__ */ jsx(MoonUIProgressPro, { value: lang.percentage, className: "h-2" }) })
|
|
62320
|
+
] }, lang.language)) }),
|
|
62321
|
+
repos[0] && /* @__PURE__ */ jsx("div", { className: "pt-4 border-t", children: /* @__PURE__ */ jsxs(
|
|
62322
|
+
MoonUIButtonPro,
|
|
62323
|
+
{
|
|
62324
|
+
variant: "outline",
|
|
62325
|
+
className: "w-full",
|
|
62326
|
+
onClick: () => window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=`, "_blank"),
|
|
62327
|
+
children: [
|
|
62328
|
+
/* @__PURE__ */ jsx(BarChart3, { className: "h-4 w-4 mr-2" }),
|
|
62329
|
+
"View Language Statistics on GitHub"
|
|
62330
|
+
]
|
|
62331
|
+
}
|
|
62332
|
+
) })
|
|
62333
|
+
] }),
|
|
62334
|
+
/* @__PURE__ */ jsxs(MoonUITabsContentPro, { value: "activity", className: "space-y-4 mt-6", children: [
|
|
62335
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-3", children: stats.recentActivity.map((activity, index2) => {
|
|
62336
|
+
const repo = repos.find((r2) => r2.name === activity.repository);
|
|
62337
|
+
return /* @__PURE__ */ jsxs(
|
|
62338
|
+
"div",
|
|
62339
|
+
{
|
|
62340
|
+
className: "flex items-center gap-4 p-4 rounded-lg bg-accent/30 hover:bg-accent/50 transition-colors cursor-pointer",
|
|
62341
|
+
onClick: () => repo && window.open(`https://github.com/${repo.owner?.login}/${repo.name}`, "_blank"),
|
|
62342
|
+
children: [
|
|
62343
|
+
/* @__PURE__ */ jsx(Activity, { className: "h-4 w-4 text-muted-foreground flex-shrink-0" }),
|
|
62344
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
62345
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: activity.description }),
|
|
62346
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
|
|
62347
|
+
activity.repository,
|
|
62348
|
+
" \u2022 ",
|
|
62349
|
+
formatDate2(activity.timestamp)
|
|
62350
|
+
] })
|
|
62351
|
+
] }),
|
|
62352
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3 text-muted-foreground flex-shrink-0" })
|
|
62353
|
+
]
|
|
62354
|
+
},
|
|
62355
|
+
index2
|
|
62356
|
+
);
|
|
62357
|
+
}) }),
|
|
62358
|
+
repos[0] && /* @__PURE__ */ jsx("div", { className: "pt-4 border-t", children: /* @__PURE__ */ jsxs(
|
|
62359
|
+
MoonUIButtonPro,
|
|
62360
|
+
{
|
|
62361
|
+
variant: "outline",
|
|
62362
|
+
className: "w-full",
|
|
62363
|
+
onClick: () => window.open(`https://github.com/${repos[0].owner?.login}?tab=repositories&q=&type=&language=&sort=updated`, "_blank"),
|
|
62364
|
+
children: [
|
|
62365
|
+
/* @__PURE__ */ jsx(Activity, { className: "h-4 w-4 mr-2" }),
|
|
62366
|
+
"View All Activity on GitHub"
|
|
62367
|
+
]
|
|
62368
|
+
}
|
|
62369
|
+
) })
|
|
62370
|
+
] })
|
|
62186
62371
|
] }) })
|
|
62187
62372
|
] });
|
|
62188
62373
|
};
|
|
62189
|
-
var StatCard = ({ icon, label, value }) => /* @__PURE__ */ jsx(
|
|
62190
|
-
|
|
62191
|
-
|
|
62192
|
-
|
|
62193
|
-
|
|
62194
|
-
|
|
62195
|
-
|
|
62374
|
+
var StatCard = ({ icon, label, value, onClick }) => /* @__PURE__ */ jsx(
|
|
62375
|
+
MoonUICardPro,
|
|
62376
|
+
{
|
|
62377
|
+
className: cn(
|
|
62378
|
+
"transition-all",
|
|
62379
|
+
onClick && "hover:shadow-md cursor-pointer hover:scale-105"
|
|
62380
|
+
),
|
|
62381
|
+
onClick,
|
|
62382
|
+
children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-5", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
62383
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
62384
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-1", children: label }),
|
|
62385
|
+
/* @__PURE__ */ jsx("p", { className: "text-2xl font-bold", children: value })
|
|
62386
|
+
] }),
|
|
62387
|
+
/* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: icon })
|
|
62388
|
+
] }) })
|
|
62389
|
+
}
|
|
62390
|
+
);
|
|
62196
62391
|
var GitHubStarsInternal = ({
|
|
62197
62392
|
username = "",
|
|
62198
62393
|
repository,
|
|
@@ -62235,6 +62430,20 @@ var GitHubStarsInternal = ({
|
|
|
62235
62430
|
customColors
|
|
62236
62431
|
}) => {
|
|
62237
62432
|
const { notify } = useGitHubNotifications(enableNotifications);
|
|
62433
|
+
const handleMilestoneReached = t__default.useCallback((milestone) => {
|
|
62434
|
+
if (celebrateAt?.includes(milestone.count)) {
|
|
62435
|
+
confetti({
|
|
62436
|
+
particleCount: 100,
|
|
62437
|
+
spread: 70,
|
|
62438
|
+
origin: { y: 0.6 }
|
|
62439
|
+
});
|
|
62440
|
+
notify(`\u{1F389} Milestone Reached!`, {
|
|
62441
|
+
body: `${milestone.count} stars achieved!`,
|
|
62442
|
+
tag: `milestone-${milestone.count}`
|
|
62443
|
+
});
|
|
62444
|
+
}
|
|
62445
|
+
onMilestoneReached?.(milestone);
|
|
62446
|
+
}, [celebrateAt, notify, onMilestoneReached]);
|
|
62238
62447
|
const {
|
|
62239
62448
|
repos,
|
|
62240
62449
|
stats,
|
|
@@ -62254,23 +62463,10 @@ var GitHubStarsInternal = ({
|
|
|
62254
62463
|
maxItems,
|
|
62255
62464
|
onError,
|
|
62256
62465
|
onDataUpdate,
|
|
62257
|
-
onMilestoneReached:
|
|
62258
|
-
if (celebrateAt?.includes(milestone.count)) {
|
|
62259
|
-
confetti({
|
|
62260
|
-
particleCount: 100,
|
|
62261
|
-
spread: 70,
|
|
62262
|
-
origin: { y: 0.6 }
|
|
62263
|
-
});
|
|
62264
|
-
notify(`\u{1F389} Milestone Reached!`, {
|
|
62265
|
-
body: `${milestone.count} stars achieved!`,
|
|
62266
|
-
tag: `milestone-${milestone.count}`
|
|
62267
|
-
});
|
|
62268
|
-
}
|
|
62269
|
-
onMilestoneReached?.(milestone);
|
|
62270
|
-
},
|
|
62466
|
+
onMilestoneReached: handleMilestoneReached,
|
|
62271
62467
|
milestones
|
|
62272
62468
|
});
|
|
62273
|
-
const handleExport = (format7) => {
|
|
62469
|
+
const handleExport = t__default.useCallback((format7) => {
|
|
62274
62470
|
if (!enableExport)
|
|
62275
62471
|
return;
|
|
62276
62472
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
@@ -62282,7 +62478,38 @@ var GitHubStarsInternal = ({
|
|
|
62282
62478
|
} else {
|
|
62283
62479
|
exportAsCSV(repos, `github-stars-${username}-${timestamp}.csv`);
|
|
62284
62480
|
}
|
|
62285
|
-
};
|
|
62481
|
+
}, [enableExport, repos, stats, username]);
|
|
62482
|
+
const handleDetailedExport = t__default.useCallback((e) => {
|
|
62483
|
+
if (!enableExport)
|
|
62484
|
+
return;
|
|
62485
|
+
const dropdown = document.createElement("div");
|
|
62486
|
+
dropdown.className = "absolute z-50 mt-2 w-48 rounded-md shadow-lg bg-popover border";
|
|
62487
|
+
dropdown.innerHTML = `
|
|
62488
|
+
<div class="py-1">
|
|
62489
|
+
<button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="json">
|
|
62490
|
+
Export as JSON
|
|
62491
|
+
</button>
|
|
62492
|
+
<button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="csv">
|
|
62493
|
+
Export as CSV
|
|
62494
|
+
</button>
|
|
62495
|
+
</div>
|
|
62496
|
+
`;
|
|
62497
|
+
dropdown.addEventListener("click", (e2) => {
|
|
62498
|
+
const target = e2.target;
|
|
62499
|
+
const format7 = target.getAttribute("data-format");
|
|
62500
|
+
if (format7 === "json" || format7 === "csv") {
|
|
62501
|
+
handleExport(format7);
|
|
62502
|
+
dropdown.remove();
|
|
62503
|
+
}
|
|
62504
|
+
});
|
|
62505
|
+
document.body.appendChild(dropdown);
|
|
62506
|
+
const rect = e.target.getBoundingClientRect();
|
|
62507
|
+
dropdown.style.top = `${rect.bottom + window.scrollY}px`;
|
|
62508
|
+
dropdown.style.left = `${rect.left + window.scrollX}px`;
|
|
62509
|
+
setTimeout(() => {
|
|
62510
|
+
document.addEventListener("click", () => dropdown.remove(), { once: true });
|
|
62511
|
+
}, 0);
|
|
62512
|
+
}, [enableExport, handleExport]);
|
|
62286
62513
|
if (loading) {
|
|
62287
62514
|
return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
62288
62515
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -62338,35 +62565,7 @@ var GitHubStarsInternal = ({
|
|
|
62338
62565
|
DetailedVariant,
|
|
62339
62566
|
{
|
|
62340
62567
|
...baseProps,
|
|
62341
|
-
onExport:
|
|
62342
|
-
const dropdown = document.createElement("div");
|
|
62343
|
-
dropdown.className = "absolute z-50 mt-2 w-48 rounded-md shadow-lg bg-popover border";
|
|
62344
|
-
dropdown.innerHTML = `
|
|
62345
|
-
<div class="py-1">
|
|
62346
|
-
<button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="json">
|
|
62347
|
-
Export as JSON
|
|
62348
|
-
</button>
|
|
62349
|
-
<button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="csv">
|
|
62350
|
-
Export as CSV
|
|
62351
|
-
</button>
|
|
62352
|
-
</div>
|
|
62353
|
-
`;
|
|
62354
|
-
dropdown.addEventListener("click", (e2) => {
|
|
62355
|
-
const target = e2.target;
|
|
62356
|
-
const format7 = target.getAttribute("data-format");
|
|
62357
|
-
if (format7 === "json" || format7 === "csv") {
|
|
62358
|
-
handleExport(format7);
|
|
62359
|
-
dropdown.remove();
|
|
62360
|
-
}
|
|
62361
|
-
});
|
|
62362
|
-
document.body.appendChild(dropdown);
|
|
62363
|
-
const rect = e.target.getBoundingClientRect();
|
|
62364
|
-
dropdown.style.top = `${rect.bottom + window.scrollY}px`;
|
|
62365
|
-
dropdown.style.left = `${rect.left + window.scrollX}px`;
|
|
62366
|
-
setTimeout(() => {
|
|
62367
|
-
document.addEventListener("click", () => dropdown.remove(), { once: true });
|
|
62368
|
-
}, 0);
|
|
62369
|
-
}
|
|
62568
|
+
onExport: handleDetailedExport
|
|
62370
62569
|
}
|
|
62371
62570
|
);
|
|
62372
62571
|
case "card":
|
|
@@ -62534,9 +62733,9 @@ var HealthCheckInternal = ({
|
|
|
62534
62733
|
const getOverallStatus = () => {
|
|
62535
62734
|
if (results.length === 0)
|
|
62536
62735
|
return "warning";
|
|
62537
|
-
const criticalEndpoints = endpoints.filter((
|
|
62736
|
+
const criticalEndpoints = endpoints.filter((e) => e.critical !== false);
|
|
62538
62737
|
const criticalResults = results.filter(
|
|
62539
|
-
(r2) => criticalEndpoints.some((
|
|
62738
|
+
(r2) => criticalEndpoints.some((e) => e.id === r2.id)
|
|
62540
62739
|
);
|
|
62541
62740
|
const hasUnhealthy = criticalResults.some((r2) => r2.status === "unhealthy");
|
|
62542
62741
|
const hasWarning = results.some((r2) => r2.status === "warning");
|
|
@@ -63200,9 +63399,9 @@ function LazyList({
|
|
|
63200
63399
|
setVisibleItems(items.slice(0, batchSize));
|
|
63201
63400
|
setCurrentBatch(1);
|
|
63202
63401
|
}, [items, batchSize]);
|
|
63203
|
-
const handleScroll = useCallback((
|
|
63402
|
+
const handleScroll = useCallback((e) => {
|
|
63204
63403
|
if (enableVirtualization && containerRef.current) {
|
|
63205
|
-
setScrollPosition(
|
|
63404
|
+
setScrollPosition(e.target.scrollTop);
|
|
63206
63405
|
}
|
|
63207
63406
|
}, [enableVirtualization]);
|
|
63208
63407
|
useEffect(() => {
|
|
@@ -63567,7 +63766,7 @@ var OptimizedImageInternal = ({
|
|
|
63567
63766
|
exit: { opacity: 0 },
|
|
63568
63767
|
className: "fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",
|
|
63569
63768
|
onClick: () => setIsPreviewOpen(false),
|
|
63570
|
-
children: /* @__PURE__ */ jsxs("div", { className: "relative max-w-full max-h-full", onClick: (
|
|
63769
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative max-w-full max-h-full", onClick: (e) => e.stopPropagation(), children: [
|
|
63571
63770
|
/* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 flex gap-2 z-10", children: [
|
|
63572
63771
|
showZoom && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
63573
63772
|
/* @__PURE__ */ jsx(
|
|
@@ -64758,8 +64957,8 @@ var generateFileHash = async (file) => {
|
|
|
64758
64957
|
var createImagePreview = (file) => {
|
|
64759
64958
|
return new Promise((resolve) => {
|
|
64760
64959
|
const reader = new FileReader();
|
|
64761
|
-
reader.onload = (
|
|
64762
|
-
const result =
|
|
64960
|
+
reader.onload = (e) => {
|
|
64961
|
+
const result = e.target?.result;
|
|
64763
64962
|
const img = new Image();
|
|
64764
64963
|
img.onload = () => {
|
|
64765
64964
|
const canvas = document.createElement("canvas");
|
|
@@ -65064,8 +65263,8 @@ var MoonUIFileUploadPro = t__default.forwardRef(
|
|
|
65064
65263
|
return new Promise((resolve) => {
|
|
65065
65264
|
const img = new Image();
|
|
65066
65265
|
const reader = new FileReader();
|
|
65067
|
-
reader.onload = (
|
|
65068
|
-
img.src =
|
|
65266
|
+
reader.onload = (e) => {
|
|
65267
|
+
img.src = e.target?.result;
|
|
65069
65268
|
img.onload = () => {
|
|
65070
65269
|
const canvas = document.createElement("canvas");
|
|
65071
65270
|
const ctx = canvas.getContext("2d");
|
|
@@ -65409,32 +65608,32 @@ var MoonUIFileUploadPro = t__default.forwardRef(
|
|
|
65409
65608
|
uploadFileChunked,
|
|
65410
65609
|
resizeImage
|
|
65411
65610
|
]);
|
|
65412
|
-
const handleDrop = useCallback((
|
|
65413
|
-
|
|
65611
|
+
const handleDrop = useCallback((e) => {
|
|
65612
|
+
e.preventDefault();
|
|
65414
65613
|
setIsDragOver(false);
|
|
65415
65614
|
if (disabled)
|
|
65416
65615
|
return;
|
|
65417
|
-
const droppedFiles = Array.from(
|
|
65616
|
+
const droppedFiles = Array.from(e.dataTransfer.files);
|
|
65418
65617
|
if (droppedFiles.length > 0) {
|
|
65419
65618
|
processFiles(droppedFiles);
|
|
65420
65619
|
}
|
|
65421
65620
|
}, [processFiles, disabled]);
|
|
65422
|
-
const handleDragOver = useCallback((
|
|
65423
|
-
|
|
65621
|
+
const handleDragOver = useCallback((e) => {
|
|
65622
|
+
e.preventDefault();
|
|
65424
65623
|
if (!disabled) {
|
|
65425
65624
|
setIsDragOver(true);
|
|
65426
65625
|
}
|
|
65427
65626
|
}, [disabled]);
|
|
65428
|
-
const handleDragLeave = useCallback((
|
|
65429
|
-
|
|
65627
|
+
const handleDragLeave = useCallback((e) => {
|
|
65628
|
+
e.preventDefault();
|
|
65430
65629
|
setIsDragOver(false);
|
|
65431
65630
|
}, []);
|
|
65432
|
-
const handleFileSelect = useCallback((
|
|
65433
|
-
const selectedFiles =
|
|
65631
|
+
const handleFileSelect = useCallback((e) => {
|
|
65632
|
+
const selectedFiles = e.target.files;
|
|
65434
65633
|
if (selectedFiles && selectedFiles.length > 0) {
|
|
65435
65634
|
processFiles(selectedFiles);
|
|
65436
65635
|
}
|
|
65437
|
-
|
|
65636
|
+
e.target.value = "";
|
|
65438
65637
|
}, [processFiles]);
|
|
65439
65638
|
const removeFile = useCallback((fileId) => {
|
|
65440
65639
|
const fileToRemove = files.find((f) => f.id === fileId);
|
|
@@ -65694,7 +65893,7 @@ var FileUploadItem = ({
|
|
|
65694
65893
|
{
|
|
65695
65894
|
type: "checkbox",
|
|
65696
65895
|
checked: selected,
|
|
65697
|
-
onChange: (
|
|
65896
|
+
onChange: (e) => onSelect?.(e.target.checked),
|
|
65698
65897
|
className: "rounded border-muted-foreground/25 h-4 w-4"
|
|
65699
65898
|
}
|
|
65700
65899
|
) }),
|
|
@@ -65703,7 +65902,7 @@ var FileUploadItem = ({
|
|
|
65703
65902
|
{
|
|
65704
65903
|
type: "checkbox",
|
|
65705
65904
|
checked: selected,
|
|
65706
|
-
onChange: (
|
|
65905
|
+
onChange: (e) => onSelect?.(e.target.checked),
|
|
65707
65906
|
className: "rounded border-muted-foreground/25 h-4 w-4 mt-1 mr-3 float-left"
|
|
65708
65907
|
}
|
|
65709
65908
|
),
|
|
@@ -65941,7 +66140,7 @@ function DataTableColumnToggle({ table, trigger }) {
|
|
|
65941
66140
|
{
|
|
65942
66141
|
placeholder: "Search columns...",
|
|
65943
66142
|
value: search,
|
|
65944
|
-
onChange: (
|
|
66143
|
+
onChange: (e) => setSearch(e.target.value),
|
|
65945
66144
|
className: "h-8 pl-7 text-xs"
|
|
65946
66145
|
}
|
|
65947
66146
|
)
|
|
@@ -65982,8 +66181,8 @@ function DataTableColumnToggle({ table, trigger }) {
|
|
|
65982
66181
|
"cursor-pointer",
|
|
65983
66182
|
!isVisible && "text-muted-foreground"
|
|
65984
66183
|
),
|
|
65985
|
-
onSelect: (
|
|
65986
|
-
|
|
66184
|
+
onSelect: (e) => {
|
|
66185
|
+
e.preventDefault();
|
|
65987
66186
|
column.toggleVisibility();
|
|
65988
66187
|
},
|
|
65989
66188
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
@@ -66741,14 +66940,14 @@ function FilterConditionRow({
|
|
|
66741
66940
|
{
|
|
66742
66941
|
type: "number",
|
|
66743
66942
|
value: filter.value || "",
|
|
66744
|
-
onChange: (
|
|
66943
|
+
onChange: (e) => onUpdate({ value: e.target.value }),
|
|
66745
66944
|
placeholder: "Enter value..."
|
|
66746
66945
|
}
|
|
66747
66946
|
) : /* @__PURE__ */ jsx(
|
|
66748
66947
|
MoonUIInputPro,
|
|
66749
66948
|
{
|
|
66750
66949
|
value: filter.value || "",
|
|
66751
|
-
onChange: (
|
|
66950
|
+
onChange: (e) => onUpdate({ value: e.target.value }),
|
|
66752
66951
|
placeholder: "Enter value..."
|
|
66753
66952
|
}
|
|
66754
66953
|
) })
|
|
@@ -66974,7 +67173,7 @@ function DataTable({
|
|
|
66974
67173
|
{
|
|
66975
67174
|
placeholder: filterPlaceholder,
|
|
66976
67175
|
value: globalFilter,
|
|
66977
|
-
onChange: (
|
|
67176
|
+
onChange: (e) => setGlobalFilter(e.target.value),
|
|
66978
67177
|
className: "pl-8 w-64"
|
|
66979
67178
|
}
|
|
66980
67179
|
)
|
|
@@ -67102,10 +67301,10 @@ function DataTable({
|
|
|
67102
67301
|
"select",
|
|
67103
67302
|
{
|
|
67104
67303
|
value: table.getState().pagination.pageSize,
|
|
67105
|
-
onChange: async (
|
|
67304
|
+
onChange: async (e) => {
|
|
67106
67305
|
setIsPaginationLoading(true);
|
|
67107
67306
|
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
67108
|
-
table.setPageSize(Number(
|
|
67307
|
+
table.setPageSize(Number(e.target.value));
|
|
67109
67308
|
setIsPaginationLoading(false);
|
|
67110
67309
|
},
|
|
67111
67310
|
className: "h-8 w-[70px] rounded border border-input bg-background px-3 py-1 text-sm",
|
|
@@ -67215,8 +67414,8 @@ function getExpandableColumn(expandedRows, onToggle) {
|
|
|
67215
67414
|
return /* @__PURE__ */ jsx(
|
|
67216
67415
|
"button",
|
|
67217
67416
|
{
|
|
67218
|
-
onClick: (
|
|
67219
|
-
|
|
67417
|
+
onClick: (e) => {
|
|
67418
|
+
e.stopPropagation();
|
|
67220
67419
|
onToggle(rowId);
|
|
67221
67420
|
},
|
|
67222
67421
|
className: "p-2 hover:bg-muted rounded-md transition-colors",
|
|
@@ -67316,8 +67515,8 @@ var SearchInput = t__default.memo(({
|
|
|
67316
67515
|
useEffect(() => {
|
|
67317
67516
|
setLocalValue(initialValue);
|
|
67318
67517
|
}, [initialValue]);
|
|
67319
|
-
const handleChange = useCallback((
|
|
67320
|
-
const newValue =
|
|
67518
|
+
const handleChange = useCallback((e) => {
|
|
67519
|
+
const newValue = e.target.value;
|
|
67321
67520
|
setLocalValue(newValue);
|
|
67322
67521
|
if (timeoutRef.current) {
|
|
67323
67522
|
clearTimeout(timeoutRef.current);
|
|
@@ -67433,13 +67632,13 @@ function Sidebar2({
|
|
|
67433
67632
|
useEffect(() => {
|
|
67434
67633
|
if (!keyboardShortcuts)
|
|
67435
67634
|
return;
|
|
67436
|
-
const handleKeyDown3 = (
|
|
67437
|
-
if ((
|
|
67438
|
-
|
|
67635
|
+
const handleKeyDown3 = (e) => {
|
|
67636
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
67637
|
+
e.preventDefault();
|
|
67439
67638
|
searchInputRef.current?.focus();
|
|
67440
67639
|
}
|
|
67441
|
-
if ((
|
|
67442
|
-
|
|
67640
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "b") {
|
|
67641
|
+
e.preventDefault();
|
|
67443
67642
|
if (isMobile) {
|
|
67444
67643
|
setIsOpen(!isOpen);
|
|
67445
67644
|
} else {
|
|
@@ -67453,11 +67652,11 @@ function Sidebar2({
|
|
|
67453
67652
|
useEffect(() => {
|
|
67454
67653
|
if (!animatedBackground)
|
|
67455
67654
|
return;
|
|
67456
|
-
const handleMouseMove2 = (
|
|
67655
|
+
const handleMouseMove2 = (e) => {
|
|
67457
67656
|
const rect = document.querySelector(".sidebar-container")?.getBoundingClientRect();
|
|
67458
67657
|
if (rect) {
|
|
67459
|
-
mouseX.set(
|
|
67460
|
-
mouseY.set(
|
|
67658
|
+
mouseX.set(e.clientX - rect.left);
|
|
67659
|
+
mouseY.set(e.clientY - rect.top);
|
|
67461
67660
|
}
|
|
67462
67661
|
};
|
|
67463
67662
|
document.addEventListener("mousemove", handleMouseMove2);
|
|
@@ -67913,8 +68112,8 @@ var FormWizardProvider = ({
|
|
|
67913
68112
|
setStepData(parsed.stepData || {});
|
|
67914
68113
|
setCurrentStep(parsed.currentStep || 0);
|
|
67915
68114
|
setCompletedSteps(new Set(parsed.completedSteps || []));
|
|
67916
|
-
} catch (
|
|
67917
|
-
console.error("Failed to load persisted wizard data:",
|
|
68115
|
+
} catch (e) {
|
|
68116
|
+
console.error("Failed to load persisted wizard data:", e);
|
|
67918
68117
|
}
|
|
67919
68118
|
}
|
|
67920
68119
|
}
|
|
@@ -68752,7 +68951,7 @@ var MoonUICreditCardInputPro = t__default.forwardRef(({
|
|
|
68752
68951
|
type: "text",
|
|
68753
68952
|
inputMode: "numeric",
|
|
68754
68953
|
value: value.number,
|
|
68755
|
-
onChange: (
|
|
68954
|
+
onChange: (e) => handleChange("number", e.target.value),
|
|
68756
68955
|
onFocus: () => setFocused("number"),
|
|
68757
68956
|
onBlur: () => setFocused(null),
|
|
68758
68957
|
placeholder: placeholders.number || "1234 5678 9012 3456",
|
|
@@ -68782,7 +68981,7 @@ var MoonUICreditCardInputPro = t__default.forwardRef(({
|
|
|
68782
68981
|
type: "text",
|
|
68783
68982
|
inputMode: "numeric",
|
|
68784
68983
|
value: value.expiry,
|
|
68785
|
-
onChange: (
|
|
68984
|
+
onChange: (e) => handleChange("expiry", e.target.value),
|
|
68786
68985
|
onFocus: () => setFocused("expiry"),
|
|
68787
68986
|
onBlur: () => setFocused(null),
|
|
68788
68987
|
placeholder: placeholders.expiry || "MM/YY",
|
|
@@ -68809,7 +69008,7 @@ var MoonUICreditCardInputPro = t__default.forwardRef(({
|
|
|
68809
69008
|
type: "text",
|
|
68810
69009
|
inputMode: "numeric",
|
|
68811
69010
|
value: value.cvc,
|
|
68812
|
-
onChange: (
|
|
69011
|
+
onChange: (e) => handleChange("cvc", e.target.value),
|
|
68813
69012
|
onFocus: () => setFocused("cvc"),
|
|
68814
69013
|
onBlur: () => setFocused(null),
|
|
68815
69014
|
placeholder: placeholders.cvc || cardType === "amex" ? "1234" : "123",
|
|
@@ -68834,7 +69033,7 @@ var MoonUICreditCardInputPro = t__default.forwardRef(({
|
|
|
68834
69033
|
id: "card-name",
|
|
68835
69034
|
type: "text",
|
|
68836
69035
|
value: value.name,
|
|
68837
|
-
onChange: (
|
|
69036
|
+
onChange: (e) => handleChange("name", e.target.value),
|
|
68838
69037
|
onFocus: () => setFocused("name"),
|
|
68839
69038
|
onBlur: () => setFocused(null),
|
|
68840
69039
|
placeholder: placeholders.name || "John Doe",
|
|
@@ -68955,8 +69154,8 @@ var MoonUIPhoneNumberInputPro = t__default.forwardRef(({
|
|
|
68955
69154
|
isValid: validatePhoneNumber(value.number, countryCode)
|
|
68956
69155
|
});
|
|
68957
69156
|
};
|
|
68958
|
-
const handleNumberChange = (
|
|
68959
|
-
let newValue =
|
|
69157
|
+
const handleNumberChange = (e) => {
|
|
69158
|
+
let newValue = e.target.value;
|
|
68960
69159
|
if (autoFormat) {
|
|
68961
69160
|
const cleaned = newValue.replace(/\D/g, "");
|
|
68962
69161
|
newValue = formatPhoneNumber(cleaned, selectedCountry.format);
|
|
@@ -68970,11 +69169,11 @@ var MoonUIPhoneNumberInputPro = t__default.forwardRef(({
|
|
|
68970
69169
|
isValid: valid
|
|
68971
69170
|
});
|
|
68972
69171
|
};
|
|
68973
|
-
const handlePaste2 = (
|
|
69172
|
+
const handlePaste2 = (e) => {
|
|
68974
69173
|
if (!autoFormat)
|
|
68975
69174
|
return;
|
|
68976
|
-
|
|
68977
|
-
const pastedText =
|
|
69175
|
+
e.preventDefault();
|
|
69176
|
+
const pastedText = e.clipboardData.getData("text");
|
|
68978
69177
|
const cleaned = pastedText.replace(/\D/g, "");
|
|
68979
69178
|
const formatted = formatPhoneNumber(cleaned, selectedCountry.format);
|
|
68980
69179
|
const valid = validatePhoneNumber(formatted, value.country);
|
|
@@ -69397,7 +69596,7 @@ var MoonUIQuizFormPro = t__default.forwardRef(({
|
|
|
69397
69596
|
rows: 4,
|
|
69398
69597
|
placeholder: "Type your answer here...",
|
|
69399
69598
|
value: userAnswer || "",
|
|
69400
|
-
onChange: (
|
|
69599
|
+
onChange: (e) => saveAnswer(e.target.value)
|
|
69401
69600
|
}
|
|
69402
69601
|
)
|
|
69403
69602
|
}
|
|
@@ -69465,7 +69664,7 @@ var MoonUIQuizFormPro = t__default.forwardRef(({
|
|
|
69465
69664
|
{
|
|
69466
69665
|
className: "w-full p-3 rounded-lg border bg-background",
|
|
69467
69666
|
value: matches2[left] || "",
|
|
69468
|
-
onChange: (
|
|
69667
|
+
onChange: (e) => saveAnswer({ ...matches2, [left]: e.target.value }),
|
|
69469
69668
|
children: [
|
|
69470
69669
|
/* @__PURE__ */ jsx("option", { value: "", children: "Select..." }),
|
|
69471
69670
|
currentQuestion.rightOptions?.map((right) => /* @__PURE__ */ jsx("option", { value: right, children: right }, right))
|
|
@@ -69840,9 +70039,9 @@ var ButtonPro = t__default.forwardRef(
|
|
|
69840
70039
|
setMagneticPosition({ x: 0, y: 0 });
|
|
69841
70040
|
}
|
|
69842
70041
|
};
|
|
69843
|
-
const handleClick2 = async (
|
|
69844
|
-
createRipple(
|
|
69845
|
-
createParticles(
|
|
70042
|
+
const handleClick2 = async (e) => {
|
|
70043
|
+
createRipple(e);
|
|
70044
|
+
createParticles(e);
|
|
69846
70045
|
if (currentState === "loading")
|
|
69847
70046
|
return;
|
|
69848
70047
|
if (enableMorph) {
|
|
@@ -69851,7 +70050,7 @@ var ButtonPro = t__default.forwardRef(
|
|
|
69851
70050
|
}
|
|
69852
70051
|
if (onClick) {
|
|
69853
70052
|
try {
|
|
69854
|
-
await onClick(
|
|
70053
|
+
await onClick(e);
|
|
69855
70054
|
if (enableMorph) {
|
|
69856
70055
|
setInternalState("success");
|
|
69857
70056
|
onStateChange?.("success");
|
|
@@ -70060,14 +70259,14 @@ var CardPro = t__default.forwardRef(
|
|
|
70060
70259
|
const rotateY = useTransform(mouseXSpring, [-1, 1], [-tiltMaxAngle, tiltMaxAngle]);
|
|
70061
70260
|
const glowX = useTransform(mouseXSpring, [-1, 1], [0, 100]);
|
|
70062
70261
|
const glowY = useTransform(mouseYSpring, [-1, 1], [0, 100]);
|
|
70063
|
-
const handleMouseMove2 = (
|
|
70262
|
+
const handleMouseMove2 = (e) => {
|
|
70064
70263
|
if (!cardRef.current || !enableTilt && !enableGlow)
|
|
70065
70264
|
return;
|
|
70066
70265
|
const rect = cardRef.current.getBoundingClientRect();
|
|
70067
70266
|
const centerX = rect.left + rect.width / 2;
|
|
70068
70267
|
const centerY = rect.top + rect.height / 2;
|
|
70069
|
-
const x = (
|
|
70070
|
-
const y = (
|
|
70268
|
+
const x = (e.clientX - centerX) / (rect.width / 2);
|
|
70269
|
+
const y = (e.clientY - centerY) / (rect.height / 2);
|
|
70071
70270
|
mouseX.set(x);
|
|
70072
70271
|
mouseY.set(y);
|
|
70073
70272
|
};
|