@moontra/moonui-pro 2.34.0 → 2.34.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/index.global.js +241 -245
- package/dist/cdn/index.global.js.map +1 -1
- package/dist/index.d.ts +46 -41
- package/dist/index.mjs +680 -453
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -16874,7 +16874,10 @@ var splashCursorVariants = cva(
|
|
|
16874
16874
|
}
|
|
16875
16875
|
}
|
|
16876
16876
|
);
|
|
16877
|
-
var
|
|
16877
|
+
var calculateDistance = (x1, y1, x2, y2) => {
|
|
16878
|
+
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
|
|
16879
|
+
};
|
|
16880
|
+
var SplashCursorComponent = ({
|
|
16878
16881
|
size: size4 = "md",
|
|
16879
16882
|
variant = "default",
|
|
16880
16883
|
duration = 600,
|
|
@@ -16890,46 +16893,63 @@ var SplashCursor = ({
|
|
|
16890
16893
|
containerRef
|
|
16891
16894
|
}) => {
|
|
16892
16895
|
const [splashes, setSplashes] = useState([]);
|
|
16893
|
-
const
|
|
16894
|
-
const
|
|
16895
|
-
const lastPos = useRef({ x: 0, y: 0 });
|
|
16896
|
+
const lastMoveTimeRef = useRef(Date.now());
|
|
16897
|
+
const lastPosRef = useRef({ x: 0, y: 0 });
|
|
16896
16898
|
const audioRef = useRef(null);
|
|
16899
|
+
const rafIdRef = useRef(null);
|
|
16900
|
+
const lastSplashTimeRef = useRef(0);
|
|
16901
|
+
const splashTimersRef = useRef(/* @__PURE__ */ new Set());
|
|
16897
16902
|
useEffect(() => {
|
|
16898
|
-
if (soundUrl) {
|
|
16899
|
-
|
|
16900
|
-
|
|
16903
|
+
if (soundUrl && !audioRef.current) {
|
|
16904
|
+
const audio = new Audio(soundUrl);
|
|
16905
|
+
audio.volume = 0.3;
|
|
16906
|
+
audioRef.current = audio;
|
|
16901
16907
|
}
|
|
16908
|
+
return () => {
|
|
16909
|
+
if (audioRef.current) {
|
|
16910
|
+
audioRef.current = null;
|
|
16911
|
+
}
|
|
16912
|
+
};
|
|
16902
16913
|
}, [soundUrl]);
|
|
16903
|
-
const
|
|
16904
|
-
|
|
16905
|
-
};
|
|
16906
|
-
const createSplash = (x, y) => {
|
|
16914
|
+
const cleanupSplash = useCallback((splashId) => {
|
|
16915
|
+
setSplashes((prev) => prev.filter((splash) => splash.id !== splashId));
|
|
16916
|
+
}, []);
|
|
16917
|
+
const createSplash = useCallback((x, y) => {
|
|
16918
|
+
const now = Date.now();
|
|
16919
|
+
if (now - lastSplashTimeRef.current < 16) {
|
|
16920
|
+
return;
|
|
16921
|
+
}
|
|
16922
|
+
lastSplashTimeRef.current = now;
|
|
16907
16923
|
const newSplash = {
|
|
16908
|
-
id:
|
|
16924
|
+
id: now + Math.random(),
|
|
16909
16925
|
x,
|
|
16910
16926
|
y,
|
|
16911
|
-
timestamp:
|
|
16927
|
+
timestamp: now
|
|
16912
16928
|
};
|
|
16913
16929
|
setSplashes((prev) => {
|
|
16914
|
-
const updated = [...prev, newSplash];
|
|
16915
|
-
if (updated.length > maxSplashes) {
|
|
16916
|
-
return updated.slice(-maxSplashes);
|
|
16917
|
-
}
|
|
16930
|
+
const updated = prev.length >= maxSplashes ? [...prev.slice(1), newSplash] : [...prev, newSplash];
|
|
16918
16931
|
return updated;
|
|
16919
16932
|
});
|
|
16920
16933
|
if (audioRef.current) {
|
|
16921
|
-
|
|
16922
|
-
|
|
16923
|
-
|
|
16934
|
+
try {
|
|
16935
|
+
const audioClone = audioRef.current.cloneNode();
|
|
16936
|
+
audioClone.volume = 0.3;
|
|
16937
|
+
audioClone.play().catch(() => {
|
|
16938
|
+
});
|
|
16939
|
+
setTimeout(() => audioClone.remove(), 1e3);
|
|
16940
|
+
} catch {
|
|
16941
|
+
}
|
|
16924
16942
|
}
|
|
16925
|
-
setTimeout(() => {
|
|
16926
|
-
|
|
16943
|
+
const timer = setTimeout(() => {
|
|
16944
|
+
cleanupSplash(newSplash.id);
|
|
16945
|
+
splashTimersRef.current.delete(timer);
|
|
16927
16946
|
}, duration);
|
|
16928
|
-
|
|
16929
|
-
|
|
16930
|
-
|
|
16947
|
+
splashTimersRef.current.add(timer);
|
|
16948
|
+
}, [maxSplashes, duration, cleanupSplash]);
|
|
16949
|
+
const handleMouseMoveThrottled = useCallback((e) => {
|
|
16950
|
+
if (rafIdRef.current)
|
|
16931
16951
|
return;
|
|
16932
|
-
|
|
16952
|
+
rafIdRef.current = requestAnimationFrame(() => {
|
|
16933
16953
|
const container = containerRef?.current;
|
|
16934
16954
|
let x = e.clientX;
|
|
16935
16955
|
let y = e.clientY;
|
|
@@ -16938,24 +16958,24 @@ var SplashCursor = ({
|
|
|
16938
16958
|
x = e.clientX - rect.left;
|
|
16939
16959
|
y = e.clientY - rect.top;
|
|
16940
16960
|
if (x < 0 || y < 0 || x > rect.width || y > rect.height) {
|
|
16961
|
+
rafIdRef.current = null;
|
|
16941
16962
|
return;
|
|
16942
16963
|
}
|
|
16943
16964
|
}
|
|
16944
16965
|
const now = Date.now();
|
|
16945
|
-
const timeDiff = now -
|
|
16946
|
-
const distance = calculateDistance(
|
|
16947
|
-
lastPos.current.x,
|
|
16948
|
-
lastPos.current.y,
|
|
16949
|
-
x,
|
|
16950
|
-
y
|
|
16951
|
-
);
|
|
16952
|
-
setCursorPos({ x, y });
|
|
16966
|
+
const timeDiff = now - lastMoveTimeRef.current;
|
|
16953
16967
|
if (timeDiff > 0) {
|
|
16968
|
+
const distance = calculateDistance(
|
|
16969
|
+
lastPosRef.current.x,
|
|
16970
|
+
lastPosRef.current.y,
|
|
16971
|
+
x,
|
|
16972
|
+
y
|
|
16973
|
+
);
|
|
16954
16974
|
const speed = distance / timeDiff;
|
|
16955
16975
|
if (speed > threshold) {
|
|
16956
16976
|
if (targetSelector) {
|
|
16957
16977
|
const target = e.target;
|
|
16958
|
-
if (target
|
|
16978
|
+
if (target?.closest(targetSelector)) {
|
|
16959
16979
|
createSplash(x, y);
|
|
16960
16980
|
}
|
|
16961
16981
|
} else {
|
|
@@ -16963,39 +16983,52 @@ var SplashCursor = ({
|
|
|
16963
16983
|
}
|
|
16964
16984
|
}
|
|
16965
16985
|
}
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
|
|
16970
|
-
|
|
16971
|
-
|
|
16972
|
-
|
|
16973
|
-
|
|
16974
|
-
|
|
16975
|
-
|
|
16976
|
-
|
|
16977
|
-
|
|
16978
|
-
|
|
16979
|
-
|
|
16986
|
+
lastPosRef.current = { x, y };
|
|
16987
|
+
lastMoveTimeRef.current = now;
|
|
16988
|
+
rafIdRef.current = null;
|
|
16989
|
+
});
|
|
16990
|
+
}, [threshold, targetSelector, createSplash, containerRef]);
|
|
16991
|
+
const handleClick2 = useCallback((e) => {
|
|
16992
|
+
const container = containerRef?.current;
|
|
16993
|
+
let x = e.clientX;
|
|
16994
|
+
let y = e.clientY;
|
|
16995
|
+
if (container) {
|
|
16996
|
+
const rect = container.getBoundingClientRect();
|
|
16997
|
+
x = e.clientX - rect.left;
|
|
16998
|
+
y = e.clientY - rect.top;
|
|
16999
|
+
if (x < 0 || y < 0 || x > rect.width || y > rect.height) {
|
|
17000
|
+
return;
|
|
16980
17001
|
}
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
}
|
|
16986
|
-
} else {
|
|
17002
|
+
}
|
|
17003
|
+
if (targetSelector) {
|
|
17004
|
+
const target = e.target;
|
|
17005
|
+
if (target?.closest(targetSelector)) {
|
|
16987
17006
|
createSplash(x, y);
|
|
16988
17007
|
}
|
|
16989
|
-
}
|
|
17008
|
+
} else {
|
|
17009
|
+
createSplash(x, y);
|
|
17010
|
+
}
|
|
17011
|
+
}, [targetSelector, createSplash, containerRef]);
|
|
17012
|
+
useEffect(() => {
|
|
17013
|
+
if (!enabled)
|
|
17014
|
+
return;
|
|
16990
17015
|
const targetElement = containerRef?.current || document;
|
|
16991
|
-
|
|
16992
|
-
|
|
17016
|
+
const moveHandler = handleMouseMoveThrottled;
|
|
17017
|
+
const clickHandler2 = handleClick2;
|
|
17018
|
+
targetElement.addEventListener("mousemove", moveHandler);
|
|
17019
|
+
targetElement.addEventListener("click", clickHandler2);
|
|
16993
17020
|
return () => {
|
|
16994
|
-
targetElement.removeEventListener("mousemove",
|
|
16995
|
-
targetElement.removeEventListener("click",
|
|
17021
|
+
targetElement.removeEventListener("mousemove", moveHandler);
|
|
17022
|
+
targetElement.removeEventListener("click", clickHandler2);
|
|
17023
|
+
if (rafIdRef.current) {
|
|
17024
|
+
cancelAnimationFrame(rafIdRef.current);
|
|
17025
|
+
rafIdRef.current = null;
|
|
17026
|
+
}
|
|
17027
|
+
splashTimersRef.current.forEach((timer) => clearTimeout(timer));
|
|
17028
|
+
splashTimersRef.current.clear();
|
|
16996
17029
|
};
|
|
16997
|
-
}, [enabled,
|
|
16998
|
-
const
|
|
17030
|
+
}, [enabled, handleMouseMoveThrottled, handleClick2, containerRef]);
|
|
17031
|
+
const animationVariants2 = useMemo(() => {
|
|
16999
17032
|
switch (animationType) {
|
|
17000
17033
|
case "ripple":
|
|
17001
17034
|
return {
|
|
@@ -17022,14 +17055,25 @@ var SplashCursor = ({
|
|
|
17022
17055
|
exit: { scale: 3, opacity: 0 }
|
|
17023
17056
|
};
|
|
17024
17057
|
}
|
|
17025
|
-
};
|
|
17026
|
-
const
|
|
17027
|
-
const getColor = (index2) => {
|
|
17058
|
+
}, [animationType]);
|
|
17059
|
+
const getColor = useCallback((index2) => {
|
|
17028
17060
|
if (colors && colors.length > 0) {
|
|
17029
17061
|
return colors[index2 % colors.length];
|
|
17030
17062
|
}
|
|
17031
17063
|
return "";
|
|
17032
|
-
};
|
|
17064
|
+
}, [colors]);
|
|
17065
|
+
const particleAngles = useMemo(() => {
|
|
17066
|
+
if (!showParticles)
|
|
17067
|
+
return [];
|
|
17068
|
+
return Array.from({ length: particleCount }).map((_, i) => {
|
|
17069
|
+
const angle = 360 / particleCount * i;
|
|
17070
|
+
const radian = angle * Math.PI / 180;
|
|
17071
|
+
return {
|
|
17072
|
+
x: Math.cos(radian) * 30,
|
|
17073
|
+
y: Math.sin(radian) * 30
|
|
17074
|
+
};
|
|
17075
|
+
});
|
|
17076
|
+
}, [showParticles, particleCount]);
|
|
17033
17077
|
const { hasProAccess, isLoading } = useSubscription();
|
|
17034
17078
|
if (!isLoading && !hasProAccess) {
|
|
17035
17079
|
return /* @__PURE__ */ jsx(
|
|
@@ -17046,7 +17090,8 @@ var SplashCursor = ({
|
|
|
17046
17090
|
return /* @__PURE__ */ jsx("div", { className: cn(
|
|
17047
17091
|
"pointer-events-none z-[9999]",
|
|
17048
17092
|
containerRef ? "absolute inset-0" : "fixed inset-0"
|
|
17049
|
-
), children: /* @__PURE__ */ jsx(AnimatePresence, { children: splashes.map((splash, index2) =>
|
|
17093
|
+
), children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: splashes.map((splash, index2) => [
|
|
17094
|
+
/* Ana splash efekti */
|
|
17050
17095
|
/* @__PURE__ */ jsx(
|
|
17051
17096
|
motion.div,
|
|
17052
17097
|
{
|
|
@@ -17057,9 +17102,9 @@ var SplashCursor = ({
|
|
|
17057
17102
|
style: {
|
|
17058
17103
|
position: "absolute",
|
|
17059
17104
|
left: splash.x - 12,
|
|
17060
|
-
// Merkeze hizala
|
|
17061
17105
|
top: splash.y - 12,
|
|
17062
|
-
backgroundColor: getColor(index2) || void 0
|
|
17106
|
+
backgroundColor: getColor(index2) || void 0,
|
|
17107
|
+
willChange: "transform, opacity"
|
|
17063
17108
|
},
|
|
17064
17109
|
variants: animationVariants2,
|
|
17065
17110
|
initial: "initial",
|
|
@@ -17069,43 +17114,37 @@ var SplashCursor = ({
|
|
|
17069
17114
|
duration: duration / 1e3,
|
|
17070
17115
|
ease: "easeOut"
|
|
17071
17116
|
}
|
|
17072
|
-
}
|
|
17117
|
+
},
|
|
17118
|
+
splash.id
|
|
17073
17119
|
),
|
|
17074
|
-
|
|
17075
|
-
|
|
17076
|
-
|
|
17077
|
-
|
|
17078
|
-
|
|
17079
|
-
|
|
17080
|
-
|
|
17081
|
-
|
|
17082
|
-
|
|
17083
|
-
|
|
17084
|
-
top: splash.y,
|
|
17085
|
-
color: getColor(index2 + particleIndex) || "currentColor"
|
|
17086
|
-
},
|
|
17087
|
-
initial: {
|
|
17088
|
-
x: 0,
|
|
17089
|
-
y: 0,
|
|
17090
|
-
opacity: 1,
|
|
17091
|
-
scale: 1
|
|
17092
|
-
},
|
|
17093
|
-
animate: {
|
|
17094
|
-
x: Math.cos(radian) * distance,
|
|
17095
|
-
y: Math.sin(radian) * distance,
|
|
17096
|
-
opacity: 0,
|
|
17097
|
-
scale: 0
|
|
17098
|
-
},
|
|
17099
|
-
transition: {
|
|
17100
|
-
duration: duration / 1e3,
|
|
17101
|
-
ease: "easeOut"
|
|
17102
|
-
}
|
|
17120
|
+
/* Optimized particle rendering */
|
|
17121
|
+
...showParticles ? particleAngles.map((angle, particleIndex) => /* @__PURE__ */ jsx(
|
|
17122
|
+
motion.div,
|
|
17123
|
+
{
|
|
17124
|
+
className: "absolute w-1 h-1 bg-current rounded-full",
|
|
17125
|
+
style: {
|
|
17126
|
+
left: splash.x,
|
|
17127
|
+
top: splash.y,
|
|
17128
|
+
color: getColor(index2 + particleIndex) || "currentColor",
|
|
17129
|
+
willChange: "transform, opacity"
|
|
17103
17130
|
},
|
|
17104
|
-
|
|
17105
|
-
|
|
17106
|
-
|
|
17107
|
-
|
|
17131
|
+
initial: { x: 0, y: 0, opacity: 1, scale: 1 },
|
|
17132
|
+
animate: {
|
|
17133
|
+
x: angle.x,
|
|
17134
|
+
y: angle.y,
|
|
17135
|
+
opacity: 0,
|
|
17136
|
+
scale: 0
|
|
17137
|
+
},
|
|
17138
|
+
transition: {
|
|
17139
|
+
duration: duration / 1e3,
|
|
17140
|
+
ease: "easeOut"
|
|
17141
|
+
}
|
|
17142
|
+
},
|
|
17143
|
+
`${splash.id}-p${particleIndex}`
|
|
17144
|
+
)) : []
|
|
17145
|
+
]).flat() }) });
|
|
17108
17146
|
};
|
|
17147
|
+
var SplashCursor = React68__default.memo(SplashCursorComponent);
|
|
17109
17148
|
SplashCursor.displayName = "SplashCursor";
|
|
17110
17149
|
var SplashCursorContainer = ({
|
|
17111
17150
|
className,
|
|
@@ -29103,7 +29142,7 @@ var ViewDesc = class {
|
|
|
29103
29142
|
if (!(force || brKludge && safari) && isEquivalentPosition(anchorDOM.node, anchorDOM.offset, selRange.anchorNode, selRange.anchorOffset) && isEquivalentPosition(headDOM.node, headDOM.offset, selRange.focusNode, selRange.focusOffset))
|
|
29104
29143
|
return;
|
|
29105
29144
|
let domSelExtended = false;
|
|
29106
|
-
if ((domSel.extend || anchor == head) && !
|
|
29145
|
+
if ((domSel.extend || anchor == head) && !brKludge) {
|
|
29107
29146
|
domSel.collapse(anchorDOM.node, anchorDOM.offset);
|
|
29108
29147
|
try {
|
|
29109
29148
|
if (anchor != head)
|
|
@@ -29486,18 +29525,17 @@ var NodeViewDesc = class extends ViewDesc {
|
|
|
29486
29525
|
}
|
|
29487
29526
|
// Mark this node as being the selected node.
|
|
29488
29527
|
selectNode() {
|
|
29489
|
-
if (this.nodeDOM.nodeType == 1)
|
|
29528
|
+
if (this.nodeDOM.nodeType == 1)
|
|
29490
29529
|
this.nodeDOM.classList.add("ProseMirror-selectednode");
|
|
29491
|
-
|
|
29492
|
-
|
|
29493
|
-
}
|
|
29530
|
+
if (this.contentDOM || !this.node.type.spec.draggable)
|
|
29531
|
+
this.dom.draggable = true;
|
|
29494
29532
|
}
|
|
29495
29533
|
// Remove selected node marking from this node.
|
|
29496
29534
|
deselectNode() {
|
|
29497
29535
|
if (this.nodeDOM.nodeType == 1) {
|
|
29498
29536
|
this.nodeDOM.classList.remove("ProseMirror-selectednode");
|
|
29499
29537
|
if (this.contentDOM || !this.node.type.spec.draggable)
|
|
29500
|
-
this.
|
|
29538
|
+
this.dom.removeAttribute("draggable");
|
|
29501
29539
|
}
|
|
29502
29540
|
}
|
|
29503
29541
|
get domAtom() {
|
|
@@ -30262,14 +30300,17 @@ function removeClassOnSelectionChange(view) {
|
|
|
30262
30300
|
});
|
|
30263
30301
|
}
|
|
30264
30302
|
function selectCursorWrapper(view) {
|
|
30265
|
-
let domSel = view.domSelection();
|
|
30303
|
+
let domSel = view.domSelection(), range = document.createRange();
|
|
30266
30304
|
if (!domSel)
|
|
30267
30305
|
return;
|
|
30268
30306
|
let node = view.cursorWrapper.dom, img = node.nodeName == "IMG";
|
|
30269
30307
|
if (img)
|
|
30270
|
-
|
|
30308
|
+
range.setStart(node.parentNode, domIndex(node) + 1);
|
|
30271
30309
|
else
|
|
30272
|
-
|
|
30310
|
+
range.setStart(node, 0);
|
|
30311
|
+
range.collapse(true);
|
|
30312
|
+
domSel.removeAllRanges();
|
|
30313
|
+
domSel.addRange(range);
|
|
30273
30314
|
if (!img && !view.state.selection.visible && ie && ie_version <= 11) {
|
|
30274
30315
|
node.disabled = true;
|
|
30275
30316
|
node.disabled = false;
|
|
@@ -30679,18 +30720,13 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
30679
30720
|
let dom, slice2;
|
|
30680
30721
|
if (!html && !text)
|
|
30681
30722
|
return null;
|
|
30682
|
-
let asText =
|
|
30723
|
+
let asText = text && (plainText || inCode || !html);
|
|
30683
30724
|
if (asText) {
|
|
30684
30725
|
view.someProp("transformPastedText", (f) => {
|
|
30685
30726
|
text = f(text, inCode || plainText, view);
|
|
30686
30727
|
});
|
|
30687
|
-
if (inCode)
|
|
30688
|
-
|
|
30689
|
-
view.someProp("transformPasted", (f) => {
|
|
30690
|
-
slice2 = f(slice2, view, true);
|
|
30691
|
-
});
|
|
30692
|
-
return slice2;
|
|
30693
|
-
}
|
|
30728
|
+
if (inCode)
|
|
30729
|
+
return text ? new Slice(Fragment17.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0) : Slice.empty;
|
|
30694
30730
|
let parsed = view.someProp("clipboardTextParser", (f) => f(text, $context, plainText, view));
|
|
30695
30731
|
if (parsed) {
|
|
30696
30732
|
slice2 = parsed;
|
|
@@ -30749,7 +30785,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
30749
30785
|
}
|
|
30750
30786
|
}
|
|
30751
30787
|
view.someProp("transformPasted", (f) => {
|
|
30752
|
-
slice2 = f(slice2, view
|
|
30788
|
+
slice2 = f(slice2, view);
|
|
30753
30789
|
});
|
|
30754
30790
|
return slice2;
|
|
30755
30791
|
}
|
|
@@ -31159,7 +31195,7 @@ var MouseDown = class {
|
|
|
31159
31195
|
}
|
|
31160
31196
|
const target = flushed ? null : event.target;
|
|
31161
31197
|
const targetDesc = target ? view.docView.nearestDesc(target, true) : null;
|
|
31162
|
-
this.target = targetDesc && targetDesc.
|
|
31198
|
+
this.target = targetDesc && targetDesc.dom.nodeType == 1 ? targetDesc.dom : null;
|
|
31163
31199
|
let { selection } = view.state;
|
|
31164
31200
|
if (event.button == 0 && targetNode.type.spec.draggable && targetNode.type.spec.selectable !== false || selection instanceof NodeSelection && selection.from <= targetPos && selection.to > targetPos)
|
|
31165
31201
|
this.mightDrag = {
|
|
@@ -31505,7 +31541,7 @@ editHandlers.drop = (view, _event) => {
|
|
|
31505
31541
|
let slice2 = dragging && dragging.slice;
|
|
31506
31542
|
if (slice2) {
|
|
31507
31543
|
view.someProp("transformPasted", (f) => {
|
|
31508
|
-
slice2 = f(slice2, view
|
|
31544
|
+
slice2 = f(slice2, view);
|
|
31509
31545
|
});
|
|
31510
31546
|
} else {
|
|
31511
31547
|
slice2 = parseFromClipboard(view, getText(event.dataTransfer), brokenClipboardAPI ? null : event.dataTransfer.getData("text/html"), false, $mouse);
|
|
@@ -35336,8 +35372,10 @@ function selectionToInsertionEnd2(tr2, startLen, bias) {
|
|
|
35336
35372
|
}
|
|
35337
35373
|
var InputRule = class {
|
|
35338
35374
|
constructor(config) {
|
|
35375
|
+
var _a2;
|
|
35339
35376
|
this.find = config.find;
|
|
35340
35377
|
this.handler = config.handler;
|
|
35378
|
+
this.undoable = (_a2 = config.undoable) != null ? _a2 : true;
|
|
35341
35379
|
}
|
|
35342
35380
|
};
|
|
35343
35381
|
var inputRuleMatcherHandler = (text, find2) => {
|
|
@@ -35409,12 +35447,14 @@ function run(config) {
|
|
|
35409
35447
|
if (handler === null || !tr2.steps.length) {
|
|
35410
35448
|
return;
|
|
35411
35449
|
}
|
|
35412
|
-
|
|
35413
|
-
|
|
35414
|
-
|
|
35415
|
-
|
|
35416
|
-
|
|
35417
|
-
|
|
35450
|
+
if (rule.undoable) {
|
|
35451
|
+
tr2.setMeta(plugin, {
|
|
35452
|
+
transform: tr2,
|
|
35453
|
+
from: from2,
|
|
35454
|
+
to,
|
|
35455
|
+
text
|
|
35456
|
+
});
|
|
35457
|
+
}
|
|
35418
35458
|
view.dispatch(tr2);
|
|
35419
35459
|
matched = true;
|
|
35420
35460
|
});
|
|
@@ -35891,7 +35931,7 @@ var ExtensionManager = class {
|
|
|
35891
35931
|
get plugins() {
|
|
35892
35932
|
const { editor } = this;
|
|
35893
35933
|
const extensions = sortExtensions([...this.extensions].reverse());
|
|
35894
|
-
const allPlugins = extensions.
|
|
35934
|
+
const allPlugins = extensions.flatMap((extension) => {
|
|
35895
35935
|
const context = {
|
|
35896
35936
|
name: extension.name,
|
|
35897
35937
|
options: extension.options,
|
|
@@ -35949,7 +35989,7 @@ var ExtensionManager = class {
|
|
|
35949
35989
|
plugins.push(...proseMirrorPlugins);
|
|
35950
35990
|
}
|
|
35951
35991
|
return plugins;
|
|
35952
|
-
})
|
|
35992
|
+
});
|
|
35953
35993
|
return allPlugins;
|
|
35954
35994
|
}
|
|
35955
35995
|
/**
|
|
@@ -37912,6 +37952,9 @@ var Editor = class extends EventEmitter {
|
|
|
37912
37952
|
}
|
|
37913
37953
|
this.createView(el);
|
|
37914
37954
|
this.emit("mount", { editor: this });
|
|
37955
|
+
if (this.css && !document.head.contains(this.css)) {
|
|
37956
|
+
document.head.appendChild(this.css);
|
|
37957
|
+
}
|
|
37915
37958
|
window.setTimeout(() => {
|
|
37916
37959
|
if (this.isDestroyed) {
|
|
37917
37960
|
return;
|
|
@@ -38027,7 +38070,7 @@ var Editor = class extends EventEmitter {
|
|
|
38027
38070
|
this.editorState = state;
|
|
38028
38071
|
},
|
|
38029
38072
|
dispatch: (tr2) => {
|
|
38030
|
-
this.
|
|
38073
|
+
this.dispatchTransaction(tr2);
|
|
38031
38074
|
},
|
|
38032
38075
|
// Stub some commonly accessed properties to prevent errors
|
|
38033
38076
|
composing: false,
|
|
@@ -38398,7 +38441,8 @@ function markInputRule(config) {
|
|
|
38398
38441
|
tr2.addMark(range.from + startSpaces, markEnd, config.type.create(attributes || {}));
|
|
38399
38442
|
tr2.removeStoredMark(config.type);
|
|
38400
38443
|
}
|
|
38401
|
-
}
|
|
38444
|
+
},
|
|
38445
|
+
undoable: config.undoable
|
|
38402
38446
|
});
|
|
38403
38447
|
}
|
|
38404
38448
|
function nodeInputRule(config) {
|
|
@@ -38426,7 +38470,8 @@ function nodeInputRule(config) {
|
|
|
38426
38470
|
tr2.insert(insertionStart, config.type.create(attributes)).delete(tr2.mapping.map(start), tr2.mapping.map(end));
|
|
38427
38471
|
}
|
|
38428
38472
|
tr2.scrollIntoView();
|
|
38429
|
-
}
|
|
38473
|
+
},
|
|
38474
|
+
undoable: config.undoable
|
|
38430
38475
|
});
|
|
38431
38476
|
}
|
|
38432
38477
|
function textblockTypeInputRule(config) {
|
|
@@ -38439,7 +38484,8 @@ function textblockTypeInputRule(config) {
|
|
|
38439
38484
|
return null;
|
|
38440
38485
|
}
|
|
38441
38486
|
state.tr.delete(range.from, range.to).setBlockType(range.from, range.from, config.type, attributes);
|
|
38442
|
-
}
|
|
38487
|
+
},
|
|
38488
|
+
undoable: config.undoable
|
|
38443
38489
|
});
|
|
38444
38490
|
}
|
|
38445
38491
|
function textInputRule(config) {
|
|
@@ -38460,7 +38506,8 @@ function textInputRule(config) {
|
|
|
38460
38506
|
}
|
|
38461
38507
|
}
|
|
38462
38508
|
state.tr.insertText(insert, start, end);
|
|
38463
|
-
}
|
|
38509
|
+
},
|
|
38510
|
+
undoable: config.undoable
|
|
38464
38511
|
});
|
|
38465
38512
|
}
|
|
38466
38513
|
function wrappingInputRule(config) {
|
|
@@ -38493,7 +38540,8 @@ function wrappingInputRule(config) {
|
|
|
38493
38540
|
if (before && before.type === config.type && canJoin(tr2.doc, range.from - 1) && (!config.joinPredicate || config.joinPredicate(match, before))) {
|
|
38494
38541
|
tr2.join(range.from - 1);
|
|
38495
38542
|
}
|
|
38496
|
-
}
|
|
38543
|
+
},
|
|
38544
|
+
undoable: config.undoable
|
|
38497
38545
|
});
|
|
38498
38546
|
}
|
|
38499
38547
|
function canInsertNode(state, nodeType) {
|
|
@@ -78087,6 +78135,74 @@ function Sidebar(props) {
|
|
|
78087
78135
|
return /* @__PURE__ */ jsx(SidebarInternal, { ...props });
|
|
78088
78136
|
}
|
|
78089
78137
|
init_use_subscription();
|
|
78138
|
+
function useNavbarScroll({
|
|
78139
|
+
sticky = true,
|
|
78140
|
+
hideOnScroll = false,
|
|
78141
|
+
showScrollProgress = false,
|
|
78142
|
+
scrollBehavior = "static",
|
|
78143
|
+
minimalConfig = {}
|
|
78144
|
+
} = {}) {
|
|
78145
|
+
const [scrolled, setScrolled] = useState(false);
|
|
78146
|
+
const [hidden, setHidden] = useState(false);
|
|
78147
|
+
const [scrollProgress, setScrollProgress] = useState(0);
|
|
78148
|
+
const [isMinimal, setIsMinimal] = useState(false);
|
|
78149
|
+
const [scrollY, setScrollY] = useState(0);
|
|
78150
|
+
const lastScrollY = useRef(0);
|
|
78151
|
+
const ticking = useRef(false);
|
|
78152
|
+
const {
|
|
78153
|
+
scrollThreshold = 50,
|
|
78154
|
+
animationDuration = 300
|
|
78155
|
+
} = minimalConfig;
|
|
78156
|
+
const updateScrollState = useCallback(() => {
|
|
78157
|
+
const currentScrollY = window.scrollY;
|
|
78158
|
+
setScrollY(currentScrollY);
|
|
78159
|
+
const isScrolled = currentScrollY > 10;
|
|
78160
|
+
setScrolled(isScrolled);
|
|
78161
|
+
if (scrollBehavior === "hide" || hideOnScroll) {
|
|
78162
|
+
if (currentScrollY > lastScrollY.current && currentScrollY > 100) {
|
|
78163
|
+
setHidden(true);
|
|
78164
|
+
} else {
|
|
78165
|
+
setHidden(false);
|
|
78166
|
+
}
|
|
78167
|
+
} else if (scrollBehavior === "minimal") {
|
|
78168
|
+
const shouldBeMinimal = currentScrollY > scrollThreshold;
|
|
78169
|
+
if (shouldBeMinimal !== isMinimal) {
|
|
78170
|
+
setIsMinimal(shouldBeMinimal);
|
|
78171
|
+
}
|
|
78172
|
+
}
|
|
78173
|
+
if (showScrollProgress) {
|
|
78174
|
+
const winScroll = window.scrollY;
|
|
78175
|
+
const height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
|
|
78176
|
+
const progress = height > 0 ? winScroll / height * 100 : 0;
|
|
78177
|
+
setScrollProgress(Math.min(100, Math.max(0, progress)));
|
|
78178
|
+
}
|
|
78179
|
+
lastScrollY.current = currentScrollY;
|
|
78180
|
+
ticking.current = false;
|
|
78181
|
+
}, [hideOnScroll, scrollBehavior, showScrollProgress, scrollThreshold, isMinimal]);
|
|
78182
|
+
const requestTick = useCallback(() => {
|
|
78183
|
+
if (!ticking.current) {
|
|
78184
|
+
requestAnimationFrame(updateScrollState);
|
|
78185
|
+
ticking.current = true;
|
|
78186
|
+
}
|
|
78187
|
+
}, [updateScrollState]);
|
|
78188
|
+
useEffect(() => {
|
|
78189
|
+
if (!sticky && scrollBehavior === "static" && !showScrollProgress) {
|
|
78190
|
+
return;
|
|
78191
|
+
}
|
|
78192
|
+
updateScrollState();
|
|
78193
|
+
window.addEventListener("scroll", requestTick, { passive: true });
|
|
78194
|
+
return () => {
|
|
78195
|
+
window.removeEventListener("scroll", requestTick);
|
|
78196
|
+
};
|
|
78197
|
+
}, [sticky, scrollBehavior, showScrollProgress, requestTick, updateScrollState]);
|
|
78198
|
+
return {
|
|
78199
|
+
scrolled,
|
|
78200
|
+
hidden,
|
|
78201
|
+
scrollProgress,
|
|
78202
|
+
isMinimal,
|
|
78203
|
+
scrollY
|
|
78204
|
+
};
|
|
78205
|
+
}
|
|
78090
78206
|
function NavbarInternal({
|
|
78091
78207
|
sections = [],
|
|
78092
78208
|
branding,
|
|
@@ -78102,6 +78218,7 @@ function NavbarInternal({
|
|
|
78102
78218
|
showThemeToggle = false,
|
|
78103
78219
|
theme = "system",
|
|
78104
78220
|
onThemeChange,
|
|
78221
|
+
themeToggleVariant = "dropdown",
|
|
78105
78222
|
userMenu,
|
|
78106
78223
|
notifications,
|
|
78107
78224
|
cta,
|
|
@@ -78118,9 +78235,12 @@ function NavbarInternal({
|
|
|
78118
78235
|
shadow = false,
|
|
78119
78236
|
rounded = false,
|
|
78120
78237
|
logoPosition = "left",
|
|
78238
|
+
navItemsPosition = "left",
|
|
78121
78239
|
mobileMenuPosition = "left",
|
|
78122
78240
|
hideOnScroll = false,
|
|
78123
78241
|
showScrollProgress = false,
|
|
78242
|
+
scrollBehavior = "static",
|
|
78243
|
+
minimalConfig = {},
|
|
78124
78244
|
maxWidth = "2xl",
|
|
78125
78245
|
fullWidth = false,
|
|
78126
78246
|
enableNProgress = true,
|
|
@@ -78133,11 +78253,15 @@ function NavbarInternal({
|
|
|
78133
78253
|
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
78134
78254
|
const [isCommandOpen, setIsCommandOpen] = useState(false);
|
|
78135
78255
|
const [searchValue, setSearchValue] = useState("");
|
|
78136
|
-
const [
|
|
78137
|
-
const [hidden, setHidden] = useState(false);
|
|
78138
|
-
const [scrollProgress, setScrollProgress] = useState(0);
|
|
78139
|
-
const lastScrollY = useRef(0);
|
|
78256
|
+
const [currentTheme, setCurrentTheme] = useState(theme);
|
|
78140
78257
|
const navRef = useRef(null);
|
|
78258
|
+
const { scrolled, hidden, scrollProgress, isMinimal } = useNavbarScroll({
|
|
78259
|
+
sticky,
|
|
78260
|
+
hideOnScroll,
|
|
78261
|
+
showScrollProgress,
|
|
78262
|
+
scrollBehavior,
|
|
78263
|
+
minimalConfig
|
|
78264
|
+
});
|
|
78141
78265
|
useEffect(() => {
|
|
78142
78266
|
if (enableNProgress) {
|
|
78143
78267
|
NProgress.configure({
|
|
@@ -78158,29 +78282,8 @@ function NavbarInternal({
|
|
|
78158
78282
|
return () => window.removeEventListener("resize", checkMobile);
|
|
78159
78283
|
}, [mobileBreakpoint]);
|
|
78160
78284
|
useEffect(() => {
|
|
78161
|
-
|
|
78162
|
-
|
|
78163
|
-
const handleScroll = () => {
|
|
78164
|
-
const currentScrollY = window.scrollY;
|
|
78165
|
-
setScrolled(currentScrollY > 10);
|
|
78166
|
-
if (hideOnScroll) {
|
|
78167
|
-
if (currentScrollY > lastScrollY.current && currentScrollY > 100) {
|
|
78168
|
-
setHidden(true);
|
|
78169
|
-
} else {
|
|
78170
|
-
setHidden(false);
|
|
78171
|
-
}
|
|
78172
|
-
lastScrollY.current = currentScrollY;
|
|
78173
|
-
}
|
|
78174
|
-
if (showScrollProgress) {
|
|
78175
|
-
const winScroll = window.scrollY;
|
|
78176
|
-
const height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
|
|
78177
|
-
const scrolled2 = winScroll / height * 100;
|
|
78178
|
-
setScrollProgress(scrolled2);
|
|
78179
|
-
}
|
|
78180
|
-
};
|
|
78181
|
-
window.addEventListener("scroll", handleScroll, { passive: true });
|
|
78182
|
-
return () => window.removeEventListener("scroll", handleScroll);
|
|
78183
|
-
}, [sticky, hideOnScroll, showScrollProgress]);
|
|
78285
|
+
setCurrentTheme(theme);
|
|
78286
|
+
}, [theme]);
|
|
78184
78287
|
useEffect(() => {
|
|
78185
78288
|
if (!keyboardShortcuts && !enableCommandAI)
|
|
78186
78289
|
return;
|
|
@@ -78228,7 +78331,7 @@ function NavbarInternal({
|
|
|
78228
78331
|
NavigationMenuLink2,
|
|
78229
78332
|
{
|
|
78230
78333
|
className: cn(
|
|
78231
|
-
"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
|
|
78334
|
+
"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground cursor-pointer",
|
|
78232
78335
|
item.disabled && "opacity-50 cursor-not-allowed"
|
|
78233
78336
|
),
|
|
78234
78337
|
onClick: () => !item.disabled && handleItemClick(item),
|
|
@@ -78363,6 +78466,9 @@ function NavbarInternal({
|
|
|
78363
78466
|
] }) })
|
|
78364
78467
|
] });
|
|
78365
78468
|
const getHeight = () => {
|
|
78469
|
+
if (isMinimal && minimalConfig?.heightOnScroll) {
|
|
78470
|
+
return minimalConfig.heightOnScroll;
|
|
78471
|
+
}
|
|
78366
78472
|
switch (size4) {
|
|
78367
78473
|
case "sm":
|
|
78368
78474
|
return "h-14";
|
|
@@ -78372,8 +78478,12 @@ function NavbarInternal({
|
|
|
78372
78478
|
return "h-16";
|
|
78373
78479
|
}
|
|
78374
78480
|
};
|
|
78481
|
+
const shouldHideInMinimal = (element) => {
|
|
78482
|
+
return isMinimal && minimalConfig?.hideElements?.includes(element);
|
|
78483
|
+
};
|
|
78375
78484
|
const navClasses = cn(
|
|
78376
|
-
"moonui-pro w-full transition-all
|
|
78485
|
+
"moonui-pro w-full transition-all",
|
|
78486
|
+
`duration-${minimalConfig?.animationDuration || 300}`,
|
|
78377
78487
|
// Base variant styles
|
|
78378
78488
|
variant === "default" && "border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",
|
|
78379
78489
|
variant === "floating" && "mx-4 mt-4 rounded-lg border bg-background/95 backdrop-blur shadow-lg",
|
|
@@ -78384,7 +78494,10 @@ function NavbarInternal({
|
|
|
78384
78494
|
// Scroll states
|
|
78385
78495
|
scrolled && sticky && variant !== "transparent" && "shadow-sm",
|
|
78386
78496
|
scrolled && variant === "transparent" && "bg-background/95 backdrop-blur border-b",
|
|
78387
|
-
hidden && "-translate-y-full",
|
|
78497
|
+
scrollBehavior === "hide" && hidden && "-translate-y-full",
|
|
78498
|
+
// Minimal mode styles
|
|
78499
|
+
scrollBehavior === "minimal" && isMinimal && "shadow-md border-b",
|
|
78500
|
+
scrollBehavior === "minimal" && isMinimal && minimalConfig?.centerOnScroll && "px-8",
|
|
78388
78501
|
// Glass effect
|
|
78389
78502
|
glassmorphism && "bg-background/80 backdrop-blur-xl border-white/10",
|
|
78390
78503
|
blur2 && "backdrop-blur-md",
|
|
@@ -78407,12 +78520,17 @@ function NavbarInternal({
|
|
|
78407
78520
|
),
|
|
78408
78521
|
children: [
|
|
78409
78522
|
branding && /* @__PURE__ */ jsxs(
|
|
78410
|
-
|
|
78523
|
+
motion.div,
|
|
78411
78524
|
{
|
|
78412
78525
|
className: cn(
|
|
78413
78526
|
"flex items-center gap-2",
|
|
78414
78527
|
logoPosition === "center" && !isMobile ? "absolute left-1/2 -translate-x-1/2" : "mr-4"
|
|
78415
78528
|
),
|
|
78529
|
+
animate: {
|
|
78530
|
+
scale: isMinimal ? 0.9 : 1,
|
|
78531
|
+
opacity: shouldHideInMinimal("logo-text") ? 0.8 : 1
|
|
78532
|
+
},
|
|
78533
|
+
transition: { duration: minimalConfig?.animationDuration ? minimalConfig.animationDuration / 1e3 : 0.3 },
|
|
78416
78534
|
children: [
|
|
78417
78535
|
logoPosition === "left" && mobileMenuPosition === "left" && /* @__PURE__ */ jsx(MobileMenu, {}),
|
|
78418
78536
|
/* @__PURE__ */ jsxs(
|
|
@@ -78428,79 +78546,104 @@ function NavbarInternal({
|
|
|
78428
78546
|
className: "flex items-center gap-2",
|
|
78429
78547
|
children: [
|
|
78430
78548
|
branding.logo,
|
|
78431
|
-
branding.title && !isMobile && /* @__PURE__ */ jsx(
|
|
78549
|
+
branding.title && !isMobile && !shouldHideInMinimal("logo-text") && /* @__PURE__ */ jsx(
|
|
78550
|
+
motion.span,
|
|
78551
|
+
{
|
|
78552
|
+
className: "font-semibold text-lg",
|
|
78553
|
+
animate: {
|
|
78554
|
+
opacity: shouldHideInMinimal("logo-text") ? 0 : 1,
|
|
78555
|
+
width: shouldHideInMinimal("logo-text") ? 0 : "auto"
|
|
78556
|
+
},
|
|
78557
|
+
transition: { duration: 0.3 },
|
|
78558
|
+
children: branding.title
|
|
78559
|
+
}
|
|
78560
|
+
)
|
|
78432
78561
|
]
|
|
78433
78562
|
}
|
|
78434
78563
|
)
|
|
78435
78564
|
]
|
|
78436
78565
|
}
|
|
78437
78566
|
),
|
|
78438
|
-
!isMobile && !hideNavItems && /* @__PURE__ */ jsx(
|
|
78439
|
-
|
|
78440
|
-
|
|
78441
|
-
|
|
78442
|
-
|
|
78443
|
-
|
|
78444
|
-
|
|
78445
|
-
|
|
78446
|
-
|
|
78447
|
-
|
|
78567
|
+
!isMobile && !hideNavItems && /* @__PURE__ */ jsx(
|
|
78568
|
+
NavigationMenu2,
|
|
78569
|
+
{
|
|
78570
|
+
className: cn(
|
|
78571
|
+
"hidden md:flex",
|
|
78572
|
+
navItemsPosition === "center" && "flex-1 justify-center mx-4",
|
|
78573
|
+
navItemsPosition === "right" && "ml-auto",
|
|
78574
|
+
navItemsPosition === "left" && "ml-4",
|
|
78575
|
+
isMinimal && minimalConfig?.centerOnScroll && "flex-1 justify-center",
|
|
78576
|
+
!isMinimal && navItemsPosition === "center" && "absolute left-1/2 transform -translate-x-1/2"
|
|
78577
|
+
),
|
|
78578
|
+
children: /* @__PURE__ */ jsx(NavigationMenuList2, { children: sections.map((section) => /* @__PURE__ */ jsx(React68__default.Fragment, { children: section.items.map((item) => {
|
|
78579
|
+
const hasChildren = item.items && item.items.length > 0;
|
|
78580
|
+
const isActive2 = item.href === activePath;
|
|
78581
|
+
if (hasChildren) {
|
|
78582
|
+
return /* @__PURE__ */ jsxs(
|
|
78583
|
+
NavigationMenuItem2,
|
|
78584
|
+
{
|
|
78585
|
+
children: [
|
|
78586
|
+
/* @__PURE__ */ jsx(
|
|
78587
|
+
NavigationMenuTrigger2,
|
|
78588
|
+
{
|
|
78589
|
+
className: cn(
|
|
78590
|
+
isActive2 && "bg-accent text-accent-foreground",
|
|
78591
|
+
item.disabled && "opacity-50 cursor-not-allowed"
|
|
78592
|
+
),
|
|
78593
|
+
disabled: item.disabled,
|
|
78594
|
+
children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
78595
|
+
item.icon && /* @__PURE__ */ jsx("span", { children: item.icon }),
|
|
78596
|
+
item.title
|
|
78597
|
+
] })
|
|
78598
|
+
}
|
|
78599
|
+
),
|
|
78600
|
+
/* @__PURE__ */ jsx(NavigationMenuContent2, { children: item.items && renderMegaMenuContent(
|
|
78601
|
+
item.items
|
|
78602
|
+
) })
|
|
78603
|
+
]
|
|
78604
|
+
},
|
|
78605
|
+
item.id
|
|
78606
|
+
);
|
|
78607
|
+
}
|
|
78608
|
+
return /* @__PURE__ */ jsx(
|
|
78609
|
+
NavigationMenuItem2,
|
|
78610
|
+
{
|
|
78611
|
+
children: /* @__PURE__ */ jsxs(
|
|
78612
|
+
NavigationMenuLink2,
|
|
78448
78613
|
{
|
|
78449
78614
|
className: cn(
|
|
78615
|
+
navigationMenuTriggerStyle(),
|
|
78616
|
+
"cursor-pointer",
|
|
78450
78617
|
isActive2 && "bg-accent text-accent-foreground",
|
|
78451
78618
|
item.disabled && "opacity-50 cursor-not-allowed"
|
|
78452
78619
|
),
|
|
78453
|
-
|
|
78454
|
-
|
|
78455
|
-
|
|
78456
|
-
|
|
78457
|
-
|
|
78620
|
+
onClick: () => !item.disabled && handleItemClick(
|
|
78621
|
+
item
|
|
78622
|
+
),
|
|
78623
|
+
children: [
|
|
78624
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
78625
|
+
item.icon && /* @__PURE__ */ jsx("span", { children: item.icon }),
|
|
78626
|
+
item.title
|
|
78627
|
+
] }),
|
|
78628
|
+
item.badge && /* @__PURE__ */ jsx(
|
|
78629
|
+
MoonUIBadgePro,
|
|
78630
|
+
{
|
|
78631
|
+
variant: item.badgeVariant || "secondary",
|
|
78632
|
+
className: "ml-2",
|
|
78633
|
+
children: item.badge
|
|
78634
|
+
}
|
|
78635
|
+
)
|
|
78636
|
+
]
|
|
78458
78637
|
}
|
|
78459
|
-
)
|
|
78460
|
-
|
|
78461
|
-
|
|
78462
|
-
|
|
78463
|
-
|
|
78464
|
-
},
|
|
78465
|
-
item.id
|
|
78466
|
-
);
|
|
78638
|
+
)
|
|
78639
|
+
},
|
|
78640
|
+
item.id
|
|
78641
|
+
);
|
|
78642
|
+
}) }, section.id)) })
|
|
78467
78643
|
}
|
|
78468
|
-
|
|
78469
|
-
NavigationMenuItem2,
|
|
78470
|
-
{
|
|
78471
|
-
children: /* @__PURE__ */ jsxs(
|
|
78472
|
-
NavigationMenuLink2,
|
|
78473
|
-
{
|
|
78474
|
-
className: cn(
|
|
78475
|
-
navigationMenuTriggerStyle(),
|
|
78476
|
-
isActive2 && "bg-accent text-accent-foreground",
|
|
78477
|
-
item.disabled && "opacity-50 cursor-not-allowed"
|
|
78478
|
-
),
|
|
78479
|
-
onClick: () => !item.disabled && handleItemClick(
|
|
78480
|
-
item
|
|
78481
|
-
),
|
|
78482
|
-
children: [
|
|
78483
|
-
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
78484
|
-
item.icon && /* @__PURE__ */ jsx("span", { children: item.icon }),
|
|
78485
|
-
item.title
|
|
78486
|
-
] }),
|
|
78487
|
-
item.badge && /* @__PURE__ */ jsx(
|
|
78488
|
-
MoonUIBadgePro,
|
|
78489
|
-
{
|
|
78490
|
-
variant: item.badgeVariant || "secondary",
|
|
78491
|
-
className: "ml-2",
|
|
78492
|
-
children: item.badge
|
|
78493
|
-
}
|
|
78494
|
-
)
|
|
78495
|
-
]
|
|
78496
|
-
}
|
|
78497
|
-
)
|
|
78498
|
-
},
|
|
78499
|
-
item.id
|
|
78500
|
-
);
|
|
78501
|
-
}) }, section.id)) }) }),
|
|
78644
|
+
),
|
|
78502
78645
|
/* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
78503
|
-
showSearch && /* @__PURE__ */ jsx(Fragment, { children: isMobile ? /* @__PURE__ */ jsx(
|
|
78646
|
+
showSearch && !shouldHideInMinimal("search") && /* @__PURE__ */ jsx(Fragment, { children: isMobile ? /* @__PURE__ */ jsx(
|
|
78504
78647
|
MoonUIButtonPro,
|
|
78505
78648
|
{
|
|
78506
78649
|
variant: "ghost",
|
|
@@ -78532,17 +78675,65 @@ function NavbarInternal({
|
|
|
78532
78675
|
"K"
|
|
78533
78676
|
] }) })
|
|
78534
78677
|
] }) }),
|
|
78535
|
-
showThemeToggle && /* @__PURE__ */
|
|
78678
|
+
showThemeToggle && (themeToggleVariant === "button" ? /* @__PURE__ */ jsx(
|
|
78679
|
+
motion.div,
|
|
78680
|
+
{
|
|
78681
|
+
whileTap: { scale: 0.95 },
|
|
78682
|
+
className: "relative",
|
|
78683
|
+
children: /* @__PURE__ */ jsx(
|
|
78684
|
+
MoonUIButtonPro,
|
|
78685
|
+
{
|
|
78686
|
+
variant: "ghost",
|
|
78687
|
+
size: "icon",
|
|
78688
|
+
onClick: () => {
|
|
78689
|
+
const newTheme = currentTheme === "dark" ? "light" : "dark";
|
|
78690
|
+
setCurrentTheme(newTheme);
|
|
78691
|
+
onThemeChange?.(newTheme);
|
|
78692
|
+
if (typeof window !== "undefined") {
|
|
78693
|
+
const root = window.document.documentElement;
|
|
78694
|
+
root.classList.remove("light", "dark");
|
|
78695
|
+
root.classList.add(newTheme);
|
|
78696
|
+
}
|
|
78697
|
+
},
|
|
78698
|
+
className: "relative overflow-hidden",
|
|
78699
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: currentTheme === "dark" ? /* @__PURE__ */ jsx(
|
|
78700
|
+
motion.div,
|
|
78701
|
+
{
|
|
78702
|
+
initial: { y: -20, opacity: 0 },
|
|
78703
|
+
animate: { y: 0, opacity: 1 },
|
|
78704
|
+
exit: { y: 20, opacity: 0 },
|
|
78705
|
+
transition: { duration: 0.2 },
|
|
78706
|
+
children: /* @__PURE__ */ jsx(Moon, { className: "h-5 w-5" })
|
|
78707
|
+
},
|
|
78708
|
+
"moon"
|
|
78709
|
+
) : /* @__PURE__ */ jsx(
|
|
78710
|
+
motion.div,
|
|
78711
|
+
{
|
|
78712
|
+
initial: { y: -20, opacity: 0, rotate: -90 },
|
|
78713
|
+
animate: { y: 0, opacity: 1, rotate: 0 },
|
|
78714
|
+
exit: { y: 20, opacity: 0, rotate: 90 },
|
|
78715
|
+
transition: { duration: 0.2 },
|
|
78716
|
+
children: /* @__PURE__ */ jsx(Sun, { className: "h-5 w-5" })
|
|
78717
|
+
},
|
|
78718
|
+
"sun"
|
|
78719
|
+
) })
|
|
78720
|
+
}
|
|
78721
|
+
)
|
|
78722
|
+
}
|
|
78723
|
+
) : /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
78536
78724
|
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { variant: "ghost", size: "icon", children: [
|
|
78537
|
-
|
|
78538
|
-
|
|
78539
|
-
|
|
78725
|
+
currentTheme === "light" && /* @__PURE__ */ jsx(Sun, { className: "h-5 w-5" }),
|
|
78726
|
+
currentTheme === "dark" && /* @__PURE__ */ jsx(Moon, { className: "h-5 w-5" }),
|
|
78727
|
+
currentTheme === "system" && /* @__PURE__ */ jsx(Monitor, { className: "h-5 w-5" })
|
|
78540
78728
|
] }) }),
|
|
78541
78729
|
/* @__PURE__ */ jsxs(MoonUIDropdownMenuContentPro, { align: "end", children: [
|
|
78542
78730
|
/* @__PURE__ */ jsxs(
|
|
78543
78731
|
MoonUIDropdownMenuItemPro,
|
|
78544
78732
|
{
|
|
78545
|
-
onClick: () =>
|
|
78733
|
+
onClick: () => {
|
|
78734
|
+
setCurrentTheme("light");
|
|
78735
|
+
onThemeChange?.("light");
|
|
78736
|
+
},
|
|
78546
78737
|
children: [
|
|
78547
78738
|
/* @__PURE__ */ jsx(Sun, { className: "mr-2 h-4 w-4" }),
|
|
78548
78739
|
"Light"
|
|
@@ -78552,7 +78743,10 @@ function NavbarInternal({
|
|
|
78552
78743
|
/* @__PURE__ */ jsxs(
|
|
78553
78744
|
MoonUIDropdownMenuItemPro,
|
|
78554
78745
|
{
|
|
78555
|
-
onClick: () =>
|
|
78746
|
+
onClick: () => {
|
|
78747
|
+
setCurrentTheme("dark");
|
|
78748
|
+
onThemeChange?.("dark");
|
|
78749
|
+
},
|
|
78556
78750
|
children: [
|
|
78557
78751
|
/* @__PURE__ */ jsx(Moon, { className: "mr-2 h-4 w-4" }),
|
|
78558
78752
|
"Dark"
|
|
@@ -78562,7 +78756,10 @@ function NavbarInternal({
|
|
|
78562
78756
|
/* @__PURE__ */ jsxs(
|
|
78563
78757
|
MoonUIDropdownMenuItemPro,
|
|
78564
78758
|
{
|
|
78565
|
-
onClick: () =>
|
|
78759
|
+
onClick: () => {
|
|
78760
|
+
setCurrentTheme("system");
|
|
78761
|
+
onThemeChange?.("system");
|
|
78762
|
+
},
|
|
78566
78763
|
children: [
|
|
78567
78764
|
/* @__PURE__ */ jsx(Monitor, { className: "mr-2 h-4 w-4" }),
|
|
78568
78765
|
"System"
|
|
@@ -78570,7 +78767,7 @@ function NavbarInternal({
|
|
|
78570
78767
|
}
|
|
78571
78768
|
)
|
|
78572
78769
|
] })
|
|
78573
|
-
] }),
|
|
78770
|
+
] })),
|
|
78574
78771
|
notifications && /* @__PURE__ */ jsxs(MoonUIDropdownMenuPro, { children: [
|
|
78575
78772
|
/* @__PURE__ */ jsx(MoonUIDropdownMenuTriggerPro, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
78576
78773
|
MoonUIButtonPro,
|
|
@@ -78694,7 +78891,7 @@ function NavbarInternal({
|
|
|
78694
78891
|
}
|
|
78695
78892
|
)
|
|
78696
78893
|
] }),
|
|
78697
|
-
cta && /* @__PURE__ */ jsx(
|
|
78894
|
+
cta && !shouldHideInMinimal("cta") && /* @__PURE__ */ jsx(
|
|
78698
78895
|
MoonUIButtonPro,
|
|
78699
78896
|
{
|
|
78700
78897
|
variant: cta.variant || "primary",
|
|
@@ -89515,13 +89712,16 @@ var BubbleBackgroundInternal = ({
|
|
|
89515
89712
|
const createBubble = useCallback((canvas) => {
|
|
89516
89713
|
const [minSize, maxSize] = sizeRange;
|
|
89517
89714
|
const size4 = minSize + Math.random() * (maxSize - minSize);
|
|
89518
|
-
|
|
89519
|
-
|
|
89715
|
+
const rect = canvas.getBoundingClientRect();
|
|
89716
|
+
const actualWidth = rect.width;
|
|
89717
|
+
const actualHeight = rect.height;
|
|
89718
|
+
let startY = actualHeight + size4;
|
|
89719
|
+
let startX = -size4 + Math.random() * (actualWidth + size4 * 2);
|
|
89520
89720
|
if (animationStyle === "champagne") {
|
|
89521
|
-
const sourcePoints = [
|
|
89721
|
+
const sourcePoints = [actualWidth * 0.3, actualWidth * 0.5, actualWidth * 0.7];
|
|
89522
89722
|
startX = sourcePoints[Math.floor(Math.random() * sourcePoints.length)] + (Math.random() - 0.5) * 50;
|
|
89523
89723
|
} else if (animationStyle === "lava") {
|
|
89524
|
-
startX =
|
|
89724
|
+
startX = actualWidth / 2 + (Math.random() - 0.5) * actualWidth * 0.3;
|
|
89525
89725
|
}
|
|
89526
89726
|
return {
|
|
89527
89727
|
x: startX,
|
|
@@ -89544,10 +89744,14 @@ var BubbleBackgroundInternal = ({
|
|
|
89544
89744
|
const canvas = canvasRef.current;
|
|
89545
89745
|
if (!canvas)
|
|
89546
89746
|
return;
|
|
89747
|
+
const rect = canvas.getBoundingClientRect();
|
|
89748
|
+
const actualWidth = rect.width;
|
|
89749
|
+
const actualHeight = rect.height;
|
|
89547
89750
|
const bubbles = [];
|
|
89548
89751
|
for (let i = 0; i < count3; i++) {
|
|
89549
89752
|
const bubble = createBubble(canvas);
|
|
89550
|
-
bubble.y = Math.random() *
|
|
89753
|
+
bubble.y = Math.random() * (actualHeight + 100);
|
|
89754
|
+
bubble.x = -50 + Math.random() * (actualWidth + 100);
|
|
89551
89755
|
bubbles.push(bubble);
|
|
89552
89756
|
}
|
|
89553
89757
|
bubblesRef.current = bubbles;
|
|
@@ -89682,9 +89886,11 @@ var BubbleBackgroundInternal = ({
|
|
|
89682
89886
|
bubble.vy += dy / distance * force;
|
|
89683
89887
|
}
|
|
89684
89888
|
}
|
|
89685
|
-
|
|
89686
|
-
|
|
89687
|
-
if (bubble.x
|
|
89889
|
+
const rect = canvas.getBoundingClientRect();
|
|
89890
|
+
const actualWidth = rect.width;
|
|
89891
|
+
if (bubble.x < -bubble.size * 2)
|
|
89892
|
+
bubble.x = actualWidth + bubble.size;
|
|
89893
|
+
if (bubble.x > actualWidth + bubble.size * 2)
|
|
89688
89894
|
bubble.x = -bubble.size;
|
|
89689
89895
|
if (bubble.y < -bubble.size && !bubble.popping) {
|
|
89690
89896
|
const newBubble = createBubble(canvas);
|
|
@@ -89779,10 +89985,13 @@ var BubbleBackgroundInternal = ({
|
|
|
89779
89985
|
const canvas = canvasRef.current;
|
|
89780
89986
|
if (!canvas)
|
|
89781
89987
|
return;
|
|
89782
|
-
const
|
|
89783
|
-
|
|
89784
|
-
|
|
89785
|
-
|
|
89988
|
+
const container = canvas.parentElement;
|
|
89989
|
+
if (!container)
|
|
89990
|
+
return;
|
|
89991
|
+
const rect = container.getBoundingClientRect();
|
|
89992
|
+
const dpr = Math.min(window.devicePixelRatio || 1, 2);
|
|
89993
|
+
canvas.style.width = "100%";
|
|
89994
|
+
canvas.style.height = "100%";
|
|
89786
89995
|
canvas.width = rect.width * dpr;
|
|
89787
89996
|
canvas.height = rect.height * dpr;
|
|
89788
89997
|
const ctx = canvas.getContext("2d");
|
|
@@ -89809,10 +90018,13 @@ var BubbleBackgroundInternal = ({
|
|
|
89809
90018
|
if (!canvas)
|
|
89810
90019
|
return;
|
|
89811
90020
|
detectPerformance();
|
|
89812
|
-
const
|
|
89813
|
-
|
|
89814
|
-
|
|
89815
|
-
|
|
90021
|
+
const container = canvas.parentElement;
|
|
90022
|
+
if (!container)
|
|
90023
|
+
return;
|
|
90024
|
+
const rect = container.getBoundingClientRect();
|
|
90025
|
+
const dpr = Math.min(window.devicePixelRatio || 1, 2);
|
|
90026
|
+
canvas.style.width = "100%";
|
|
90027
|
+
canvas.style.height = "100%";
|
|
89816
90028
|
canvas.width = rect.width * dpr;
|
|
89817
90029
|
canvas.height = rect.height * dpr;
|
|
89818
90030
|
const ctx = canvas.getContext("2d");
|
|
@@ -93913,6 +94125,14 @@ function DocsProProvider({ children, componentName = "Pro Component" }) {
|
|
|
93913
94125
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
93914
94126
|
}
|
|
93915
94127
|
init_use_subscription();
|
|
94128
|
+
var debounce = (func, wait) => {
|
|
94129
|
+
let timeout = null;
|
|
94130
|
+
return (...args) => {
|
|
94131
|
+
if (timeout)
|
|
94132
|
+
clearTimeout(timeout);
|
|
94133
|
+
timeout = setTimeout(() => func(...args), wait);
|
|
94134
|
+
};
|
|
94135
|
+
};
|
|
93916
94136
|
var MouseTrailInternal = ({
|
|
93917
94137
|
children,
|
|
93918
94138
|
style: style2 = "dots",
|
|
@@ -93950,10 +94170,12 @@ var MouseTrailInternal = ({
|
|
|
93950
94170
|
const canvasRef = useRef(null);
|
|
93951
94171
|
const animationRef = useRef(void 0);
|
|
93952
94172
|
const particlesRef = useRef([]);
|
|
93953
|
-
const mouseRef = useRef({ x: 0, y: 0 });
|
|
94173
|
+
const mouseRef = useRef({ x: 0, y: 0, active: false });
|
|
93954
94174
|
const lastMouseRef = useRef({ x: 0, y: 0 });
|
|
93955
94175
|
const frameCountRef = useRef(0);
|
|
93956
94176
|
const rainbowPhaseRef = useRef(0);
|
|
94177
|
+
const lastFrameTime = useRef(0);
|
|
94178
|
+
const [isActive2, setIsActive] = useState(false);
|
|
93957
94179
|
const initializeParticles = useCallback(() => {
|
|
93958
94180
|
const particles = [];
|
|
93959
94181
|
for (let i = 0; i < length; i++) {
|
|
@@ -94119,12 +94341,12 @@ var MouseTrailInternal = ({
|
|
|
94119
94341
|
newParticle.opacity = 1;
|
|
94120
94342
|
newParticle.rotation = 0;
|
|
94121
94343
|
newParticle.scale = scaleRange[1];
|
|
94122
|
-
newParticle.sparkle = sparkle &&
|
|
94344
|
+
newParticle.sparkle = sparkle && frameCountRef.current * 7 % 100 / 100 < sparkleFrequency;
|
|
94123
94345
|
if (rainbow) {
|
|
94124
94346
|
const hue = rainbowPhaseRef.current * 360 % 360;
|
|
94125
94347
|
newParticle.color = `hsl(${hue}, 70%, 50%)`;
|
|
94126
94348
|
} else {
|
|
94127
|
-
newParticle.color = colors[
|
|
94349
|
+
newParticle.color = colors[frameCountRef.current % colors.length];
|
|
94128
94350
|
}
|
|
94129
94351
|
lastMouseRef.current = { ...mouse };
|
|
94130
94352
|
}
|
|
@@ -94180,6 +94402,14 @@ var MouseTrailInternal = ({
|
|
|
94180
94402
|
const canvas = canvasRef.current;
|
|
94181
94403
|
if (!canvas)
|
|
94182
94404
|
return;
|
|
94405
|
+
const targetFPS = 60;
|
|
94406
|
+
const frameInterval = 1e3 / targetFPS;
|
|
94407
|
+
const deltaTime = currentTime - lastFrameTime.current;
|
|
94408
|
+
if (deltaTime < frameInterval) {
|
|
94409
|
+
animationRef.current = requestAnimationFrame(animate4);
|
|
94410
|
+
return;
|
|
94411
|
+
}
|
|
94412
|
+
lastFrameTime.current = currentTime - deltaTime % frameInterval;
|
|
94183
94413
|
const ctx = canvas.getContext("2d", {
|
|
94184
94414
|
alpha: true,
|
|
94185
94415
|
desynchronized: true
|
|
@@ -94187,14 +94417,17 @@ var MouseTrailInternal = ({
|
|
|
94187
94417
|
if (!ctx)
|
|
94188
94418
|
return;
|
|
94189
94419
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
94190
|
-
|
|
94191
|
-
|
|
94192
|
-
|
|
94193
|
-
|
|
94194
|
-
|
|
94195
|
-
|
|
94196
|
-
|
|
94197
|
-
|
|
94420
|
+
const hasActiveParticles = particlesRef.current.some((p) => p.opacity > 0.01);
|
|
94421
|
+
if (mouseRef.current.active || hasActiveParticles) {
|
|
94422
|
+
updateParticles(deltaTime);
|
|
94423
|
+
drawLines(ctx, particlesRef.current);
|
|
94424
|
+
const particles = particlesRef.current;
|
|
94425
|
+
particles.forEach((particle) => {
|
|
94426
|
+
if (particle.opacity > 0.01) {
|
|
94427
|
+
drawShape(ctx, particle, particle.x, particle.y);
|
|
94428
|
+
}
|
|
94429
|
+
});
|
|
94430
|
+
}
|
|
94198
94431
|
frameCountRef.current++;
|
|
94199
94432
|
animationRef.current = requestAnimationFrame(animate4);
|
|
94200
94433
|
}, [updateParticles, drawLines, drawShape]);
|
|
@@ -94203,11 +94436,17 @@ var MouseTrailInternal = ({
|
|
|
94203
94436
|
if (!canvas)
|
|
94204
94437
|
return;
|
|
94205
94438
|
const rect = canvas.getBoundingClientRect();
|
|
94206
|
-
|
|
94207
|
-
|
|
94208
|
-
|
|
94209
|
-
|
|
94210
|
-
|
|
94439
|
+
const x = e.clientX - rect.left;
|
|
94440
|
+
const y = e.clientY - rect.top;
|
|
94441
|
+
if (x >= 0 && x <= rect.width && y >= 0 && y <= rect.height) {
|
|
94442
|
+
mouseRef.current = { x, y, active: true };
|
|
94443
|
+
if (!isActive2) {
|
|
94444
|
+
setIsActive(true);
|
|
94445
|
+
}
|
|
94446
|
+
} else {
|
|
94447
|
+
mouseRef.current.active = false;
|
|
94448
|
+
}
|
|
94449
|
+
}, [isActive2]);
|
|
94211
94450
|
const handleTouchMove = useCallback((e) => {
|
|
94212
94451
|
if (!enableTouch)
|
|
94213
94452
|
return;
|
|
@@ -94216,37 +94455,67 @@ var MouseTrailInternal = ({
|
|
|
94216
94455
|
return;
|
|
94217
94456
|
const rect = canvas.getBoundingClientRect();
|
|
94218
94457
|
const touch = e.touches[0];
|
|
94219
|
-
|
|
94220
|
-
|
|
94221
|
-
|
|
94222
|
-
|
|
94223
|
-
|
|
94458
|
+
const x = touch.clientX - rect.left;
|
|
94459
|
+
const y = touch.clientY - rect.top;
|
|
94460
|
+
if (x >= 0 && x <= rect.width && y >= 0 && y <= rect.height) {
|
|
94461
|
+
mouseRef.current = { x, y, active: true };
|
|
94462
|
+
if (!isActive2) {
|
|
94463
|
+
setIsActive(true);
|
|
94464
|
+
}
|
|
94465
|
+
} else {
|
|
94466
|
+
mouseRef.current.active = false;
|
|
94467
|
+
}
|
|
94468
|
+
}, [enableTouch, isActive2]);
|
|
94224
94469
|
const handleResize = useCallback(() => {
|
|
94225
94470
|
const canvas = canvasRef.current;
|
|
94226
94471
|
if (!canvas)
|
|
94227
94472
|
return;
|
|
94228
94473
|
const rect = canvas.getBoundingClientRect();
|
|
94229
|
-
|
|
94230
|
-
canvas.
|
|
94474
|
+
const dpr = window.devicePixelRatio || 1;
|
|
94475
|
+
canvas.width = rect.width * dpr;
|
|
94476
|
+
canvas.height = rect.height * dpr;
|
|
94477
|
+
const ctx = canvas.getContext("2d");
|
|
94478
|
+
if (ctx) {
|
|
94479
|
+
ctx.scale(dpr, dpr);
|
|
94480
|
+
}
|
|
94481
|
+
canvas.style.width = `${rect.width}px`;
|
|
94482
|
+
canvas.style.height = `${rect.height}px`;
|
|
94231
94483
|
}, []);
|
|
94232
94484
|
useEffect(() => {
|
|
94233
94485
|
const canvas = canvasRef.current;
|
|
94234
94486
|
if (!canvas)
|
|
94235
94487
|
return;
|
|
94236
|
-
|
|
94237
|
-
canvas.width = rect.width;
|
|
94238
|
-
canvas.height = rect.height;
|
|
94488
|
+
handleResize();
|
|
94239
94489
|
initializeParticles();
|
|
94240
|
-
|
|
94241
|
-
window.addEventListener("
|
|
94490
|
+
const debouncedResize = debounce(handleResize, 100);
|
|
94491
|
+
window.addEventListener("resize", debouncedResize);
|
|
94492
|
+
canvas.addEventListener("mousemove", handleMouseMove2);
|
|
94493
|
+
canvas.addEventListener("mouseenter", () => {
|
|
94494
|
+
mouseRef.current.active = true;
|
|
94495
|
+
setIsActive(true);
|
|
94496
|
+
});
|
|
94497
|
+
canvas.addEventListener("mouseleave", () => {
|
|
94498
|
+
mouseRef.current.active = false;
|
|
94499
|
+
setIsActive(false);
|
|
94500
|
+
});
|
|
94242
94501
|
if (enableTouch) {
|
|
94243
94502
|
window.addEventListener("touchmove", handleTouchMove);
|
|
94244
94503
|
}
|
|
94245
94504
|
animationRef.current = requestAnimationFrame(animate4);
|
|
94246
94505
|
return () => {
|
|
94247
|
-
window.removeEventListener("resize",
|
|
94248
|
-
|
|
94249
|
-
|
|
94506
|
+
window.removeEventListener("resize", debouncedResize);
|
|
94507
|
+
canvas.removeEventListener("mousemove", handleMouseMove2);
|
|
94508
|
+
canvas.removeEventListener("mouseenter", () => {
|
|
94509
|
+
mouseRef.current.active = true;
|
|
94510
|
+
setIsActive(true);
|
|
94511
|
+
});
|
|
94512
|
+
canvas.removeEventListener("mouseleave", () => {
|
|
94513
|
+
mouseRef.current.active = false;
|
|
94514
|
+
setIsActive(false);
|
|
94515
|
+
});
|
|
94516
|
+
if (enableTouch) {
|
|
94517
|
+
canvas.removeEventListener("touchmove", handleTouchMove);
|
|
94518
|
+
}
|
|
94250
94519
|
if (animationRef.current) {
|
|
94251
94520
|
cancelAnimationFrame(animationRef.current);
|
|
94252
94521
|
}
|
|
@@ -94272,10 +94541,13 @@ var MouseTrailInternal = ({
|
|
|
94272
94541
|
{
|
|
94273
94542
|
ref: canvasRef,
|
|
94274
94543
|
className: cn(
|
|
94275
|
-
"absolute inset-0 w-full h-full
|
|
94544
|
+
"absolute inset-0 w-full h-full",
|
|
94276
94545
|
className
|
|
94277
94546
|
),
|
|
94278
|
-
style: {
|
|
94547
|
+
style: {
|
|
94548
|
+
zIndex,
|
|
94549
|
+
pointerEvents: "auto"
|
|
94550
|
+
}
|
|
94279
94551
|
}
|
|
94280
94552
|
),
|
|
94281
94553
|
children && /* @__PURE__ */ jsx("div", { className: "relative z-0", children })
|
|
@@ -94299,44 +94571,46 @@ var MouseTrail = (props) => {
|
|
|
94299
94571
|
};
|
|
94300
94572
|
MouseTrail.displayName = "MouseTrail";
|
|
94301
94573
|
init_use_subscription();
|
|
94574
|
+
var lerp = (start, end, factor) => {
|
|
94575
|
+
return start + (end - start) * factor;
|
|
94576
|
+
};
|
|
94577
|
+
var clamp2 = (value, min2, max2) => {
|
|
94578
|
+
return Math.max(min2, Math.min(max2, value));
|
|
94579
|
+
};
|
|
94302
94580
|
var MagneticElementsInternal = ({
|
|
94303
94581
|
children,
|
|
94304
|
-
strength = 0.
|
|
94305
|
-
radius =
|
|
94582
|
+
strength = 0.3,
|
|
94583
|
+
radius = 150,
|
|
94306
94584
|
type = "attract",
|
|
94307
94585
|
enableTouch = false,
|
|
94308
|
-
damping = 0.
|
|
94309
|
-
stiffness = 0.
|
|
94310
|
-
mass = 1,
|
|
94586
|
+
damping = 0.2,
|
|
94587
|
+
stiffness = 0.3,
|
|
94311
94588
|
rotate = true,
|
|
94312
|
-
rotationStrength =
|
|
94589
|
+
rotationStrength = 10,
|
|
94313
94590
|
scale = true,
|
|
94314
|
-
scaleFactor = 1.
|
|
94315
|
-
tilt =
|
|
94316
|
-
tiltAngle =
|
|
94317
|
-
transitionDuration = 0,
|
|
94318
|
-
easing = "cubic-bezier(0.25, 0.46, 0.45, 0.94)",
|
|
94591
|
+
scaleFactor = 1.05,
|
|
94592
|
+
tilt = false,
|
|
94593
|
+
tiltAngle = 10,
|
|
94319
94594
|
constrain = true,
|
|
94320
|
-
maxDisplacement =
|
|
94321
|
-
hoverOnly = false,
|
|
94595
|
+
maxDisplacement = 50,
|
|
94322
94596
|
returnSpeed = 0.1,
|
|
94323
|
-
|
|
94324
|
-
|
|
94325
|
-
|
|
94326
|
-
inertiaDecay = 0.95,
|
|
94327
|
-
enable3D = false,
|
|
94328
|
-
perspective = 1e3,
|
|
94597
|
+
smooth = true,
|
|
94598
|
+
smoothing = 0.15,
|
|
94599
|
+
performance: performance2 = "balanced",
|
|
94329
94600
|
glow = false,
|
|
94330
|
-
glowColor = "
|
|
94601
|
+
glowColor = "rgba(59, 130, 246, 0.5)",
|
|
94331
94602
|
containerClassName,
|
|
94332
94603
|
elementClassName,
|
|
94333
94604
|
debug = false
|
|
94334
94605
|
}) => {
|
|
94335
94606
|
const containerRef = useRef(null);
|
|
94336
94607
|
const elementsRef = useRef([]);
|
|
94337
|
-
const mouseRef = useRef({ x: 0, y: 0 });
|
|
94608
|
+
const mouseRef = useRef({ x: 0, y: 0, active: false });
|
|
94338
94609
|
const animationRef = useRef(void 0);
|
|
94339
|
-
const
|
|
94610
|
+
const [isReady, setIsReady] = useState(false);
|
|
94611
|
+
const fps = performance2 === "high" ? 60 : performance2 === "balanced" ? 30 : 15;
|
|
94612
|
+
const frameInterval = 1e3 / fps;
|
|
94613
|
+
const lastFrameTime = useRef(0);
|
|
94340
94614
|
const initializeElements = useCallback(() => {
|
|
94341
94615
|
const container = containerRef.current;
|
|
94342
94616
|
if (!container)
|
|
@@ -94347,35 +94621,39 @@ var MagneticElementsInternal = ({
|
|
|
94347
94621
|
const element = el;
|
|
94348
94622
|
const rect = element.getBoundingClientRect();
|
|
94349
94623
|
const containerRect = container.getBoundingClientRect();
|
|
94624
|
+
const centerX = rect.left - containerRect.left + rect.width / 2;
|
|
94625
|
+
const centerY = rect.top - containerRect.top + rect.height / 2;
|
|
94350
94626
|
elements.push({
|
|
94351
94627
|
element,
|
|
94352
|
-
originalX:
|
|
94353
|
-
originalY:
|
|
94628
|
+
originalX: centerX,
|
|
94629
|
+
originalY: centerY,
|
|
94354
94630
|
currentX: 0,
|
|
94355
94631
|
currentY: 0,
|
|
94356
|
-
velocityX: 0,
|
|
94357
|
-
velocityY: 0,
|
|
94358
94632
|
targetX: 0,
|
|
94359
94633
|
targetY: 0,
|
|
94360
94634
|
rotation: 0,
|
|
94361
94635
|
scale: 1,
|
|
94362
|
-
|
|
94636
|
+
opacity: 1
|
|
94363
94637
|
});
|
|
94364
|
-
element.style.willChange = "transform";
|
|
94365
|
-
|
|
94366
|
-
|
|
94638
|
+
element.style.willChange = "transform, opacity";
|
|
94639
|
+
element.style.transformOrigin = "center center";
|
|
94640
|
+
if (smooth) {
|
|
94641
|
+
element.style.transition = "none";
|
|
94367
94642
|
}
|
|
94368
94643
|
});
|
|
94369
94644
|
elementsRef.current = elements;
|
|
94370
|
-
|
|
94645
|
+
setIsReady(true);
|
|
94646
|
+
}, [smooth]);
|
|
94371
94647
|
const calculateForce = useCallback((element, mouseX, mouseY) => {
|
|
94372
94648
|
const dx = mouseX - element.originalX;
|
|
94373
94649
|
const dy = mouseY - element.originalY;
|
|
94374
94650
|
const distance = Math.sqrt(dx * dx + dy * dy);
|
|
94651
|
+
const normalizedDistance = Math.min(distance / radius, 1);
|
|
94375
94652
|
if (distance > radius) {
|
|
94376
|
-
return { fx: 0, fy: 0, distance };
|
|
94653
|
+
return { fx: 0, fy: 0, distance, normalizedDistance: 1 };
|
|
94377
94654
|
}
|
|
94378
|
-
const
|
|
94655
|
+
const easedForce = 1 - Math.pow(normalizedDistance, 2);
|
|
94656
|
+
const force = easedForce * strength;
|
|
94379
94657
|
let fx = 0;
|
|
94380
94658
|
let fy = 0;
|
|
94381
94659
|
switch (type) {
|
|
@@ -94384,67 +94662,70 @@ var MagneticElementsInternal = ({
|
|
|
94384
94662
|
fy = dy * force;
|
|
94385
94663
|
break;
|
|
94386
94664
|
case "repel":
|
|
94387
|
-
|
|
94388
|
-
|
|
94665
|
+
const repelForce = force * 2;
|
|
94666
|
+
fx = -dx * repelForce / (normalizedDistance + 0.1);
|
|
94667
|
+
fy = -dy * repelForce / (normalizedDistance + 0.1);
|
|
94389
94668
|
break;
|
|
94390
94669
|
case "elastic":
|
|
94391
|
-
const elasticForce = Math.sin(
|
|
94670
|
+
const elasticForce = Math.sin(normalizedDistance * Math.PI) * strength;
|
|
94392
94671
|
fx = dx * elasticForce;
|
|
94393
94672
|
fy = dy * elasticForce;
|
|
94394
94673
|
break;
|
|
94395
94674
|
case "orbit":
|
|
94396
94675
|
const angle = Math.atan2(dy, dx) + Math.PI / 2;
|
|
94397
|
-
const orbitForce = force *
|
|
94676
|
+
const orbitForce = force * 30;
|
|
94398
94677
|
fx = Math.cos(angle) * orbitForce;
|
|
94399
94678
|
fy = Math.sin(angle) * orbitForce;
|
|
94400
94679
|
break;
|
|
94401
94680
|
}
|
|
94402
|
-
return { fx, fy, distance };
|
|
94681
|
+
return { fx, fy, distance, normalizedDistance };
|
|
94403
94682
|
}, [radius, strength, type]);
|
|
94404
|
-
const updateElements = useCallback(() => {
|
|
94683
|
+
const updateElements = useCallback((currentTime) => {
|
|
94684
|
+
if (performance2 !== "high") {
|
|
94685
|
+
const elapsed = currentTime - lastFrameTime.current;
|
|
94686
|
+
if (elapsed < frameInterval)
|
|
94687
|
+
return;
|
|
94688
|
+
lastFrameTime.current = currentTime - elapsed % frameInterval;
|
|
94689
|
+
}
|
|
94405
94690
|
const elements = elementsRef.current;
|
|
94406
94691
|
const mouse = mouseRef.current;
|
|
94407
94692
|
elements.forEach((element) => {
|
|
94408
|
-
const { fx, fy, distance } = calculateForce(
|
|
94409
|
-
|
|
94410
|
-
|
|
94693
|
+
const { fx, fy, distance, normalizedDistance } = calculateForce(
|
|
94694
|
+
element,
|
|
94695
|
+
mouse.x,
|
|
94696
|
+
mouse.y
|
|
94697
|
+
);
|
|
94698
|
+
const isInRange = distance <= radius && mouse.active;
|
|
94699
|
+
if (isInRange) {
|
|
94411
94700
|
element.targetX = fx;
|
|
94412
94701
|
element.targetY = fy;
|
|
94702
|
+
element.opacity = 1;
|
|
94413
94703
|
} else {
|
|
94414
94704
|
element.targetX = 0;
|
|
94415
94705
|
element.targetY = 0;
|
|
94706
|
+
element.opacity = 1;
|
|
94416
94707
|
}
|
|
94417
94708
|
if (constrain) {
|
|
94418
|
-
element.targetX =
|
|
94419
|
-
element.targetY =
|
|
94420
|
-
}
|
|
94421
|
-
|
|
94422
|
-
|
|
94423
|
-
|
|
94424
|
-
|
|
94425
|
-
element.
|
|
94426
|
-
element.
|
|
94427
|
-
element.velocityY *= inertiaDecay;
|
|
94428
|
-
element.currentX += element.velocityX;
|
|
94429
|
-
element.currentY += element.velocityY;
|
|
94709
|
+
element.targetX = clamp2(element.targetX, -maxDisplacement, maxDisplacement);
|
|
94710
|
+
element.targetY = clamp2(element.targetY, -maxDisplacement, maxDisplacement);
|
|
94711
|
+
}
|
|
94712
|
+
const lerpFactor = smooth ? smoothing : 1;
|
|
94713
|
+
element.currentX = lerp(element.currentX, element.targetX, lerpFactor);
|
|
94714
|
+
element.currentY = lerp(element.currentY, element.targetY, lerpFactor);
|
|
94715
|
+
if (rotate && isInRange) {
|
|
94716
|
+
const targetRotation = element.currentX / maxDisplacement * rotationStrength;
|
|
94717
|
+
element.rotation = lerp(element.rotation, targetRotation, lerpFactor);
|
|
94430
94718
|
} else {
|
|
94431
|
-
element.
|
|
94432
|
-
element.currentY += (element.targetY - element.currentY) * returnSpeed;
|
|
94433
|
-
}
|
|
94434
|
-
if (overshoot && isInRange) {
|
|
94435
|
-
element.currentX *= overshootAmount;
|
|
94436
|
-
element.currentY *= overshootAmount;
|
|
94437
|
-
}
|
|
94438
|
-
if (rotate) {
|
|
94439
|
-
element.rotation = element.currentX / maxDisplacement * rotationStrength;
|
|
94719
|
+
element.rotation = lerp(element.rotation, 0, lerpFactor);
|
|
94440
94720
|
}
|
|
94441
94721
|
if (scale && isInRange) {
|
|
94442
|
-
const scaleProgress = 1 -
|
|
94443
|
-
|
|
94722
|
+
const scaleProgress = 1 - normalizedDistance;
|
|
94723
|
+
const targetScale = 1 + (scaleFactor - 1) * scaleProgress;
|
|
94724
|
+
element.scale = lerp(element.scale, targetScale, lerpFactor);
|
|
94444
94725
|
} else {
|
|
94445
|
-
element.scale
|
|
94726
|
+
element.scale = lerp(element.scale, 1, lerpFactor);
|
|
94446
94727
|
}
|
|
94447
|
-
let transform = `
|
|
94728
|
+
let transform = `translate3d(${element.currentX}px, ${element.currentY}px, 0)`;
|
|
94448
94729
|
if (rotate) {
|
|
94449
94730
|
transform += ` rotate(${element.rotation}deg)`;
|
|
94450
94731
|
}
|
|
@@ -94454,53 +94735,39 @@ var MagneticElementsInternal = ({
|
|
|
94454
94735
|
if (tilt && isInRange) {
|
|
94455
94736
|
const tiltX = element.currentY / maxDisplacement * tiltAngle;
|
|
94456
94737
|
const tiltY = -(element.currentX / maxDisplacement) * tiltAngle;
|
|
94457
|
-
|
|
94458
|
-
transform += ` rotateX(${tiltX}deg) rotateY(${tiltY}deg)`;
|
|
94459
|
-
element.element.style.transformStyle = "preserve-3d";
|
|
94460
|
-
element.element.style.perspective = `${perspective}px`;
|
|
94461
|
-
}
|
|
94738
|
+
transform += ` rotateX(${tiltX}deg) rotateY(${tiltY}deg)`;
|
|
94462
94739
|
}
|
|
94463
94740
|
if (glow && isInRange) {
|
|
94464
|
-
const glowIntensity = (1 -
|
|
94741
|
+
const glowIntensity = (1 - normalizedDistance) * 20;
|
|
94465
94742
|
element.element.style.boxShadow = `0 0 ${glowIntensity}px ${glowColor}`;
|
|
94743
|
+
element.element.style.filter = `brightness(${1 + (1 - normalizedDistance) * 0.2})`;
|
|
94466
94744
|
} else if (glow) {
|
|
94467
|
-
element.element.style.boxShadow = "
|
|
94745
|
+
element.element.style.boxShadow = "";
|
|
94746
|
+
element.element.style.filter = "";
|
|
94468
94747
|
}
|
|
94469
94748
|
element.element.style.transform = transform;
|
|
94470
|
-
|
|
94471
|
-
element.element.style.border = isInRange ? "2px solid red" : "1px solid blue";
|
|
94472
|
-
}
|
|
94749
|
+
element.element.style.opacity = element.opacity.toString();
|
|
94473
94750
|
});
|
|
94474
94751
|
}, [
|
|
94475
94752
|
calculateForce,
|
|
94476
94753
|
radius,
|
|
94477
|
-
hoverOnly,
|
|
94478
94754
|
constrain,
|
|
94479
94755
|
maxDisplacement,
|
|
94480
|
-
|
|
94481
|
-
|
|
94482
|
-
damping,
|
|
94483
|
-
mass,
|
|
94484
|
-
inertiaDecay,
|
|
94485
|
-
returnSpeed,
|
|
94486
|
-
overshoot,
|
|
94487
|
-
overshootAmount,
|
|
94756
|
+
smooth,
|
|
94757
|
+
smoothing,
|
|
94488
94758
|
rotate,
|
|
94489
94759
|
rotationStrength,
|
|
94490
94760
|
scale,
|
|
94491
94761
|
scaleFactor,
|
|
94492
94762
|
tilt,
|
|
94493
94763
|
tiltAngle,
|
|
94494
|
-
enable3D,
|
|
94495
|
-
perspective,
|
|
94496
94764
|
glow,
|
|
94497
94765
|
glowColor,
|
|
94498
|
-
|
|
94766
|
+
performance2,
|
|
94767
|
+
frameInterval
|
|
94499
94768
|
]);
|
|
94500
|
-
const animate4 = useCallback(() => {
|
|
94501
|
-
|
|
94502
|
-
return;
|
|
94503
|
-
updateElements();
|
|
94769
|
+
const animate4 = useCallback((currentTime) => {
|
|
94770
|
+
updateElements(currentTime);
|
|
94504
94771
|
animationRef.current = requestAnimationFrame(animate4);
|
|
94505
94772
|
}, [updateElements]);
|
|
94506
94773
|
const handleMouseMove2 = useCallback((e) => {
|
|
@@ -94510,13 +94777,10 @@ var MagneticElementsInternal = ({
|
|
|
94510
94777
|
const rect = container.getBoundingClientRect();
|
|
94511
94778
|
mouseRef.current = {
|
|
94512
94779
|
x: e.clientX - rect.left,
|
|
94513
|
-
y: e.clientY - rect.top
|
|
94780
|
+
y: e.clientY - rect.top,
|
|
94781
|
+
active: true
|
|
94514
94782
|
};
|
|
94515
|
-
|
|
94516
|
-
isActiveRef.current = true;
|
|
94517
|
-
animate4();
|
|
94518
|
-
}
|
|
94519
|
-
}, [animate4]);
|
|
94783
|
+
}, []);
|
|
94520
94784
|
const handleTouchMove = useCallback((e) => {
|
|
94521
94785
|
if (!enableTouch)
|
|
94522
94786
|
return;
|
|
@@ -94527,69 +94791,31 @@ var MagneticElementsInternal = ({
|
|
|
94527
94791
|
const touch = e.touches[0];
|
|
94528
94792
|
mouseRef.current = {
|
|
94529
94793
|
x: touch.clientX - rect.left,
|
|
94530
|
-
y: touch.clientY - rect.top
|
|
94794
|
+
y: touch.clientY - rect.top,
|
|
94795
|
+
active: true
|
|
94531
94796
|
};
|
|
94532
|
-
|
|
94533
|
-
|
|
94534
|
-
|
|
94797
|
+
}, [enableTouch]);
|
|
94798
|
+
const handleMouseEnter = useCallback(() => {
|
|
94799
|
+
mouseRef.current.active = true;
|
|
94800
|
+
if (!animationRef.current) {
|
|
94801
|
+
animationRef.current = requestAnimationFrame(animate4);
|
|
94535
94802
|
}
|
|
94536
|
-
}, [enableTouch, animate4]);
|
|
94537
|
-
const handleMouseLeave2 = useCallback(() => {
|
|
94538
|
-
isActiveRef.current = false;
|
|
94539
|
-
elementsRef.current.forEach((element) => {
|
|
94540
|
-
element.targetX = 0;
|
|
94541
|
-
element.targetY = 0;
|
|
94542
|
-
});
|
|
94543
|
-
animate4();
|
|
94544
|
-
setTimeout(() => {
|
|
94545
|
-
if (animationRef.current) {
|
|
94546
|
-
cancelAnimationFrame(animationRef.current);
|
|
94547
|
-
}
|
|
94548
|
-
}, 1e3);
|
|
94549
94803
|
}, [animate4]);
|
|
94550
|
-
const
|
|
94551
|
-
|
|
94552
|
-
if (magneticElement) {
|
|
94553
|
-
magneticElement.isHovered = isHovered;
|
|
94554
|
-
}
|
|
94804
|
+
const handleMouseLeave2 = useCallback(() => {
|
|
94805
|
+
mouseRef.current.active = false;
|
|
94555
94806
|
}, []);
|
|
94556
94807
|
useEffect(() => {
|
|
94557
94808
|
initializeElements();
|
|
94558
94809
|
const container = containerRef.current;
|
|
94559
94810
|
if (!container)
|
|
94560
94811
|
return;
|
|
94561
|
-
|
|
94562
|
-
container.addEventListener("mouseleave", handleMouseLeave2);
|
|
94563
|
-
if (enableTouch) {
|
|
94564
|
-
container.addEventListener("touchmove", handleTouchMove);
|
|
94565
|
-
container.addEventListener("touchend", handleMouseLeave2);
|
|
94566
|
-
}
|
|
94567
|
-
if (hoverOnly) {
|
|
94568
|
-
const elements = container.querySelectorAll("[data-magnetic]");
|
|
94569
|
-
elements.forEach((el) => {
|
|
94570
|
-
const element = el;
|
|
94571
|
-
element.addEventListener("mouseenter", () => handleElementHover(element, true));
|
|
94572
|
-
element.addEventListener("mouseleave", () => handleElementHover(element, false));
|
|
94573
|
-
});
|
|
94574
|
-
}
|
|
94812
|
+
animationRef.current = requestAnimationFrame(animate4);
|
|
94575
94813
|
return () => {
|
|
94576
|
-
container.removeEventListener("mousemove", handleMouseMove2);
|
|
94577
|
-
container.removeEventListener("mouseleave", handleMouseLeave2);
|
|
94578
|
-
container.removeEventListener("touchmove", handleTouchMove);
|
|
94579
|
-
container.removeEventListener("touchend", handleMouseLeave2);
|
|
94580
94814
|
if (animationRef.current) {
|
|
94581
94815
|
cancelAnimationFrame(animationRef.current);
|
|
94582
94816
|
}
|
|
94583
94817
|
};
|
|
94584
|
-
}, [
|
|
94585
|
-
initializeElements,
|
|
94586
|
-
handleMouseMove2,
|
|
94587
|
-
handleMouseLeave2,
|
|
94588
|
-
handleTouchMove,
|
|
94589
|
-
handleElementHover,
|
|
94590
|
-
enableTouch,
|
|
94591
|
-
hoverOnly
|
|
94592
|
-
]);
|
|
94818
|
+
}, [initializeElements, animate4]);
|
|
94593
94819
|
const processedChildren = Children.map(children, (child, index2) => {
|
|
94594
94820
|
if (isValidElement(child)) {
|
|
94595
94821
|
return cloneElement(child, {
|
|
@@ -94597,7 +94823,7 @@ var MagneticElementsInternal = ({
|
|
|
94597
94823
|
className: cn(
|
|
94598
94824
|
child.props.className,
|
|
94599
94825
|
elementClassName,
|
|
94600
|
-
"magnetic-element"
|
|
94826
|
+
"magnetic-element cursor-pointer"
|
|
94601
94827
|
),
|
|
94602
94828
|
key: index2
|
|
94603
94829
|
});
|
|
@@ -94610,29 +94836,34 @@ var MagneticElementsInternal = ({
|
|
|
94610
94836
|
ref: containerRef,
|
|
94611
94837
|
className: cn(
|
|
94612
94838
|
"relative",
|
|
94613
|
-
enable3D && "transform-gpu",
|
|
94614
94839
|
containerClassName
|
|
94615
94840
|
),
|
|
94841
|
+
onMouseMove: handleMouseMove2,
|
|
94842
|
+
onMouseEnter: handleMouseEnter,
|
|
94843
|
+
onMouseLeave: handleMouseLeave2,
|
|
94844
|
+
onTouchMove: enableTouch ? handleTouchMove : void 0,
|
|
94845
|
+
onTouchEnd: enableTouch ? handleMouseLeave2 : void 0,
|
|
94616
94846
|
style: {
|
|
94617
|
-
perspective:
|
|
94847
|
+
perspective: tilt ? "1000px" : void 0
|
|
94618
94848
|
},
|
|
94619
94849
|
children: [
|
|
94620
94850
|
processedChildren,
|
|
94621
|
-
debug && /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 pointer-events-none
|
|
94851
|
+
debug && isReady && /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 pointer-events-none", children: [
|
|
94622
94852
|
/* @__PURE__ */ jsx(
|
|
94623
94853
|
"div",
|
|
94624
94854
|
{
|
|
94625
|
-
className: "absolute w-
|
|
94855
|
+
className: "absolute w-2 h-2 bg-red-500 rounded-full -translate-x-1/2 -translate-y-1/2 z-50",
|
|
94626
94856
|
style: {
|
|
94627
94857
|
left: mouseRef.current.x,
|
|
94628
|
-
top: mouseRef.current.y
|
|
94858
|
+
top: mouseRef.current.y,
|
|
94859
|
+
opacity: mouseRef.current.active ? 1 : 0.3
|
|
94629
94860
|
}
|
|
94630
94861
|
}
|
|
94631
94862
|
),
|
|
94632
94863
|
/* @__PURE__ */ jsx(
|
|
94633
94864
|
"div",
|
|
94634
94865
|
{
|
|
94635
|
-
className: "absolute border-2 border-red-500 rounded-full -translate-x-1/2 -translate-y-1/2 opacity-
|
|
94866
|
+
className: "absolute border-2 border-red-500 rounded-full -translate-x-1/2 -translate-y-1/2 opacity-20",
|
|
94636
94867
|
style: {
|
|
94637
94868
|
left: mouseRef.current.x,
|
|
94638
94869
|
top: mouseRef.current.y,
|
|
@@ -95292,7 +95523,7 @@ var SpringPhysicsInternal = ({
|
|
|
95292
95523
|
mouseRadius = 200,
|
|
95293
95524
|
preset = "default",
|
|
95294
95525
|
overshoot = true,
|
|
95295
|
-
clamp:
|
|
95526
|
+
clamp: clamp3 = false,
|
|
95296
95527
|
precision = 0.01,
|
|
95297
95528
|
transform3d = false,
|
|
95298
95529
|
rotate = false,
|
|
@@ -95391,7 +95622,7 @@ var SpringPhysicsInternal = ({
|
|
|
95391
95622
|
x: (velocity.x || 0) + force.x / mass * deltaTime,
|
|
95392
95623
|
y: (velocity.y || 0) + force.y / mass * deltaTime
|
|
95393
95624
|
};
|
|
95394
|
-
if (
|
|
95625
|
+
if (clamp3 && !overshoot) {
|
|
95395
95626
|
const distX = Math.abs((targetPos.x || 0) - position.x);
|
|
95396
95627
|
const distY = Math.abs((targetPos.y || 0) - position.y);
|
|
95397
95628
|
if (distX < 1)
|
|
@@ -95454,7 +95685,7 @@ var SpringPhysicsInternal = ({
|
|
|
95454
95685
|
mass,
|
|
95455
95686
|
precision,
|
|
95456
95687
|
overshoot,
|
|
95457
|
-
|
|
95688
|
+
clamp3,
|
|
95458
95689
|
trail,
|
|
95459
95690
|
trailCount,
|
|
95460
95691
|
trailDecay,
|
|
@@ -103263,24 +103494,20 @@ export default function Component() {
|
|
|
103263
103494
|
/**
|
|
103264
103495
|
* MouseTrail Component
|
|
103265
103496
|
*
|
|
103266
|
-
*
|
|
103267
|
-
*
|
|
103268
|
-
* Adapted for MoonUI Pro with TypeScript and enhanced features
|
|
103497
|
+
* High-performance interactive particle trail following mouse movement
|
|
103498
|
+
* Optimized with frame rate limiting, object pooling, and efficient rendering
|
|
103269
103499
|
*
|
|
103270
103500
|
* @author MoonUI Team
|
|
103271
|
-
* @license
|
|
103272
|
-
* @credits React Bits by David H
|
|
103501
|
+
* @license Commercial
|
|
103273
103502
|
*/
|
|
103274
103503
|
/**
|
|
103275
103504
|
* MagneticElements Component
|
|
103276
103505
|
*
|
|
103277
|
-
*
|
|
103278
|
-
*
|
|
103279
|
-
* Adapted for MoonUI Pro with TypeScript and enhanced features
|
|
103506
|
+
* High-performance magnetic effect where elements are attracted to or repelled from cursor
|
|
103507
|
+
* Optimized for smooth animations and professional interactions
|
|
103280
103508
|
*
|
|
103281
103509
|
* @author MoonUI Team
|
|
103282
|
-
* @license
|
|
103283
|
-
* @credits React Bits by David H
|
|
103510
|
+
* @license Commercial
|
|
103284
103511
|
*/
|
|
103285
103512
|
/**
|
|
103286
103513
|
* ScrollReveal Component
|