@moontra/moonui-pro 2.18.0 → 2.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +486 -434
- package/package.json +1 -1
- package/src/components/github-stars/hooks.ts +79 -8
- package/src/components/github-stars/index.tsx +65 -57
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
|
]
|
|
@@ -61686,15 +61686,25 @@ function useGitHubData({
|
|
|
61686
61686
|
const [lastUpdated, setLastUpdated] = useState(null);
|
|
61687
61687
|
const refreshTimeoutRef = useRef();
|
|
61688
61688
|
const previousStarsRef = useRef(/* @__PURE__ */ new Map());
|
|
61689
|
+
const errorCountRef = useRef(0);
|
|
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]);
|
|
61689
61699
|
const checkMilestones = useCallback((repos2) => {
|
|
61690
|
-
if (!
|
|
61700
|
+
if (!onMilestoneReachedRef.current)
|
|
61691
61701
|
return;
|
|
61692
61702
|
repos2.forEach((repo) => {
|
|
61693
61703
|
const previousStars = previousStarsRef.current.get(repo.full_name) || 0;
|
|
61694
61704
|
const currentStars = repo.stargazers_count;
|
|
61695
|
-
|
|
61705
|
+
milestonesRef.current.forEach((milestone) => {
|
|
61696
61706
|
if (previousStars < milestone && currentStars >= milestone) {
|
|
61697
|
-
|
|
61707
|
+
onMilestoneReachedRef.current?.({
|
|
61698
61708
|
count: milestone,
|
|
61699
61709
|
reached: true,
|
|
61700
61710
|
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -61704,8 +61714,26 @@ function useGitHubData({
|
|
|
61704
61714
|
});
|
|
61705
61715
|
previousStarsRef.current.set(repo.full_name, currentStars);
|
|
61706
61716
|
});
|
|
61707
|
-
}, [
|
|
61717
|
+
}, []);
|
|
61708
61718
|
const fetchData = useCallback(async () => {
|
|
61719
|
+
if (errorCountRef.current >= maxErrorCount) {
|
|
61720
|
+
console.warn("Maximum error count reached. Stopping requests.");
|
|
61721
|
+
setLoading(false);
|
|
61722
|
+
setError("Maximum retry limit exceeded. Please check your configuration.");
|
|
61723
|
+
return;
|
|
61724
|
+
}
|
|
61725
|
+
const hasValidInput = username && repository || // Tek repository modu
|
|
61726
|
+
username && repositories && repositories.length > 0 || // Çoklu repository modu
|
|
61727
|
+
repositories && repositories.length > 0 && repositories.every((r2) => r2.includes("/")) || // Full path repositories
|
|
61728
|
+
username;
|
|
61729
|
+
if (!hasValidInput) {
|
|
61730
|
+
console.warn("No valid input provided. Skipping API request.");
|
|
61731
|
+
setLoading(false);
|
|
61732
|
+
setError(null);
|
|
61733
|
+
setRepos([]);
|
|
61734
|
+
setStats(null);
|
|
61735
|
+
return;
|
|
61736
|
+
}
|
|
61709
61737
|
try {
|
|
61710
61738
|
setLoading(true);
|
|
61711
61739
|
setError(null);
|
|
@@ -61722,6 +61750,12 @@ function useGitHubData({
|
|
|
61722
61750
|
if (repository && username) {
|
|
61723
61751
|
const repo = await fetchRepository(username, repository, token);
|
|
61724
61752
|
fetchedRepos = [repo];
|
|
61753
|
+
} else if (repositories && repositories.length > 0 && repositories.every((r2) => r2.includes("/"))) {
|
|
61754
|
+
const repoPromises = repositories.map((fullPath) => {
|
|
61755
|
+
const [owner, name] = fullPath.split("/");
|
|
61756
|
+
return fetchRepository(owner, name, token);
|
|
61757
|
+
});
|
|
61758
|
+
fetchedRepos = await Promise.all(repoPromises);
|
|
61725
61759
|
} else if (repositories && repositories.length > 0 && username) {
|
|
61726
61760
|
const repoPromises = repositories.map(
|
|
61727
61761
|
(repoName) => fetchRepository(username, repoName, token)
|
|
@@ -61777,9 +61811,12 @@ function useGitHubData({
|
|
|
61777
61811
|
onDataUpdate(calculatedStats);
|
|
61778
61812
|
}
|
|
61779
61813
|
setLastUpdated(/* @__PURE__ */ new Date());
|
|
61814
|
+
errorCountRef.current = 0;
|
|
61780
61815
|
} catch (err) {
|
|
61781
61816
|
const errorMessage = err instanceof Error ? err.message : "Failed to fetch data";
|
|
61782
61817
|
setError(errorMessage);
|
|
61818
|
+
errorCountRef.current += 1;
|
|
61819
|
+
console.error(`GitHub API error (${errorCountRef.current}/${maxErrorCount}):`, errorMessage);
|
|
61783
61820
|
if (onError) {
|
|
61784
61821
|
onError(err instanceof Error ? err : new Error(errorMessage));
|
|
61785
61822
|
}
|
|
@@ -61789,16 +61826,23 @@ function useGitHubData({
|
|
|
61789
61826
|
}, [
|
|
61790
61827
|
username,
|
|
61791
61828
|
repository,
|
|
61792
|
-
repositories,
|
|
61829
|
+
repositories?.join(","),
|
|
61830
|
+
// Array'i string'e çevir ki referans değişmesin
|
|
61793
61831
|
token,
|
|
61794
61832
|
sortBy,
|
|
61795
61833
|
maxItems,
|
|
61796
61834
|
checkMilestones,
|
|
61835
|
+
// Artık stable
|
|
61797
61836
|
onDataUpdate,
|
|
61798
61837
|
onError
|
|
61799
61838
|
]);
|
|
61800
61839
|
useEffect(() => {
|
|
61801
|
-
|
|
61840
|
+
const hasValidInput = username && repository || username && repositories && repositories.length > 0 || repositories && repositories.length > 0 && repositories.every((r2) => r2.includes("/")) || username;
|
|
61841
|
+
if (hasValidInput) {
|
|
61842
|
+
fetchData();
|
|
61843
|
+
} else {
|
|
61844
|
+
setLoading(false);
|
|
61845
|
+
}
|
|
61802
61846
|
}, [fetchData]);
|
|
61803
61847
|
useEffect(() => {
|
|
61804
61848
|
if (!autoRefresh)
|
|
@@ -61817,6 +61861,10 @@ function useGitHubData({
|
|
|
61817
61861
|
};
|
|
61818
61862
|
}, [autoRefresh, refreshInterval, fetchData]);
|
|
61819
61863
|
const refresh = useCallback(() => {
|
|
61864
|
+
if (errorCountRef.current >= maxErrorCount) {
|
|
61865
|
+
console.warn("Cannot refresh: maximum error count reached");
|
|
61866
|
+
return Promise.resolve();
|
|
61867
|
+
}
|
|
61820
61868
|
clearCache();
|
|
61821
61869
|
return fetchData();
|
|
61822
61870
|
}, [fetchData]);
|
|
@@ -62197,6 +62245,20 @@ var GitHubStarsInternal = ({
|
|
|
62197
62245
|
customColors
|
|
62198
62246
|
}) => {
|
|
62199
62247
|
const { notify } = useGitHubNotifications(enableNotifications);
|
|
62248
|
+
const handleMilestoneReached = t__default.useCallback((milestone) => {
|
|
62249
|
+
if (celebrateAt?.includes(milestone.count)) {
|
|
62250
|
+
confetti({
|
|
62251
|
+
particleCount: 100,
|
|
62252
|
+
spread: 70,
|
|
62253
|
+
origin: { y: 0.6 }
|
|
62254
|
+
});
|
|
62255
|
+
notify(`\u{1F389} Milestone Reached!`, {
|
|
62256
|
+
body: `${milestone.count} stars achieved!`,
|
|
62257
|
+
tag: `milestone-${milestone.count}`
|
|
62258
|
+
});
|
|
62259
|
+
}
|
|
62260
|
+
onMilestoneReached?.(milestone);
|
|
62261
|
+
}, [celebrateAt, notify, onMilestoneReached]);
|
|
62200
62262
|
const {
|
|
62201
62263
|
repos,
|
|
62202
62264
|
stats,
|
|
@@ -62216,23 +62278,10 @@ var GitHubStarsInternal = ({
|
|
|
62216
62278
|
maxItems,
|
|
62217
62279
|
onError,
|
|
62218
62280
|
onDataUpdate,
|
|
62219
|
-
onMilestoneReached:
|
|
62220
|
-
if (celebrateAt?.includes(milestone.count)) {
|
|
62221
|
-
confetti({
|
|
62222
|
-
particleCount: 100,
|
|
62223
|
-
spread: 70,
|
|
62224
|
-
origin: { y: 0.6 }
|
|
62225
|
-
});
|
|
62226
|
-
notify(`\u{1F389} Milestone Reached!`, {
|
|
62227
|
-
body: `${milestone.count} stars achieved!`,
|
|
62228
|
-
tag: `milestone-${milestone.count}`
|
|
62229
|
-
});
|
|
62230
|
-
}
|
|
62231
|
-
onMilestoneReached?.(milestone);
|
|
62232
|
-
},
|
|
62281
|
+
onMilestoneReached: handleMilestoneReached,
|
|
62233
62282
|
milestones
|
|
62234
62283
|
});
|
|
62235
|
-
const handleExport = (format7) => {
|
|
62284
|
+
const handleExport = t__default.useCallback((format7) => {
|
|
62236
62285
|
if (!enableExport)
|
|
62237
62286
|
return;
|
|
62238
62287
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
@@ -62244,7 +62293,38 @@ var GitHubStarsInternal = ({
|
|
|
62244
62293
|
} else {
|
|
62245
62294
|
exportAsCSV(repos, `github-stars-${username}-${timestamp}.csv`);
|
|
62246
62295
|
}
|
|
62247
|
-
};
|
|
62296
|
+
}, [enableExport, repos, stats, username]);
|
|
62297
|
+
const handleDetailedExport = t__default.useCallback((e) => {
|
|
62298
|
+
if (!enableExport)
|
|
62299
|
+
return;
|
|
62300
|
+
const dropdown = document.createElement("div");
|
|
62301
|
+
dropdown.className = "absolute z-50 mt-2 w-48 rounded-md shadow-lg bg-popover border";
|
|
62302
|
+
dropdown.innerHTML = `
|
|
62303
|
+
<div class="py-1">
|
|
62304
|
+
<button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="json">
|
|
62305
|
+
Export as JSON
|
|
62306
|
+
</button>
|
|
62307
|
+
<button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="csv">
|
|
62308
|
+
Export as CSV
|
|
62309
|
+
</button>
|
|
62310
|
+
</div>
|
|
62311
|
+
`;
|
|
62312
|
+
dropdown.addEventListener("click", (e2) => {
|
|
62313
|
+
const target = e2.target;
|
|
62314
|
+
const format7 = target.getAttribute("data-format");
|
|
62315
|
+
if (format7 === "json" || format7 === "csv") {
|
|
62316
|
+
handleExport(format7);
|
|
62317
|
+
dropdown.remove();
|
|
62318
|
+
}
|
|
62319
|
+
});
|
|
62320
|
+
document.body.appendChild(dropdown);
|
|
62321
|
+
const rect = e.target.getBoundingClientRect();
|
|
62322
|
+
dropdown.style.top = `${rect.bottom + window.scrollY}px`;
|
|
62323
|
+
dropdown.style.left = `${rect.left + window.scrollX}px`;
|
|
62324
|
+
setTimeout(() => {
|
|
62325
|
+
document.addEventListener("click", () => dropdown.remove(), { once: true });
|
|
62326
|
+
}, 0);
|
|
62327
|
+
}, [enableExport, handleExport]);
|
|
62248
62328
|
if (loading) {
|
|
62249
62329
|
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: [
|
|
62250
62330
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -62300,35 +62380,7 @@ var GitHubStarsInternal = ({
|
|
|
62300
62380
|
DetailedVariant,
|
|
62301
62381
|
{
|
|
62302
62382
|
...baseProps,
|
|
62303
|
-
onExport:
|
|
62304
|
-
const dropdown = document.createElement("div");
|
|
62305
|
-
dropdown.className = "absolute z-50 mt-2 w-48 rounded-md shadow-lg bg-popover border";
|
|
62306
|
-
dropdown.innerHTML = `
|
|
62307
|
-
<div class="py-1">
|
|
62308
|
-
<button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="json">
|
|
62309
|
-
Export as JSON
|
|
62310
|
-
</button>
|
|
62311
|
-
<button class="w-full text-left px-4 py-2 text-sm hover:bg-accent" data-format="csv">
|
|
62312
|
-
Export as CSV
|
|
62313
|
-
</button>
|
|
62314
|
-
</div>
|
|
62315
|
-
`;
|
|
62316
|
-
dropdown.addEventListener("click", (e2) => {
|
|
62317
|
-
const target = e2.target;
|
|
62318
|
-
const format7 = target.getAttribute("data-format");
|
|
62319
|
-
if (format7 === "json" || format7 === "csv") {
|
|
62320
|
-
handleExport(format7);
|
|
62321
|
-
dropdown.remove();
|
|
62322
|
-
}
|
|
62323
|
-
});
|
|
62324
|
-
document.body.appendChild(dropdown);
|
|
62325
|
-
const rect = e.target.getBoundingClientRect();
|
|
62326
|
-
dropdown.style.top = `${rect.bottom + window.scrollY}px`;
|
|
62327
|
-
dropdown.style.left = `${rect.left + window.scrollX}px`;
|
|
62328
|
-
setTimeout(() => {
|
|
62329
|
-
document.addEventListener("click", () => dropdown.remove(), { once: true });
|
|
62330
|
-
}, 0);
|
|
62331
|
-
}
|
|
62383
|
+
onExport: handleDetailedExport
|
|
62332
62384
|
}
|
|
62333
62385
|
);
|
|
62334
62386
|
case "card":
|
|
@@ -62496,9 +62548,9 @@ var HealthCheckInternal = ({
|
|
|
62496
62548
|
const getOverallStatus = () => {
|
|
62497
62549
|
if (results.length === 0)
|
|
62498
62550
|
return "warning";
|
|
62499
|
-
const criticalEndpoints = endpoints.filter((
|
|
62551
|
+
const criticalEndpoints = endpoints.filter((e) => e.critical !== false);
|
|
62500
62552
|
const criticalResults = results.filter(
|
|
62501
|
-
(r2) => criticalEndpoints.some((
|
|
62553
|
+
(r2) => criticalEndpoints.some((e) => e.id === r2.id)
|
|
62502
62554
|
);
|
|
62503
62555
|
const hasUnhealthy = criticalResults.some((r2) => r2.status === "unhealthy");
|
|
62504
62556
|
const hasWarning = results.some((r2) => r2.status === "warning");
|
|
@@ -63162,9 +63214,9 @@ function LazyList({
|
|
|
63162
63214
|
setVisibleItems(items.slice(0, batchSize));
|
|
63163
63215
|
setCurrentBatch(1);
|
|
63164
63216
|
}, [items, batchSize]);
|
|
63165
|
-
const handleScroll = useCallback((
|
|
63217
|
+
const handleScroll = useCallback((e) => {
|
|
63166
63218
|
if (enableVirtualization && containerRef.current) {
|
|
63167
|
-
setScrollPosition(
|
|
63219
|
+
setScrollPosition(e.target.scrollTop);
|
|
63168
63220
|
}
|
|
63169
63221
|
}, [enableVirtualization]);
|
|
63170
63222
|
useEffect(() => {
|
|
@@ -63529,7 +63581,7 @@ var OptimizedImageInternal = ({
|
|
|
63529
63581
|
exit: { opacity: 0 },
|
|
63530
63582
|
className: "fixed inset-0 z-50 bg-black/90 flex items-center justify-center p-4",
|
|
63531
63583
|
onClick: () => setIsPreviewOpen(false),
|
|
63532
|
-
children: /* @__PURE__ */ jsxs("div", { className: "relative max-w-full max-h-full", onClick: (
|
|
63584
|
+
children: /* @__PURE__ */ jsxs("div", { className: "relative max-w-full max-h-full", onClick: (e) => e.stopPropagation(), children: [
|
|
63533
63585
|
/* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 flex gap-2 z-10", children: [
|
|
63534
63586
|
showZoom && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
63535
63587
|
/* @__PURE__ */ jsx(
|
|
@@ -64720,8 +64772,8 @@ var generateFileHash = async (file) => {
|
|
|
64720
64772
|
var createImagePreview = (file) => {
|
|
64721
64773
|
return new Promise((resolve) => {
|
|
64722
64774
|
const reader = new FileReader();
|
|
64723
|
-
reader.onload = (
|
|
64724
|
-
const result =
|
|
64775
|
+
reader.onload = (e) => {
|
|
64776
|
+
const result = e.target?.result;
|
|
64725
64777
|
const img = new Image();
|
|
64726
64778
|
img.onload = () => {
|
|
64727
64779
|
const canvas = document.createElement("canvas");
|
|
@@ -65026,8 +65078,8 @@ var MoonUIFileUploadPro = t__default.forwardRef(
|
|
|
65026
65078
|
return new Promise((resolve) => {
|
|
65027
65079
|
const img = new Image();
|
|
65028
65080
|
const reader = new FileReader();
|
|
65029
|
-
reader.onload = (
|
|
65030
|
-
img.src =
|
|
65081
|
+
reader.onload = (e) => {
|
|
65082
|
+
img.src = e.target?.result;
|
|
65031
65083
|
img.onload = () => {
|
|
65032
65084
|
const canvas = document.createElement("canvas");
|
|
65033
65085
|
const ctx = canvas.getContext("2d");
|
|
@@ -65371,32 +65423,32 @@ var MoonUIFileUploadPro = t__default.forwardRef(
|
|
|
65371
65423
|
uploadFileChunked,
|
|
65372
65424
|
resizeImage
|
|
65373
65425
|
]);
|
|
65374
|
-
const handleDrop = useCallback((
|
|
65375
|
-
|
|
65426
|
+
const handleDrop = useCallback((e) => {
|
|
65427
|
+
e.preventDefault();
|
|
65376
65428
|
setIsDragOver(false);
|
|
65377
65429
|
if (disabled)
|
|
65378
65430
|
return;
|
|
65379
|
-
const droppedFiles = Array.from(
|
|
65431
|
+
const droppedFiles = Array.from(e.dataTransfer.files);
|
|
65380
65432
|
if (droppedFiles.length > 0) {
|
|
65381
65433
|
processFiles(droppedFiles);
|
|
65382
65434
|
}
|
|
65383
65435
|
}, [processFiles, disabled]);
|
|
65384
|
-
const handleDragOver = useCallback((
|
|
65385
|
-
|
|
65436
|
+
const handleDragOver = useCallback((e) => {
|
|
65437
|
+
e.preventDefault();
|
|
65386
65438
|
if (!disabled) {
|
|
65387
65439
|
setIsDragOver(true);
|
|
65388
65440
|
}
|
|
65389
65441
|
}, [disabled]);
|
|
65390
|
-
const handleDragLeave = useCallback((
|
|
65391
|
-
|
|
65442
|
+
const handleDragLeave = useCallback((e) => {
|
|
65443
|
+
e.preventDefault();
|
|
65392
65444
|
setIsDragOver(false);
|
|
65393
65445
|
}, []);
|
|
65394
|
-
const handleFileSelect = useCallback((
|
|
65395
|
-
const selectedFiles =
|
|
65446
|
+
const handleFileSelect = useCallback((e) => {
|
|
65447
|
+
const selectedFiles = e.target.files;
|
|
65396
65448
|
if (selectedFiles && selectedFiles.length > 0) {
|
|
65397
65449
|
processFiles(selectedFiles);
|
|
65398
65450
|
}
|
|
65399
|
-
|
|
65451
|
+
e.target.value = "";
|
|
65400
65452
|
}, [processFiles]);
|
|
65401
65453
|
const removeFile = useCallback((fileId) => {
|
|
65402
65454
|
const fileToRemove = files.find((f) => f.id === fileId);
|
|
@@ -65656,7 +65708,7 @@ var FileUploadItem = ({
|
|
|
65656
65708
|
{
|
|
65657
65709
|
type: "checkbox",
|
|
65658
65710
|
checked: selected,
|
|
65659
|
-
onChange: (
|
|
65711
|
+
onChange: (e) => onSelect?.(e.target.checked),
|
|
65660
65712
|
className: "rounded border-muted-foreground/25 h-4 w-4"
|
|
65661
65713
|
}
|
|
65662
65714
|
) }),
|
|
@@ -65665,7 +65717,7 @@ var FileUploadItem = ({
|
|
|
65665
65717
|
{
|
|
65666
65718
|
type: "checkbox",
|
|
65667
65719
|
checked: selected,
|
|
65668
|
-
onChange: (
|
|
65720
|
+
onChange: (e) => onSelect?.(e.target.checked),
|
|
65669
65721
|
className: "rounded border-muted-foreground/25 h-4 w-4 mt-1 mr-3 float-left"
|
|
65670
65722
|
}
|
|
65671
65723
|
),
|
|
@@ -65903,7 +65955,7 @@ function DataTableColumnToggle({ table, trigger }) {
|
|
|
65903
65955
|
{
|
|
65904
65956
|
placeholder: "Search columns...",
|
|
65905
65957
|
value: search,
|
|
65906
|
-
onChange: (
|
|
65958
|
+
onChange: (e) => setSearch(e.target.value),
|
|
65907
65959
|
className: "h-8 pl-7 text-xs"
|
|
65908
65960
|
}
|
|
65909
65961
|
)
|
|
@@ -65944,8 +65996,8 @@ function DataTableColumnToggle({ table, trigger }) {
|
|
|
65944
65996
|
"cursor-pointer",
|
|
65945
65997
|
!isVisible && "text-muted-foreground"
|
|
65946
65998
|
),
|
|
65947
|
-
onSelect: (
|
|
65948
|
-
|
|
65999
|
+
onSelect: (e) => {
|
|
66000
|
+
e.preventDefault();
|
|
65949
66001
|
column.toggleVisibility();
|
|
65950
66002
|
},
|
|
65951
66003
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
@@ -66703,14 +66755,14 @@ function FilterConditionRow({
|
|
|
66703
66755
|
{
|
|
66704
66756
|
type: "number",
|
|
66705
66757
|
value: filter.value || "",
|
|
66706
|
-
onChange: (
|
|
66758
|
+
onChange: (e) => onUpdate({ value: e.target.value }),
|
|
66707
66759
|
placeholder: "Enter value..."
|
|
66708
66760
|
}
|
|
66709
66761
|
) : /* @__PURE__ */ jsx(
|
|
66710
66762
|
MoonUIInputPro,
|
|
66711
66763
|
{
|
|
66712
66764
|
value: filter.value || "",
|
|
66713
|
-
onChange: (
|
|
66765
|
+
onChange: (e) => onUpdate({ value: e.target.value }),
|
|
66714
66766
|
placeholder: "Enter value..."
|
|
66715
66767
|
}
|
|
66716
66768
|
) })
|
|
@@ -66936,7 +66988,7 @@ function DataTable({
|
|
|
66936
66988
|
{
|
|
66937
66989
|
placeholder: filterPlaceholder,
|
|
66938
66990
|
value: globalFilter,
|
|
66939
|
-
onChange: (
|
|
66991
|
+
onChange: (e) => setGlobalFilter(e.target.value),
|
|
66940
66992
|
className: "pl-8 w-64"
|
|
66941
66993
|
}
|
|
66942
66994
|
)
|
|
@@ -67064,10 +67116,10 @@ function DataTable({
|
|
|
67064
67116
|
"select",
|
|
67065
67117
|
{
|
|
67066
67118
|
value: table.getState().pagination.pageSize,
|
|
67067
|
-
onChange: async (
|
|
67119
|
+
onChange: async (e) => {
|
|
67068
67120
|
setIsPaginationLoading(true);
|
|
67069
67121
|
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
67070
|
-
table.setPageSize(Number(
|
|
67122
|
+
table.setPageSize(Number(e.target.value));
|
|
67071
67123
|
setIsPaginationLoading(false);
|
|
67072
67124
|
},
|
|
67073
67125
|
className: "h-8 w-[70px] rounded border border-input bg-background px-3 py-1 text-sm",
|
|
@@ -67177,8 +67229,8 @@ function getExpandableColumn(expandedRows, onToggle) {
|
|
|
67177
67229
|
return /* @__PURE__ */ jsx(
|
|
67178
67230
|
"button",
|
|
67179
67231
|
{
|
|
67180
|
-
onClick: (
|
|
67181
|
-
|
|
67232
|
+
onClick: (e) => {
|
|
67233
|
+
e.stopPropagation();
|
|
67182
67234
|
onToggle(rowId);
|
|
67183
67235
|
},
|
|
67184
67236
|
className: "p-2 hover:bg-muted rounded-md transition-colors",
|
|
@@ -67278,8 +67330,8 @@ var SearchInput = t__default.memo(({
|
|
|
67278
67330
|
useEffect(() => {
|
|
67279
67331
|
setLocalValue(initialValue);
|
|
67280
67332
|
}, [initialValue]);
|
|
67281
|
-
const handleChange = useCallback((
|
|
67282
|
-
const newValue =
|
|
67333
|
+
const handleChange = useCallback((e) => {
|
|
67334
|
+
const newValue = e.target.value;
|
|
67283
67335
|
setLocalValue(newValue);
|
|
67284
67336
|
if (timeoutRef.current) {
|
|
67285
67337
|
clearTimeout(timeoutRef.current);
|
|
@@ -67395,13 +67447,13 @@ function Sidebar2({
|
|
|
67395
67447
|
useEffect(() => {
|
|
67396
67448
|
if (!keyboardShortcuts)
|
|
67397
67449
|
return;
|
|
67398
|
-
const handleKeyDown3 = (
|
|
67399
|
-
if ((
|
|
67400
|
-
|
|
67450
|
+
const handleKeyDown3 = (e) => {
|
|
67451
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "k") {
|
|
67452
|
+
e.preventDefault();
|
|
67401
67453
|
searchInputRef.current?.focus();
|
|
67402
67454
|
}
|
|
67403
|
-
if ((
|
|
67404
|
-
|
|
67455
|
+
if ((e.metaKey || e.ctrlKey) && e.key === "b") {
|
|
67456
|
+
e.preventDefault();
|
|
67405
67457
|
if (isMobile) {
|
|
67406
67458
|
setIsOpen(!isOpen);
|
|
67407
67459
|
} else {
|
|
@@ -67415,11 +67467,11 @@ function Sidebar2({
|
|
|
67415
67467
|
useEffect(() => {
|
|
67416
67468
|
if (!animatedBackground)
|
|
67417
67469
|
return;
|
|
67418
|
-
const handleMouseMove2 = (
|
|
67470
|
+
const handleMouseMove2 = (e) => {
|
|
67419
67471
|
const rect = document.querySelector(".sidebar-container")?.getBoundingClientRect();
|
|
67420
67472
|
if (rect) {
|
|
67421
|
-
mouseX.set(
|
|
67422
|
-
mouseY.set(
|
|
67473
|
+
mouseX.set(e.clientX - rect.left);
|
|
67474
|
+
mouseY.set(e.clientY - rect.top);
|
|
67423
67475
|
}
|
|
67424
67476
|
};
|
|
67425
67477
|
document.addEventListener("mousemove", handleMouseMove2);
|
|
@@ -67875,8 +67927,8 @@ var FormWizardProvider = ({
|
|
|
67875
67927
|
setStepData(parsed.stepData || {});
|
|
67876
67928
|
setCurrentStep(parsed.currentStep || 0);
|
|
67877
67929
|
setCompletedSteps(new Set(parsed.completedSteps || []));
|
|
67878
|
-
} catch (
|
|
67879
|
-
console.error("Failed to load persisted wizard data:",
|
|
67930
|
+
} catch (e) {
|
|
67931
|
+
console.error("Failed to load persisted wizard data:", e);
|
|
67880
67932
|
}
|
|
67881
67933
|
}
|
|
67882
67934
|
}
|
|
@@ -68714,7 +68766,7 @@ var MoonUICreditCardInputPro = t__default.forwardRef(({
|
|
|
68714
68766
|
type: "text",
|
|
68715
68767
|
inputMode: "numeric",
|
|
68716
68768
|
value: value.number,
|
|
68717
|
-
onChange: (
|
|
68769
|
+
onChange: (e) => handleChange("number", e.target.value),
|
|
68718
68770
|
onFocus: () => setFocused("number"),
|
|
68719
68771
|
onBlur: () => setFocused(null),
|
|
68720
68772
|
placeholder: placeholders.number || "1234 5678 9012 3456",
|
|
@@ -68744,7 +68796,7 @@ var MoonUICreditCardInputPro = t__default.forwardRef(({
|
|
|
68744
68796
|
type: "text",
|
|
68745
68797
|
inputMode: "numeric",
|
|
68746
68798
|
value: value.expiry,
|
|
68747
|
-
onChange: (
|
|
68799
|
+
onChange: (e) => handleChange("expiry", e.target.value),
|
|
68748
68800
|
onFocus: () => setFocused("expiry"),
|
|
68749
68801
|
onBlur: () => setFocused(null),
|
|
68750
68802
|
placeholder: placeholders.expiry || "MM/YY",
|
|
@@ -68771,7 +68823,7 @@ var MoonUICreditCardInputPro = t__default.forwardRef(({
|
|
|
68771
68823
|
type: "text",
|
|
68772
68824
|
inputMode: "numeric",
|
|
68773
68825
|
value: value.cvc,
|
|
68774
|
-
onChange: (
|
|
68826
|
+
onChange: (e) => handleChange("cvc", e.target.value),
|
|
68775
68827
|
onFocus: () => setFocused("cvc"),
|
|
68776
68828
|
onBlur: () => setFocused(null),
|
|
68777
68829
|
placeholder: placeholders.cvc || cardType === "amex" ? "1234" : "123",
|
|
@@ -68796,7 +68848,7 @@ var MoonUICreditCardInputPro = t__default.forwardRef(({
|
|
|
68796
68848
|
id: "card-name",
|
|
68797
68849
|
type: "text",
|
|
68798
68850
|
value: value.name,
|
|
68799
|
-
onChange: (
|
|
68851
|
+
onChange: (e) => handleChange("name", e.target.value),
|
|
68800
68852
|
onFocus: () => setFocused("name"),
|
|
68801
68853
|
onBlur: () => setFocused(null),
|
|
68802
68854
|
placeholder: placeholders.name || "John Doe",
|
|
@@ -68917,8 +68969,8 @@ var MoonUIPhoneNumberInputPro = t__default.forwardRef(({
|
|
|
68917
68969
|
isValid: validatePhoneNumber(value.number, countryCode)
|
|
68918
68970
|
});
|
|
68919
68971
|
};
|
|
68920
|
-
const handleNumberChange = (
|
|
68921
|
-
let newValue =
|
|
68972
|
+
const handleNumberChange = (e) => {
|
|
68973
|
+
let newValue = e.target.value;
|
|
68922
68974
|
if (autoFormat) {
|
|
68923
68975
|
const cleaned = newValue.replace(/\D/g, "");
|
|
68924
68976
|
newValue = formatPhoneNumber(cleaned, selectedCountry.format);
|
|
@@ -68932,11 +68984,11 @@ var MoonUIPhoneNumberInputPro = t__default.forwardRef(({
|
|
|
68932
68984
|
isValid: valid
|
|
68933
68985
|
});
|
|
68934
68986
|
};
|
|
68935
|
-
const handlePaste2 = (
|
|
68987
|
+
const handlePaste2 = (e) => {
|
|
68936
68988
|
if (!autoFormat)
|
|
68937
68989
|
return;
|
|
68938
|
-
|
|
68939
|
-
const pastedText =
|
|
68990
|
+
e.preventDefault();
|
|
68991
|
+
const pastedText = e.clipboardData.getData("text");
|
|
68940
68992
|
const cleaned = pastedText.replace(/\D/g, "");
|
|
68941
68993
|
const formatted = formatPhoneNumber(cleaned, selectedCountry.format);
|
|
68942
68994
|
const valid = validatePhoneNumber(formatted, value.country);
|
|
@@ -69359,7 +69411,7 @@ var MoonUIQuizFormPro = t__default.forwardRef(({
|
|
|
69359
69411
|
rows: 4,
|
|
69360
69412
|
placeholder: "Type your answer here...",
|
|
69361
69413
|
value: userAnswer || "",
|
|
69362
|
-
onChange: (
|
|
69414
|
+
onChange: (e) => saveAnswer(e.target.value)
|
|
69363
69415
|
}
|
|
69364
69416
|
)
|
|
69365
69417
|
}
|
|
@@ -69427,7 +69479,7 @@ var MoonUIQuizFormPro = t__default.forwardRef(({
|
|
|
69427
69479
|
{
|
|
69428
69480
|
className: "w-full p-3 rounded-lg border bg-background",
|
|
69429
69481
|
value: matches2[left] || "",
|
|
69430
|
-
onChange: (
|
|
69482
|
+
onChange: (e) => saveAnswer({ ...matches2, [left]: e.target.value }),
|
|
69431
69483
|
children: [
|
|
69432
69484
|
/* @__PURE__ */ jsx("option", { value: "", children: "Select..." }),
|
|
69433
69485
|
currentQuestion.rightOptions?.map((right) => /* @__PURE__ */ jsx("option", { value: right, children: right }, right))
|
|
@@ -69802,9 +69854,9 @@ var ButtonPro = t__default.forwardRef(
|
|
|
69802
69854
|
setMagneticPosition({ x: 0, y: 0 });
|
|
69803
69855
|
}
|
|
69804
69856
|
};
|
|
69805
|
-
const handleClick2 = async (
|
|
69806
|
-
createRipple(
|
|
69807
|
-
createParticles(
|
|
69857
|
+
const handleClick2 = async (e) => {
|
|
69858
|
+
createRipple(e);
|
|
69859
|
+
createParticles(e);
|
|
69808
69860
|
if (currentState === "loading")
|
|
69809
69861
|
return;
|
|
69810
69862
|
if (enableMorph) {
|
|
@@ -69813,7 +69865,7 @@ var ButtonPro = t__default.forwardRef(
|
|
|
69813
69865
|
}
|
|
69814
69866
|
if (onClick) {
|
|
69815
69867
|
try {
|
|
69816
|
-
await onClick(
|
|
69868
|
+
await onClick(e);
|
|
69817
69869
|
if (enableMorph) {
|
|
69818
69870
|
setInternalState("success");
|
|
69819
69871
|
onStateChange?.("success");
|
|
@@ -70022,14 +70074,14 @@ var CardPro = t__default.forwardRef(
|
|
|
70022
70074
|
const rotateY = useTransform(mouseXSpring, [-1, 1], [-tiltMaxAngle, tiltMaxAngle]);
|
|
70023
70075
|
const glowX = useTransform(mouseXSpring, [-1, 1], [0, 100]);
|
|
70024
70076
|
const glowY = useTransform(mouseYSpring, [-1, 1], [0, 100]);
|
|
70025
|
-
const handleMouseMove2 = (
|
|
70077
|
+
const handleMouseMove2 = (e) => {
|
|
70026
70078
|
if (!cardRef.current || !enableTilt && !enableGlow)
|
|
70027
70079
|
return;
|
|
70028
70080
|
const rect = cardRef.current.getBoundingClientRect();
|
|
70029
70081
|
const centerX = rect.left + rect.width / 2;
|
|
70030
70082
|
const centerY = rect.top + rect.height / 2;
|
|
70031
|
-
const x = (
|
|
70032
|
-
const y = (
|
|
70083
|
+
const x = (e.clientX - centerX) / (rect.width / 2);
|
|
70084
|
+
const y = (e.clientY - centerY) / (rect.height / 2);
|
|
70033
70085
|
mouseX.set(x);
|
|
70034
70086
|
mouseY.set(y);
|
|
70035
70087
|
};
|