@moontra/moonui-pro 2.18.6 → 2.19.0
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 +643 -283
- package/package.json +1 -1
- package/src/components/animated-button/index.tsx +240 -53
- package/src/components/index.ts +5 -1
- package/src/components/ui/hover-card-3d.tsx +397 -28
- package/src/components/ui/index.ts +5 -0
- package/src/components/ui/animated-button.tsx +0 -185
package/dist/index.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
10
10
|
import { startOfDay, endOfDay, addDays, startOfYear, endOfYear, startOfMonth, endOfMonth, startOfWeek, endOfWeek, isWithinInterval, isBefore, isAfter, subYears, addYears, subMonths, addMonths, subWeeks, addWeeks, subDays, addHours, setHours, setMinutes, differenceInMinutes, addMinutes, format, isSameDay, isToday, eachDayOfInterval, isSameMonth, eachMonthOfInterval, getDay, getDaysInMonth, formatDistanceToNow } from 'date-fns';
|
|
11
|
-
import { motion,
|
|
11
|
+
import { motion, useMotionValue, useSpring, useTransform, AnimatePresence, animate, LayoutGroup, Reorder, useDragControls } from 'framer-motion';
|
|
12
12
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
13
13
|
import * as ReactDOM from 'react-dom';
|
|
14
14
|
import ReactDOM__default from 'react-dom';
|
|
@@ -9493,6 +9493,361 @@ var HoverCardContent2 = t.forwardRef(({ className, align = "center", sideOffset
|
|
|
9493
9493
|
}
|
|
9494
9494
|
));
|
|
9495
9495
|
HoverCardContent2.displayName = Content22.displayName;
|
|
9496
|
+
var hoverCard3DVariants = cva(
|
|
9497
|
+
"relative w-full h-full",
|
|
9498
|
+
{
|
|
9499
|
+
variants: {
|
|
9500
|
+
variant: {
|
|
9501
|
+
subtle: "",
|
|
9502
|
+
dramatic: "",
|
|
9503
|
+
gaming: "",
|
|
9504
|
+
elegant: "",
|
|
9505
|
+
neon: ""
|
|
9506
|
+
},
|
|
9507
|
+
shadowIntensity: {
|
|
9508
|
+
none: "",
|
|
9509
|
+
light: "",
|
|
9510
|
+
medium: "",
|
|
9511
|
+
heavy: "",
|
|
9512
|
+
extreme: ""
|
|
9513
|
+
},
|
|
9514
|
+
glowEffect: {
|
|
9515
|
+
none: "",
|
|
9516
|
+
subtle: "",
|
|
9517
|
+
vibrant: "",
|
|
9518
|
+
neon: ""
|
|
9519
|
+
}
|
|
9520
|
+
},
|
|
9521
|
+
defaultVariants: {
|
|
9522
|
+
variant: "subtle",
|
|
9523
|
+
shadowIntensity: "medium",
|
|
9524
|
+
glowEffect: "none"
|
|
9525
|
+
}
|
|
9526
|
+
}
|
|
9527
|
+
);
|
|
9528
|
+
var variantConfigs = {
|
|
9529
|
+
subtle: {
|
|
9530
|
+
maxRotation: 10,
|
|
9531
|
+
scale: 1.02,
|
|
9532
|
+
springConfig: { stiffness: 400, damping: 30 }
|
|
9533
|
+
},
|
|
9534
|
+
dramatic: {
|
|
9535
|
+
maxRotation: 25,
|
|
9536
|
+
scale: 1.1,
|
|
9537
|
+
springConfig: { stiffness: 200, damping: 20 }
|
|
9538
|
+
},
|
|
9539
|
+
gaming: {
|
|
9540
|
+
maxRotation: 30,
|
|
9541
|
+
scale: 1.15,
|
|
9542
|
+
springConfig: { stiffness: 300, damping: 15 }
|
|
9543
|
+
},
|
|
9544
|
+
elegant: {
|
|
9545
|
+
maxRotation: 8,
|
|
9546
|
+
scale: 1.03,
|
|
9547
|
+
springConfig: { stiffness: 500, damping: 40 }
|
|
9548
|
+
},
|
|
9549
|
+
neon: {
|
|
9550
|
+
maxRotation: 20,
|
|
9551
|
+
scale: 1.08,
|
|
9552
|
+
springConfig: { stiffness: 250, damping: 25 }
|
|
9553
|
+
}
|
|
9554
|
+
};
|
|
9555
|
+
var shadowIntensityMap = {
|
|
9556
|
+
none: "none",
|
|
9557
|
+
light: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
9558
|
+
medium: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
9559
|
+
heavy: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
9560
|
+
extreme: "0 25px 50px -12px rgb(0 0 0 / 0.25)"
|
|
9561
|
+
};
|
|
9562
|
+
var HoverCard3D = t.forwardRef(
|
|
9563
|
+
({
|
|
9564
|
+
children,
|
|
9565
|
+
className,
|
|
9566
|
+
variant = "subtle",
|
|
9567
|
+
shadowIntensity = "medium",
|
|
9568
|
+
glowEffect = "none",
|
|
9569
|
+
maxRotation,
|
|
9570
|
+
scale,
|
|
9571
|
+
perspective = 1e3,
|
|
9572
|
+
animationSpeed = 1,
|
|
9573
|
+
springConfig,
|
|
9574
|
+
overlay,
|
|
9575
|
+
overlayAlwaysVisible = false,
|
|
9576
|
+
glowColor = "rgb(99, 102, 241)",
|
|
9577
|
+
glowBlur = 20,
|
|
9578
|
+
glowSpread = 5,
|
|
9579
|
+
enableTouch = true,
|
|
9580
|
+
enableKeyboard = true,
|
|
9581
|
+
rotateAxes = { x: true, y: true },
|
|
9582
|
+
animationDelay = 0,
|
|
9583
|
+
onHoverStart,
|
|
9584
|
+
onHoverEnd,
|
|
9585
|
+
onRotationChange,
|
|
9586
|
+
ariaLabel,
|
|
9587
|
+
autoFocus = false,
|
|
9588
|
+
...props
|
|
9589
|
+
}, ref) => {
|
|
9590
|
+
const cardRef = t.useRef(null);
|
|
9591
|
+
const [isHovered, setIsHovered] = t.useState(false);
|
|
9592
|
+
const [isFocused, setIsFocused] = t.useState(false);
|
|
9593
|
+
const variantConfig = variantConfigs[variant] || variantConfigs.subtle;
|
|
9594
|
+
const finalMaxRotation = maxRotation ?? variantConfig.maxRotation;
|
|
9595
|
+
const finalScale = scale ?? variantConfig.scale;
|
|
9596
|
+
const finalSpringConfig = springConfig ?? variantConfig.springConfig;
|
|
9597
|
+
const speedFactor = Math.max(0.1, Math.min(1, animationSpeed));
|
|
9598
|
+
const adjustedSpringConfig = {
|
|
9599
|
+
...finalSpringConfig,
|
|
9600
|
+
stiffness: (finalSpringConfig.stiffness || 300) * speedFactor,
|
|
9601
|
+
damping: (finalSpringConfig.damping || 20) / speedFactor
|
|
9602
|
+
};
|
|
9603
|
+
const mouseX = useMotionValue(0);
|
|
9604
|
+
const mouseY = useMotionValue(0);
|
|
9605
|
+
const rotateX = useSpring(
|
|
9606
|
+
useTransform(
|
|
9607
|
+
mouseY,
|
|
9608
|
+
[-0.5, 0.5],
|
|
9609
|
+
rotateAxes.x ? [finalMaxRotation, -finalMaxRotation] : [0, 0]
|
|
9610
|
+
),
|
|
9611
|
+
adjustedSpringConfig
|
|
9612
|
+
);
|
|
9613
|
+
const rotateY = useSpring(
|
|
9614
|
+
useTransform(
|
|
9615
|
+
mouseX,
|
|
9616
|
+
[-0.5, 0.5],
|
|
9617
|
+
rotateAxes.y ? [-finalMaxRotation, finalMaxRotation] : [0, 0]
|
|
9618
|
+
),
|
|
9619
|
+
adjustedSpringConfig
|
|
9620
|
+
);
|
|
9621
|
+
t.useEffect(() => {
|
|
9622
|
+
if (onRotationChange) {
|
|
9623
|
+
const unsubscribeX = rotateX.on("change", (x) => {
|
|
9624
|
+
const y = rotateY.get();
|
|
9625
|
+
onRotationChange(x, y);
|
|
9626
|
+
});
|
|
9627
|
+
const unsubscribeY = rotateY.on("change", (y) => {
|
|
9628
|
+
const x = rotateX.get();
|
|
9629
|
+
onRotationChange(x, y);
|
|
9630
|
+
});
|
|
9631
|
+
return () => {
|
|
9632
|
+
unsubscribeX();
|
|
9633
|
+
unsubscribeY();
|
|
9634
|
+
};
|
|
9635
|
+
}
|
|
9636
|
+
}, [rotateX, rotateY, onRotationChange]);
|
|
9637
|
+
const calculatePosition = t.useCallback(
|
|
9638
|
+
(clientX, clientY) => {
|
|
9639
|
+
if (!cardRef.current)
|
|
9640
|
+
return;
|
|
9641
|
+
const rect = cardRef.current.getBoundingClientRect();
|
|
9642
|
+
const width = rect.width;
|
|
9643
|
+
const height = rect.height;
|
|
9644
|
+
const x = clientX - rect.left;
|
|
9645
|
+
const y = clientY - rect.top;
|
|
9646
|
+
const xPct = x / width - 0.5;
|
|
9647
|
+
const yPct = y / height - 0.5;
|
|
9648
|
+
mouseX.set(xPct);
|
|
9649
|
+
mouseY.set(yPct);
|
|
9650
|
+
},
|
|
9651
|
+
[mouseX, mouseY]
|
|
9652
|
+
);
|
|
9653
|
+
const handleMouseMove2 = t.useCallback(
|
|
9654
|
+
(e) => {
|
|
9655
|
+
calculatePosition(e.clientX, e.clientY);
|
|
9656
|
+
},
|
|
9657
|
+
[calculatePosition]
|
|
9658
|
+
);
|
|
9659
|
+
const handleTouchMove = t.useCallback(
|
|
9660
|
+
(e) => {
|
|
9661
|
+
if (!enableTouch)
|
|
9662
|
+
return;
|
|
9663
|
+
const touch = e.touches[0];
|
|
9664
|
+
calculatePosition(touch.clientX, touch.clientY);
|
|
9665
|
+
},
|
|
9666
|
+
[calculatePosition, enableTouch]
|
|
9667
|
+
);
|
|
9668
|
+
const handleMouseEnter = t.useCallback(() => {
|
|
9669
|
+
setIsHovered(true);
|
|
9670
|
+
onHoverStart?.();
|
|
9671
|
+
}, [onHoverStart]);
|
|
9672
|
+
const handleMouseLeave2 = t.useCallback(() => {
|
|
9673
|
+
mouseX.set(0);
|
|
9674
|
+
mouseY.set(0);
|
|
9675
|
+
setIsHovered(false);
|
|
9676
|
+
onHoverEnd?.();
|
|
9677
|
+
}, [mouseX, mouseY, onHoverEnd]);
|
|
9678
|
+
const handleTouchEnd = t.useCallback(() => {
|
|
9679
|
+
if (!enableTouch)
|
|
9680
|
+
return;
|
|
9681
|
+
handleMouseLeave2();
|
|
9682
|
+
}, [handleMouseLeave2, enableTouch]);
|
|
9683
|
+
const handleKeyDown3 = t.useCallback(
|
|
9684
|
+
(e) => {
|
|
9685
|
+
if (!enableKeyboard)
|
|
9686
|
+
return;
|
|
9687
|
+
const step = 0.1;
|
|
9688
|
+
let newX = mouseX.get();
|
|
9689
|
+
let newY = mouseY.get();
|
|
9690
|
+
switch (e.key) {
|
|
9691
|
+
case "ArrowUp":
|
|
9692
|
+
newY = Math.max(-0.5, newY - step);
|
|
9693
|
+
break;
|
|
9694
|
+
case "ArrowDown":
|
|
9695
|
+
newY = Math.min(0.5, newY + step);
|
|
9696
|
+
break;
|
|
9697
|
+
case "ArrowLeft":
|
|
9698
|
+
newX = Math.max(-0.5, newX - step);
|
|
9699
|
+
break;
|
|
9700
|
+
case "ArrowRight":
|
|
9701
|
+
newX = Math.min(0.5, newX + step);
|
|
9702
|
+
break;
|
|
9703
|
+
case "Enter":
|
|
9704
|
+
case " ":
|
|
9705
|
+
setIsHovered(!isHovered);
|
|
9706
|
+
if (!isHovered) {
|
|
9707
|
+
onHoverStart?.();
|
|
9708
|
+
} else {
|
|
9709
|
+
onHoverEnd?.();
|
|
9710
|
+
}
|
|
9711
|
+
break;
|
|
9712
|
+
case "Escape":
|
|
9713
|
+
newX = 0;
|
|
9714
|
+
newY = 0;
|
|
9715
|
+
setIsHovered(false);
|
|
9716
|
+
onHoverEnd?.();
|
|
9717
|
+
break;
|
|
9718
|
+
default:
|
|
9719
|
+
return;
|
|
9720
|
+
}
|
|
9721
|
+
e.preventDefault();
|
|
9722
|
+
mouseX.set(newX);
|
|
9723
|
+
mouseY.set(newY);
|
|
9724
|
+
},
|
|
9725
|
+
[mouseX, mouseY, isHovered, enableKeyboard, onHoverStart, onHoverEnd]
|
|
9726
|
+
);
|
|
9727
|
+
const handleFocus = t.useCallback(() => {
|
|
9728
|
+
setIsFocused(true);
|
|
9729
|
+
}, []);
|
|
9730
|
+
const handleBlur = t.useCallback(() => {
|
|
9731
|
+
setIsFocused(false);
|
|
9732
|
+
if (!isHovered) {
|
|
9733
|
+
mouseX.set(0);
|
|
9734
|
+
mouseY.set(0);
|
|
9735
|
+
}
|
|
9736
|
+
}, [mouseX, mouseY, isHovered]);
|
|
9737
|
+
const glowStyle = t.useMemo(() => {
|
|
9738
|
+
if (glowEffect === "none")
|
|
9739
|
+
return {};
|
|
9740
|
+
const intensity = {
|
|
9741
|
+
subtle: 0.3,
|
|
9742
|
+
vibrant: 0.6,
|
|
9743
|
+
neon: 1
|
|
9744
|
+
}[glowEffect] || 0.3;
|
|
9745
|
+
return {
|
|
9746
|
+
boxShadow: isHovered ? `0 0 ${glowBlur}px ${glowSpread}px ${glowColor}${Math.round(intensity * 255).toString(16).padStart(2, "0")}` : void 0
|
|
9747
|
+
};
|
|
9748
|
+
}, [glowEffect, glowColor, glowBlur, glowSpread, isHovered]);
|
|
9749
|
+
const overlayContent = t.useMemo(() => {
|
|
9750
|
+
if (!overlay)
|
|
9751
|
+
return null;
|
|
9752
|
+
if (typeof overlay === "function") {
|
|
9753
|
+
return overlay({
|
|
9754
|
+
isHovered,
|
|
9755
|
+
rotateX: rotateX.get(),
|
|
9756
|
+
rotateY: rotateY.get()
|
|
9757
|
+
});
|
|
9758
|
+
}
|
|
9759
|
+
return overlay;
|
|
9760
|
+
}, [overlay, isHovered, rotateX, rotateY]);
|
|
9761
|
+
return /* @__PURE__ */ jsx(
|
|
9762
|
+
"div",
|
|
9763
|
+
{
|
|
9764
|
+
ref,
|
|
9765
|
+
className: cn("relative", className),
|
|
9766
|
+
style: { perspective },
|
|
9767
|
+
...props,
|
|
9768
|
+
children: /* @__PURE__ */ jsxs(
|
|
9769
|
+
motion.div,
|
|
9770
|
+
{
|
|
9771
|
+
ref: cardRef,
|
|
9772
|
+
className: cn(
|
|
9773
|
+
hoverCard3DVariants({ variant, shadowIntensity, glowEffect }),
|
|
9774
|
+
"transition-shadow duration-300",
|
|
9775
|
+
isFocused && "ring-2 ring-primary ring-offset-2 ring-offset-background"
|
|
9776
|
+
),
|
|
9777
|
+
style: {
|
|
9778
|
+
rotateX,
|
|
9779
|
+
rotateY,
|
|
9780
|
+
transformStyle: "preserve-3d",
|
|
9781
|
+
boxShadow: shadowIntensityMap[shadowIntensity],
|
|
9782
|
+
...glowStyle
|
|
9783
|
+
},
|
|
9784
|
+
onMouseMove: handleMouseMove2,
|
|
9785
|
+
onMouseEnter: handleMouseEnter,
|
|
9786
|
+
onMouseLeave: handleMouseLeave2,
|
|
9787
|
+
onTouchMove: handleTouchMove,
|
|
9788
|
+
onTouchEnd: handleTouchEnd,
|
|
9789
|
+
onKeyDown: handleKeyDown3,
|
|
9790
|
+
onFocus: handleFocus,
|
|
9791
|
+
onBlur: handleBlur,
|
|
9792
|
+
whileHover: { scale: finalScale },
|
|
9793
|
+
initial: { scale: 1 },
|
|
9794
|
+
transition: {
|
|
9795
|
+
type: "spring",
|
|
9796
|
+
delay: animationDelay / 1e3,
|
|
9797
|
+
...adjustedSpringConfig
|
|
9798
|
+
},
|
|
9799
|
+
tabIndex: enableKeyboard ? 0 : -1,
|
|
9800
|
+
role: "button",
|
|
9801
|
+
"aria-label": ariaLabel || "3D hover card",
|
|
9802
|
+
autoFocus,
|
|
9803
|
+
children: [
|
|
9804
|
+
(overlayAlwaysVisible || isHovered) && overlayContent && /* @__PURE__ */ jsx(
|
|
9805
|
+
"div",
|
|
9806
|
+
{
|
|
9807
|
+
className: "absolute inset-0 rounded-lg pointer-events-none",
|
|
9808
|
+
style: {
|
|
9809
|
+
transform: "translateZ(1px)"
|
|
9810
|
+
},
|
|
9811
|
+
children: overlayContent
|
|
9812
|
+
}
|
|
9813
|
+
),
|
|
9814
|
+
!overlay && variant !== "neon" && /* @__PURE__ */ jsx(
|
|
9815
|
+
"div",
|
|
9816
|
+
{
|
|
9817
|
+
className: cn(
|
|
9818
|
+
"absolute inset-0 rounded-lg bg-gradient-to-br from-white/20 to-white/0",
|
|
9819
|
+
"opacity-0 transition-opacity duration-300 pointer-events-none",
|
|
9820
|
+
isHovered && "opacity-100"
|
|
9821
|
+
),
|
|
9822
|
+
style: {
|
|
9823
|
+
transform: "translateZ(1px)"
|
|
9824
|
+
}
|
|
9825
|
+
}
|
|
9826
|
+
),
|
|
9827
|
+
variant === "neon" && /* @__PURE__ */ jsx(
|
|
9828
|
+
"div",
|
|
9829
|
+
{
|
|
9830
|
+
className: cn(
|
|
9831
|
+
"absolute inset-0 rounded-lg",
|
|
9832
|
+
"opacity-0 transition-opacity duration-300 pointer-events-none",
|
|
9833
|
+
isHovered && "opacity-100"
|
|
9834
|
+
),
|
|
9835
|
+
style: {
|
|
9836
|
+
transform: "translateZ(2px)",
|
|
9837
|
+
background: `linear-gradient(45deg, ${glowColor}20, transparent, ${glowColor}20)`,
|
|
9838
|
+
filter: "blur(10px)"
|
|
9839
|
+
}
|
|
9840
|
+
}
|
|
9841
|
+
),
|
|
9842
|
+
children
|
|
9843
|
+
]
|
|
9844
|
+
}
|
|
9845
|
+
)
|
|
9846
|
+
}
|
|
9847
|
+
);
|
|
9848
|
+
}
|
|
9849
|
+
);
|
|
9850
|
+
HoverCard3D.displayName = "HoverCard3D";
|
|
9496
9851
|
|
|
9497
9852
|
// src/hooks/use-subscription.ts
|
|
9498
9853
|
function useSubscription() {
|
|
@@ -9509,8 +9864,8 @@ function useSubscription() {
|
|
|
9509
9864
|
}
|
|
9510
9865
|
};
|
|
9511
9866
|
}
|
|
9512
|
-
var
|
|
9513
|
-
"relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-
|
|
9867
|
+
var moonUIAnimatedButtonProVariants = cva(
|
|
9868
|
+
"relative inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 overflow-hidden min-w-fit",
|
|
9514
9869
|
{
|
|
9515
9870
|
variants: {
|
|
9516
9871
|
variant: {
|
|
@@ -9519,12 +9874,16 @@ var animatedButtonVariants = cva(
|
|
|
9519
9874
|
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
9520
9875
|
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
9521
9876
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
9522
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
9877
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
9878
|
+
gradient: "bg-gradient-to-r from-purple-600 to-pink-600 text-white hover:from-purple-700 hover:to-pink-700",
|
|
9879
|
+
glow: "bg-primary text-primary-foreground shadow-lg hover:shadow-xl hover:shadow-primary/25"
|
|
9523
9880
|
},
|
|
9524
9881
|
size: {
|
|
9525
9882
|
default: "h-9 px-4 py-2",
|
|
9526
9883
|
sm: "h-8 rounded-md px-3 text-xs",
|
|
9527
|
-
lg: "h-10 rounded-md px-8"
|
|
9884
|
+
lg: "h-10 rounded-md px-8",
|
|
9885
|
+
xl: "h-11 rounded-md px-6 text-base font-medium",
|
|
9886
|
+
icon: "h-9 w-9"
|
|
9528
9887
|
}
|
|
9529
9888
|
},
|
|
9530
9889
|
defaultVariants: {
|
|
@@ -9533,42 +9892,97 @@ var animatedButtonVariants = cva(
|
|
|
9533
9892
|
}
|
|
9534
9893
|
}
|
|
9535
9894
|
);
|
|
9536
|
-
var
|
|
9537
|
-
({
|
|
9895
|
+
var MoonUIAnimatedButtonProInternal = t__default.forwardRef(
|
|
9896
|
+
({
|
|
9897
|
+
className,
|
|
9898
|
+
variant,
|
|
9899
|
+
size: size4,
|
|
9900
|
+
animation = "none",
|
|
9901
|
+
state = "idle",
|
|
9902
|
+
onStateChange,
|
|
9903
|
+
children,
|
|
9904
|
+
onClick,
|
|
9905
|
+
loadingText = "Loading...",
|
|
9906
|
+
successText = "Success!",
|
|
9907
|
+
errorText = "Error!",
|
|
9908
|
+
ripple = false,
|
|
9909
|
+
iconRotate = false,
|
|
9910
|
+
shimmerSpeed = "normal",
|
|
9911
|
+
glowIntensity = "medium",
|
|
9912
|
+
showProgressBar = false,
|
|
9913
|
+
autoResetDelay = 2e3,
|
|
9914
|
+
onDrag,
|
|
9915
|
+
onDragEnd,
|
|
9916
|
+
onDragStart,
|
|
9917
|
+
onAnimationStart,
|
|
9918
|
+
onAnimationEnd,
|
|
9919
|
+
...props
|
|
9920
|
+
}, ref) => {
|
|
9538
9921
|
const [internalState, setInternalState] = useState("idle");
|
|
9922
|
+
const [ripples, setRipples] = useState([]);
|
|
9923
|
+
const [progress, setProgress] = useState(0);
|
|
9924
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
9539
9925
|
const currentState = state !== "idle" ? state : internalState;
|
|
9540
9926
|
const handleClick2 = async (e) => {
|
|
9541
9927
|
if (currentState === "loading")
|
|
9542
9928
|
return;
|
|
9929
|
+
if (ripple) {
|
|
9930
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
9931
|
+
const x = e.clientX - rect.left;
|
|
9932
|
+
const y = e.clientY - rect.top;
|
|
9933
|
+
const id = Date.now();
|
|
9934
|
+
setRipples([...ripples, { x, y, id }]);
|
|
9935
|
+
setTimeout(() => {
|
|
9936
|
+
setRipples((prev) => prev.filter((r2) => r2.id !== id));
|
|
9937
|
+
}, 600);
|
|
9938
|
+
}
|
|
9543
9939
|
setInternalState("loading");
|
|
9544
9940
|
onStateChange?.("loading");
|
|
9941
|
+
setProgress(0);
|
|
9942
|
+
if (showProgressBar) {
|
|
9943
|
+
const progressInterval = setInterval(() => {
|
|
9944
|
+
setProgress((prev) => {
|
|
9945
|
+
if (prev >= 90) {
|
|
9946
|
+
clearInterval(progressInterval);
|
|
9947
|
+
return 90;
|
|
9948
|
+
}
|
|
9949
|
+
return prev + 10;
|
|
9950
|
+
});
|
|
9951
|
+
}, 200);
|
|
9952
|
+
}
|
|
9545
9953
|
if (onClick) {
|
|
9546
9954
|
try {
|
|
9547
9955
|
await onClick(e);
|
|
9956
|
+
setProgress(100);
|
|
9548
9957
|
setInternalState("success");
|
|
9549
9958
|
onStateChange?.("success");
|
|
9550
9959
|
setTimeout(() => {
|
|
9551
9960
|
setInternalState("idle");
|
|
9552
9961
|
onStateChange?.("idle");
|
|
9553
|
-
|
|
9962
|
+
setProgress(0);
|
|
9963
|
+
}, autoResetDelay);
|
|
9554
9964
|
} catch (error) {
|
|
9965
|
+
setProgress(0);
|
|
9555
9966
|
setInternalState("error");
|
|
9556
9967
|
onStateChange?.("error");
|
|
9557
9968
|
setTimeout(() => {
|
|
9558
9969
|
setInternalState("idle");
|
|
9559
9970
|
onStateChange?.("idle");
|
|
9560
|
-
},
|
|
9971
|
+
}, autoResetDelay);
|
|
9561
9972
|
}
|
|
9562
9973
|
}
|
|
9563
9974
|
};
|
|
9564
9975
|
const getIcon = () => {
|
|
9976
|
+
const iconClass = cn("h-4 w-4", {
|
|
9977
|
+
"animate-spin": currentState === "loading" || iconRotate && currentState !== "idle"
|
|
9978
|
+
});
|
|
9565
9979
|
switch (currentState) {
|
|
9566
9980
|
case "loading":
|
|
9567
|
-
return /* @__PURE__ */ jsx(Loader2, { className:
|
|
9981
|
+
return /* @__PURE__ */ jsx(Loader2, { className: iconClass });
|
|
9568
9982
|
case "success":
|
|
9569
|
-
return /* @__PURE__ */ jsx(Check, { className: "
|
|
9983
|
+
return /* @__PURE__ */ jsx(Check, { className: cn(iconClass, "animate-scale-in") });
|
|
9570
9984
|
case "error":
|
|
9571
|
-
return /* @__PURE__ */ jsx(X, { className: "
|
|
9985
|
+
return /* @__PURE__ */ jsx(X, { className: cn(iconClass, "animate-shake") });
|
|
9572
9986
|
default:
|
|
9573
9987
|
return null;
|
|
9574
9988
|
}
|
|
@@ -9583,50 +9997,107 @@ var AnimatedButtonInternal = t__default.forwardRef(
|
|
|
9583
9997
|
return "";
|
|
9584
9998
|
}
|
|
9585
9999
|
};
|
|
10000
|
+
const getGlowIntensity = () => {
|
|
10001
|
+
switch (glowIntensity) {
|
|
10002
|
+
case "low":
|
|
10003
|
+
return "shadow-lg";
|
|
10004
|
+
case "high":
|
|
10005
|
+
return "shadow-2xl";
|
|
10006
|
+
default:
|
|
10007
|
+
return "shadow-xl";
|
|
10008
|
+
}
|
|
10009
|
+
};
|
|
10010
|
+
let whileHoverAnimation = void 0;
|
|
10011
|
+
let whileTapAnimation = void 0;
|
|
10012
|
+
if (animation === "bounce") {
|
|
10013
|
+
whileHoverAnimation = {
|
|
10014
|
+
y: [0, -10, 0],
|
|
10015
|
+
transition: {
|
|
10016
|
+
duration: 0.6,
|
|
10017
|
+
repeat: Infinity,
|
|
10018
|
+
repeatType: "loop"
|
|
10019
|
+
}
|
|
10020
|
+
};
|
|
10021
|
+
} else if (animation === "pulse") {
|
|
10022
|
+
whileHoverAnimation = {
|
|
10023
|
+
scale: [1, 1.1, 1],
|
|
10024
|
+
transition: {
|
|
10025
|
+
duration: 1,
|
|
10026
|
+
repeat: Infinity,
|
|
10027
|
+
repeatType: "loop"
|
|
10028
|
+
}
|
|
10029
|
+
};
|
|
10030
|
+
} else if (animation === "shake") {
|
|
10031
|
+
whileHoverAnimation = void 0;
|
|
10032
|
+
} else if (animation === "rotate") {
|
|
10033
|
+
whileHoverAnimation = {
|
|
10034
|
+
rotate: 10,
|
|
10035
|
+
transition: { type: "spring", stiffness: 300 }
|
|
10036
|
+
};
|
|
10037
|
+
} else if (animation === "scale") {
|
|
10038
|
+
whileHoverAnimation = { scale: 1.05 };
|
|
10039
|
+
whileTapAnimation = { scale: 0.95 };
|
|
10040
|
+
} else if (animation === "slide") {
|
|
10041
|
+
whileHoverAnimation = { y: -4 };
|
|
10042
|
+
}
|
|
9586
10043
|
return /* @__PURE__ */ jsxs(
|
|
9587
|
-
|
|
10044
|
+
motion.button,
|
|
9588
10045
|
{
|
|
9589
|
-
|
|
10046
|
+
...props,
|
|
10047
|
+
className: cn(
|
|
10048
|
+
moonUIAnimatedButtonProVariants({ variant, size: size4 }),
|
|
10049
|
+
variant === "glow" && getGlowIntensity(),
|
|
10050
|
+
animation === "shake" && isHovered && "animate-shake",
|
|
10051
|
+
className
|
|
10052
|
+
),
|
|
9590
10053
|
ref,
|
|
9591
10054
|
onClick: handleClick2,
|
|
9592
10055
|
disabled: currentState === "loading" || props.disabled,
|
|
9593
|
-
|
|
10056
|
+
onMouseEnter: () => setIsHovered(true),
|
|
10057
|
+
onMouseLeave: () => setIsHovered(false),
|
|
10058
|
+
whileHover: whileHoverAnimation,
|
|
10059
|
+
whileTap: whileTapAnimation,
|
|
9594
10060
|
children: [
|
|
9595
|
-
/* @__PURE__ */
|
|
10061
|
+
showProgressBar && currentState === "loading" && /* @__PURE__ */ jsx(
|
|
9596
10062
|
motion.div,
|
|
9597
10063
|
{
|
|
9598
|
-
className: "
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
}
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
),
|
|
9616
|
-
/* @__PURE__ */ jsx(
|
|
9617
|
-
motion.span,
|
|
9618
|
-
{
|
|
9619
|
-
animate: {
|
|
9620
|
-
opacity: currentState === "idle" ? 1 : 0,
|
|
9621
|
-
x: currentState !== "idle" ? -20 : 0
|
|
9622
|
-
},
|
|
9623
|
-
transition: { duration: 0.2 },
|
|
9624
|
-
children
|
|
9625
|
-
}
|
|
9626
|
-
)
|
|
9627
|
-
]
|
|
10064
|
+
className: "absolute bottom-0 left-0 h-1 bg-primary-foreground/20 rounded-full",
|
|
10065
|
+
initial: { width: 0 },
|
|
10066
|
+
animate: { width: `${progress}%` },
|
|
10067
|
+
transition: { duration: 0.3 }
|
|
10068
|
+
}
|
|
10069
|
+
),
|
|
10070
|
+
animation === "shimmer" && /* @__PURE__ */ jsx(
|
|
10071
|
+
motion.div,
|
|
10072
|
+
{
|
|
10073
|
+
className: "absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent",
|
|
10074
|
+
initial: { x: "-100%" },
|
|
10075
|
+
animate: { x: "100%" },
|
|
10076
|
+
transition: {
|
|
10077
|
+
duration: shimmerSpeed === "slow" ? 1.5 : shimmerSpeed === "fast" ? 0.5 : 1,
|
|
10078
|
+
repeat: Infinity,
|
|
10079
|
+
repeatDelay: 1
|
|
10080
|
+
}
|
|
9628
10081
|
}
|
|
9629
10082
|
),
|
|
10083
|
+
/* @__PURE__ */ jsx("div", { className: "relative flex items-center justify-center gap-2 z-10", children: size4 === "icon" ? (
|
|
10084
|
+
// Icon size için sadece icon göster
|
|
10085
|
+
currentState === "idle" ? children : getIcon()
|
|
10086
|
+
) : (
|
|
10087
|
+
// Diğer boyutlar için normal akış
|
|
10088
|
+
/* @__PURE__ */ jsx(Fragment, { children: currentState === "idle" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10089
|
+
t__default.isValidElement(children) && t__default.cloneElement(children),
|
|
10090
|
+
typeof children === "string" && children,
|
|
10091
|
+
t__default.isValidElement(children) || typeof children === "string" ? null : children
|
|
10092
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
10093
|
+
getIcon(),
|
|
10094
|
+
/* @__PURE__ */ jsxs("span", { className: "ml-2", children: [
|
|
10095
|
+
currentState === "loading" && loadingText,
|
|
10096
|
+
currentState === "success" && successText,
|
|
10097
|
+
currentState === "error" && errorText
|
|
10098
|
+
] })
|
|
10099
|
+
] }) })
|
|
10100
|
+
) }),
|
|
9630
10101
|
/* @__PURE__ */ jsx(
|
|
9631
10102
|
motion.div,
|
|
9632
10103
|
{
|
|
@@ -9637,23 +10108,36 @@ var AnimatedButtonInternal = t__default.forwardRef(
|
|
|
9637
10108
|
initial: { scale: 0, opacity: 0 },
|
|
9638
10109
|
animate: {
|
|
9639
10110
|
scale: currentState === "success" || currentState === "error" ? 1 : 0,
|
|
9640
|
-
opacity: currentState === "success" || currentState === "error" ?
|
|
10111
|
+
opacity: currentState === "success" || currentState === "error" ? 0.2 : 0
|
|
9641
10112
|
},
|
|
9642
10113
|
transition: { duration: 0.3 },
|
|
9643
|
-
style: { zIndex:
|
|
10114
|
+
style: { zIndex: 0 }
|
|
9644
10115
|
}
|
|
9645
|
-
)
|
|
10116
|
+
),
|
|
10117
|
+
ripples.map((ripple2) => /* @__PURE__ */ jsx(
|
|
10118
|
+
"span",
|
|
10119
|
+
{
|
|
10120
|
+
className: "absolute bg-primary/20 rounded-full animate-ripple pointer-events-none",
|
|
10121
|
+
style: {
|
|
10122
|
+
left: ripple2.x - 10,
|
|
10123
|
+
top: ripple2.y - 10,
|
|
10124
|
+
width: 20,
|
|
10125
|
+
height: 20
|
|
10126
|
+
}
|
|
10127
|
+
},
|
|
10128
|
+
ripple2.id
|
|
10129
|
+
))
|
|
9646
10130
|
]
|
|
9647
10131
|
}
|
|
9648
10132
|
);
|
|
9649
10133
|
}
|
|
9650
10134
|
);
|
|
9651
|
-
|
|
9652
|
-
var
|
|
9653
|
-
(
|
|
10135
|
+
MoonUIAnimatedButtonProInternal.displayName = "MoonUIAnimatedButtonProInternal";
|
|
10136
|
+
var MoonUIAnimatedButtonPro = t__default.forwardRef(
|
|
10137
|
+
(props, ref) => {
|
|
9654
10138
|
const { hasProAccess, isLoading } = useSubscription();
|
|
9655
10139
|
if (!isLoading && !hasProAccess) {
|
|
9656
|
-
return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-fit", className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-6 text-center", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
10140
|
+
return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-fit", props.className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-6 text-center", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
9657
10141
|
/* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
|
|
9658
10142
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
9659
10143
|
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm mb-2", children: "Pro Feature" }),
|
|
@@ -9665,10 +10149,10 @@ var AnimatedButton = t__default.forwardRef(
|
|
|
9665
10149
|
] })
|
|
9666
10150
|
] }) }) });
|
|
9667
10151
|
}
|
|
9668
|
-
return /* @__PURE__ */ jsx(
|
|
10152
|
+
return /* @__PURE__ */ jsx(MoonUIAnimatedButtonProInternal, { ...props, ref });
|
|
9669
10153
|
}
|
|
9670
10154
|
);
|
|
9671
|
-
|
|
10155
|
+
MoonUIAnimatedButtonPro.displayName = "MoonUIAnimatedButtonPro";
|
|
9672
10156
|
var ErrorBoundaryInternal = class extends Component {
|
|
9673
10157
|
constructor(props) {
|
|
9674
10158
|
super(props);
|
|
@@ -9877,130 +10361,6 @@ var FloatingActionButton = t__default.forwardRef(
|
|
|
9877
10361
|
}
|
|
9878
10362
|
);
|
|
9879
10363
|
FloatingActionButton.displayName = "FloatingActionButton";
|
|
9880
|
-
var HoverCard3DInternal = t__default.forwardRef(
|
|
9881
|
-
({
|
|
9882
|
-
children,
|
|
9883
|
-
className,
|
|
9884
|
-
perspective = 1e3,
|
|
9885
|
-
rotationIntensity = 15,
|
|
9886
|
-
springConfig = { stiffness: 200, damping: 15 },
|
|
9887
|
-
...props
|
|
9888
|
-
}, ref) => {
|
|
9889
|
-
const cardRef = useRef(null);
|
|
9890
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
9891
|
-
const x = useMotionValue(0);
|
|
9892
|
-
const y = useMotionValue(0);
|
|
9893
|
-
const springX = useSpring(x, springConfig);
|
|
9894
|
-
const springY = useSpring(y, springConfig);
|
|
9895
|
-
const rotateX = useTransform(springY, [-0.5, 0.5], [rotationIntensity, -rotationIntensity]);
|
|
9896
|
-
const rotateY = useTransform(springX, [-0.5, 0.5], [-rotationIntensity, rotationIntensity]);
|
|
9897
|
-
const handleMouseMove2 = (e) => {
|
|
9898
|
-
if (!cardRef.current)
|
|
9899
|
-
return;
|
|
9900
|
-
const rect = cardRef.current.getBoundingClientRect();
|
|
9901
|
-
const centerX = rect.left + rect.width / 2;
|
|
9902
|
-
const centerY = rect.top + rect.height / 2;
|
|
9903
|
-
const rotateXValue = (e.clientY - centerY) / (rect.height / 2);
|
|
9904
|
-
const rotateYValue = (e.clientX - centerX) / (rect.width / 2);
|
|
9905
|
-
x.set(rotateYValue);
|
|
9906
|
-
y.set(rotateXValue);
|
|
9907
|
-
};
|
|
9908
|
-
const handleMouseEnter = () => {
|
|
9909
|
-
setIsHovered(true);
|
|
9910
|
-
};
|
|
9911
|
-
const handleMouseLeave2 = () => {
|
|
9912
|
-
setIsHovered(false);
|
|
9913
|
-
x.set(0);
|
|
9914
|
-
y.set(0);
|
|
9915
|
-
};
|
|
9916
|
-
return /* @__PURE__ */ jsxs(
|
|
9917
|
-
motion.div,
|
|
9918
|
-
{
|
|
9919
|
-
ref: (node) => {
|
|
9920
|
-
cardRef.current = node;
|
|
9921
|
-
if (typeof ref === "function") {
|
|
9922
|
-
ref(node);
|
|
9923
|
-
} else if (ref) {
|
|
9924
|
-
ref.current = node;
|
|
9925
|
-
}
|
|
9926
|
-
},
|
|
9927
|
-
className: cn(
|
|
9928
|
-
"relative rounded-lg border bg-card text-card-foreground shadow-sm transition-colors duration-200 hover:bg-card/90",
|
|
9929
|
-
className
|
|
9930
|
-
),
|
|
9931
|
-
onMouseMove: handleMouseMove2,
|
|
9932
|
-
onMouseEnter: handleMouseEnter,
|
|
9933
|
-
onMouseLeave: handleMouseLeave2,
|
|
9934
|
-
style: {
|
|
9935
|
-
transformPerspective: perspective,
|
|
9936
|
-
transformStyle: "preserve-3d"
|
|
9937
|
-
},
|
|
9938
|
-
animate: {
|
|
9939
|
-
rotateX: isHovered ? rotateX.get() : 0,
|
|
9940
|
-
rotateY: isHovered ? rotateY.get() : 0,
|
|
9941
|
-
scale: isHovered ? 1.05 : 1
|
|
9942
|
-
},
|
|
9943
|
-
transition: { duration: 0.15 },
|
|
9944
|
-
children: [
|
|
9945
|
-
/* @__PURE__ */ jsx(
|
|
9946
|
-
motion.div,
|
|
9947
|
-
{
|
|
9948
|
-
className: "relative z-10",
|
|
9949
|
-
animate: {
|
|
9950
|
-
z: isHovered ? 20 : 0
|
|
9951
|
-
},
|
|
9952
|
-
transition: { duration: 0.2 },
|
|
9953
|
-
children
|
|
9954
|
-
}
|
|
9955
|
-
),
|
|
9956
|
-
/* @__PURE__ */ jsx(
|
|
9957
|
-
motion.div,
|
|
9958
|
-
{
|
|
9959
|
-
className: "absolute inset-0 rounded-lg bg-gradient-to-br from-white/5 via-transparent to-black/5 pointer-events-none",
|
|
9960
|
-
animate: {
|
|
9961
|
-
opacity: isHovered ? 1 : 0
|
|
9962
|
-
},
|
|
9963
|
-
transition: { duration: 0.3 }
|
|
9964
|
-
}
|
|
9965
|
-
),
|
|
9966
|
-
/* @__PURE__ */ jsx(
|
|
9967
|
-
motion.div,
|
|
9968
|
-
{
|
|
9969
|
-
className: "absolute inset-0 rounded-lg bg-primary/5 blur-xl",
|
|
9970
|
-
animate: {
|
|
9971
|
-
opacity: isHovered ? 0.8 : 0,
|
|
9972
|
-
scale: isHovered ? 1.2 : 1
|
|
9973
|
-
},
|
|
9974
|
-
transition: { duration: 0.3 },
|
|
9975
|
-
style: { zIndex: -1 }
|
|
9976
|
-
}
|
|
9977
|
-
)
|
|
9978
|
-
]
|
|
9979
|
-
}
|
|
9980
|
-
);
|
|
9981
|
-
}
|
|
9982
|
-
);
|
|
9983
|
-
HoverCard3DInternal.displayName = "HoverCard3DInternal";
|
|
9984
|
-
var HoverCard3D = t__default.forwardRef(
|
|
9985
|
-
({ className, ...props }, ref) => {
|
|
9986
|
-
const { hasProAccess, isLoading } = useSubscription();
|
|
9987
|
-
if (!isLoading && !hasProAccess) {
|
|
9988
|
-
return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-fit", className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-6 text-center", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
9989
|
-
/* @__PURE__ */ jsx("div", { className: "rounded-full bg-purple-100 dark:bg-purple-900/30 p-3 w-fit mx-auto", children: /* @__PURE__ */ jsx(Lock, { className: "h-6 w-6 text-purple-600 dark:text-purple-400" }) }),
|
|
9990
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
9991
|
-
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm mb-2", children: "Pro Feature" }),
|
|
9992
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs mb-4", children: "3D Hover Card is available exclusively to MoonUI Pro subscribers." }),
|
|
9993
|
-
/* @__PURE__ */ jsx("a", { href: "/pricing", children: /* @__PURE__ */ jsxs(MoonUIButtonPro, { size: "sm", children: [
|
|
9994
|
-
/* @__PURE__ */ jsx(Sparkles, { className: "mr-2 h-4 w-4" }),
|
|
9995
|
-
"Upgrade to Pro"
|
|
9996
|
-
] }) })
|
|
9997
|
-
] })
|
|
9998
|
-
] }) }) });
|
|
9999
|
-
}
|
|
10000
|
-
return /* @__PURE__ */ jsx(HoverCard3DInternal, { className, ref, ...props });
|
|
10001
|
-
}
|
|
10002
|
-
);
|
|
10003
|
-
HoverCard3D.displayName = "HoverCard3D";
|
|
10004
10364
|
var MagneticButtonInternal = t__default.forwardRef(
|
|
10005
10365
|
({
|
|
10006
10366
|
children,
|
|
@@ -15031,7 +15391,7 @@ function findDiffEnd(a, b, posA, posB) {
|
|
|
15031
15391
|
posB -= size4;
|
|
15032
15392
|
}
|
|
15033
15393
|
}
|
|
15034
|
-
var
|
|
15394
|
+
var Fragment9 = class {
|
|
15035
15395
|
/**
|
|
15036
15396
|
@internal
|
|
15037
15397
|
*/
|
|
@@ -15099,7 +15459,7 @@ var Fragment8 = class {
|
|
|
15099
15459
|
}
|
|
15100
15460
|
for (; i < other.content.length; i++)
|
|
15101
15461
|
content.push(other.content[i]);
|
|
15102
|
-
return new
|
|
15462
|
+
return new Fragment9(content, this.size + other.size);
|
|
15103
15463
|
}
|
|
15104
15464
|
/**
|
|
15105
15465
|
Cut out the sub-fragment between the two given positions.
|
|
@@ -15123,17 +15483,17 @@ var Fragment8 = class {
|
|
|
15123
15483
|
}
|
|
15124
15484
|
pos = end;
|
|
15125
15485
|
}
|
|
15126
|
-
return new
|
|
15486
|
+
return new Fragment9(result, size4);
|
|
15127
15487
|
}
|
|
15128
15488
|
/**
|
|
15129
15489
|
@internal
|
|
15130
15490
|
*/
|
|
15131
15491
|
cutByIndex(from2, to) {
|
|
15132
15492
|
if (from2 == to)
|
|
15133
|
-
return
|
|
15493
|
+
return Fragment9.empty;
|
|
15134
15494
|
if (from2 == 0 && to == this.content.length)
|
|
15135
15495
|
return this;
|
|
15136
|
-
return new
|
|
15496
|
+
return new Fragment9(this.content.slice(from2, to));
|
|
15137
15497
|
}
|
|
15138
15498
|
/**
|
|
15139
15499
|
Create a new fragment in which the node at the given index is
|
|
@@ -15146,21 +15506,21 @@ var Fragment8 = class {
|
|
|
15146
15506
|
let copy2 = this.content.slice();
|
|
15147
15507
|
let size4 = this.size + node.nodeSize - current.nodeSize;
|
|
15148
15508
|
copy2[index2] = node;
|
|
15149
|
-
return new
|
|
15509
|
+
return new Fragment9(copy2, size4);
|
|
15150
15510
|
}
|
|
15151
15511
|
/**
|
|
15152
15512
|
Create a new fragment by prepending the given node to this
|
|
15153
15513
|
fragment.
|
|
15154
15514
|
*/
|
|
15155
15515
|
addToStart(node) {
|
|
15156
|
-
return new
|
|
15516
|
+
return new Fragment9([node].concat(this.content), this.size + node.nodeSize);
|
|
15157
15517
|
}
|
|
15158
15518
|
/**
|
|
15159
15519
|
Create a new fragment by appending the given node to this
|
|
15160
15520
|
fragment.
|
|
15161
15521
|
*/
|
|
15162
15522
|
addToEnd(node) {
|
|
15163
|
-
return new
|
|
15523
|
+
return new Fragment9(this.content.concat(node), this.size + node.nodeSize);
|
|
15164
15524
|
}
|
|
15165
15525
|
/**
|
|
15166
15526
|
Compare this fragment to another one.
|
|
@@ -15279,10 +15639,10 @@ var Fragment8 = class {
|
|
|
15279
15639
|
*/
|
|
15280
15640
|
static fromJSON(schema, value) {
|
|
15281
15641
|
if (!value)
|
|
15282
|
-
return
|
|
15642
|
+
return Fragment9.empty;
|
|
15283
15643
|
if (!Array.isArray(value))
|
|
15284
15644
|
throw new RangeError("Invalid input for Fragment.fromJSON");
|
|
15285
|
-
return new
|
|
15645
|
+
return new Fragment9(value.map(schema.nodeFromJSON));
|
|
15286
15646
|
}
|
|
15287
15647
|
/**
|
|
15288
15648
|
Build a fragment from an array of nodes. Ensures that adjacent
|
|
@@ -15290,7 +15650,7 @@ var Fragment8 = class {
|
|
|
15290
15650
|
*/
|
|
15291
15651
|
static fromArray(array) {
|
|
15292
15652
|
if (!array.length)
|
|
15293
|
-
return
|
|
15653
|
+
return Fragment9.empty;
|
|
15294
15654
|
let joined, size4 = 0;
|
|
15295
15655
|
for (let i = 0; i < array.length; i++) {
|
|
15296
15656
|
let node = array[i];
|
|
@@ -15303,7 +15663,7 @@ var Fragment8 = class {
|
|
|
15303
15663
|
joined.push(node);
|
|
15304
15664
|
}
|
|
15305
15665
|
}
|
|
15306
|
-
return new
|
|
15666
|
+
return new Fragment9(joined || array, size4);
|
|
15307
15667
|
}
|
|
15308
15668
|
/**
|
|
15309
15669
|
Create a fragment from something that can be interpreted as a
|
|
@@ -15313,17 +15673,17 @@ var Fragment8 = class {
|
|
|
15313
15673
|
*/
|
|
15314
15674
|
static from(nodes) {
|
|
15315
15675
|
if (!nodes)
|
|
15316
|
-
return
|
|
15317
|
-
if (nodes instanceof
|
|
15676
|
+
return Fragment9.empty;
|
|
15677
|
+
if (nodes instanceof Fragment9)
|
|
15318
15678
|
return nodes;
|
|
15319
15679
|
if (Array.isArray(nodes))
|
|
15320
15680
|
return this.fromArray(nodes);
|
|
15321
15681
|
if (nodes.attrs)
|
|
15322
|
-
return new
|
|
15682
|
+
return new Fragment9([nodes], nodes.nodeSize);
|
|
15323
15683
|
throw new RangeError("Can not convert " + nodes + " to a Fragment" + (nodes.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
|
|
15324
15684
|
}
|
|
15325
15685
|
};
|
|
15326
|
-
|
|
15686
|
+
Fragment9.empty = new Fragment9([], 0);
|
|
15327
15687
|
var found = { index: 0, offset: 0 };
|
|
15328
15688
|
function retIndex(index2, offset4) {
|
|
15329
15689
|
found.index = index2;
|
|
@@ -15548,7 +15908,7 @@ var Slice = class {
|
|
|
15548
15908
|
let openStart = json2.openStart || 0, openEnd = json2.openEnd || 0;
|
|
15549
15909
|
if (typeof openStart != "number" || typeof openEnd != "number")
|
|
15550
15910
|
throw new RangeError("Invalid input for Slice.fromJSON");
|
|
15551
|
-
return new Slice(
|
|
15911
|
+
return new Slice(Fragment9.fromJSON(schema, json2.content), openStart, openEnd);
|
|
15552
15912
|
}
|
|
15553
15913
|
/**
|
|
15554
15914
|
Create a slice from a fragment by taking the maximum possible
|
|
@@ -15563,7 +15923,7 @@ var Slice = class {
|
|
|
15563
15923
|
return new Slice(fragment, openStart, openEnd);
|
|
15564
15924
|
}
|
|
15565
15925
|
};
|
|
15566
|
-
Slice.empty = new Slice(
|
|
15926
|
+
Slice.empty = new Slice(Fragment9.empty, 0, 0);
|
|
15567
15927
|
function removeRange(content, from2, to) {
|
|
15568
15928
|
let { index: index2, offset: offset4 } = content.findIndex(from2), child = content.maybeChild(index2);
|
|
15569
15929
|
let { index: indexTo, offset: offsetTo } = content.findIndex(to);
|
|
@@ -15661,7 +16021,7 @@ function replaceThreeWay($from, $start, $end, $to, depth) {
|
|
|
15661
16021
|
addNode(close(openEnd, replaceTwoWay($end, $to, depth + 1)), content);
|
|
15662
16022
|
}
|
|
15663
16023
|
addRange($to, null, depth, content);
|
|
15664
|
-
return new
|
|
16024
|
+
return new Fragment9(content);
|
|
15665
16025
|
}
|
|
15666
16026
|
function replaceTwoWay($from, $to, depth) {
|
|
15667
16027
|
let content = [];
|
|
@@ -15671,13 +16031,13 @@ function replaceTwoWay($from, $to, depth) {
|
|
|
15671
16031
|
addNode(close(type, replaceTwoWay($from, $to, depth + 1)), content);
|
|
15672
16032
|
}
|
|
15673
16033
|
addRange($to, null, depth, content);
|
|
15674
|
-
return new
|
|
16034
|
+
return new Fragment9(content);
|
|
15675
16035
|
}
|
|
15676
16036
|
function prepareSliceForReplace(slice2, $along) {
|
|
15677
16037
|
let extra = $along.depth - slice2.openStart, parent = $along.node(extra);
|
|
15678
16038
|
let node = parent.copy(slice2.content);
|
|
15679
16039
|
for (let i = extra - 1; i >= 0; i--)
|
|
15680
|
-
node = $along.node(i).copy(
|
|
16040
|
+
node = $along.node(i).copy(Fragment9.from(node));
|
|
15681
16041
|
return {
|
|
15682
16042
|
start: node.resolveNoCache(slice2.openStart + extra),
|
|
15683
16043
|
end: node.resolveNoCache(node.content.size - slice2.openEnd - extra)
|
|
@@ -16016,7 +16376,7 @@ var Node2 = class {
|
|
|
16016
16376
|
this.type = type;
|
|
16017
16377
|
this.attrs = attrs;
|
|
16018
16378
|
this.marks = marks;
|
|
16019
|
-
this.content = content ||
|
|
16379
|
+
this.content = content || Fragment9.empty;
|
|
16020
16380
|
}
|
|
16021
16381
|
/**
|
|
16022
16382
|
The array of this node's child nodes.
|
|
@@ -16321,7 +16681,7 @@ var Node2 = class {
|
|
|
16321
16681
|
can optionally pass `start` and `end` indices into the
|
|
16322
16682
|
replacement fragment.
|
|
16323
16683
|
*/
|
|
16324
|
-
canReplace(from2, to, replacement =
|
|
16684
|
+
canReplace(from2, to, replacement = Fragment9.empty, start = 0, end = replacement.childCount) {
|
|
16325
16685
|
let one = this.contentMatchAt(from2).matchFragment(replacement, start, end);
|
|
16326
16686
|
let two = one && one.matchFragment(this.content, to);
|
|
16327
16687
|
if (!two || !two.validEnd)
|
|
@@ -16403,7 +16763,7 @@ var Node2 = class {
|
|
|
16403
16763
|
throw new RangeError("Invalid text node in JSON");
|
|
16404
16764
|
return schema.text(json2.text, marks);
|
|
16405
16765
|
}
|
|
16406
|
-
let content =
|
|
16766
|
+
let content = Fragment9.fromJSON(schema, json2.content);
|
|
16407
16767
|
let node = schema.nodeType(json2.type).create(json2.attrs, content, marks);
|
|
16408
16768
|
node.type.checkAttrs(node.attrs);
|
|
16409
16769
|
return node;
|
|
@@ -16545,7 +16905,7 @@ var ContentMatch = class {
|
|
|
16545
16905
|
function search(match, types) {
|
|
16546
16906
|
let finished = match.matchFragment(after, startIndex);
|
|
16547
16907
|
if (finished && (!toEnd || finished.validEnd))
|
|
16548
|
-
return
|
|
16908
|
+
return Fragment9.from(types.map((tp) => tp.createAndFill()));
|
|
16549
16909
|
for (let i = 0; i < match.next.length; i++) {
|
|
16550
16910
|
let { type, next } = match.next[i];
|
|
16551
16911
|
if (!(type.isText || type.hasRequiredAttrs()) && seen.indexOf(next) == -1) {
|
|
@@ -16997,7 +17357,7 @@ var NodeType = class {
|
|
|
16997
17357
|
create(attrs = null, content, marks) {
|
|
16998
17358
|
if (this.isText)
|
|
16999
17359
|
throw new Error("NodeType.create can't construct text nodes");
|
|
17000
|
-
return new Node2(this, this.computeAttrs(attrs),
|
|
17360
|
+
return new Node2(this, this.computeAttrs(attrs), Fragment9.from(content), Mark.setFrom(marks));
|
|
17001
17361
|
}
|
|
17002
17362
|
/**
|
|
17003
17363
|
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
|
|
@@ -17005,7 +17365,7 @@ var NodeType = class {
|
|
|
17005
17365
|
if it doesn't match.
|
|
17006
17366
|
*/
|
|
17007
17367
|
createChecked(attrs = null, content, marks) {
|
|
17008
|
-
content =
|
|
17368
|
+
content = Fragment9.from(content);
|
|
17009
17369
|
this.checkContent(content);
|
|
17010
17370
|
return new Node2(this, this.computeAttrs(attrs), content, Mark.setFrom(marks));
|
|
17011
17371
|
}
|
|
@@ -17019,7 +17379,7 @@ var NodeType = class {
|
|
|
17019
17379
|
*/
|
|
17020
17380
|
createAndFill(attrs = null, content, marks) {
|
|
17021
17381
|
attrs = this.computeAttrs(attrs);
|
|
17022
|
-
content =
|
|
17382
|
+
content = Fragment9.from(content);
|
|
17023
17383
|
if (content.size) {
|
|
17024
17384
|
let before = this.contentMatch.fillBefore(content);
|
|
17025
17385
|
if (!before)
|
|
@@ -17027,7 +17387,7 @@ var NodeType = class {
|
|
|
17027
17387
|
content = before.append(content);
|
|
17028
17388
|
}
|
|
17029
17389
|
let matched = this.contentMatch.matchFragment(content);
|
|
17030
|
-
let after = matched && matched.fillBefore(
|
|
17390
|
+
let after = matched && matched.fillBefore(Fragment9.empty, true);
|
|
17031
17391
|
if (!after)
|
|
17032
17392
|
return null;
|
|
17033
17393
|
return new Node2(this, attrs, content.append(after), Mark.setFrom(marks));
|
|
@@ -17491,7 +17851,7 @@ var NodeContext = class {
|
|
|
17491
17851
|
if (!this.match) {
|
|
17492
17852
|
if (!this.type)
|
|
17493
17853
|
return [];
|
|
17494
|
-
let fill = this.type.contentMatch.fillBefore(
|
|
17854
|
+
let fill = this.type.contentMatch.fillBefore(Fragment9.from(node));
|
|
17495
17855
|
if (fill) {
|
|
17496
17856
|
this.match = this.type.contentMatch.matchFragment(fill);
|
|
17497
17857
|
} else {
|
|
@@ -17517,9 +17877,9 @@ var NodeContext = class {
|
|
|
17517
17877
|
this.content[this.content.length - 1] = text.withText(text.text.slice(0, text.text.length - m2[0].length));
|
|
17518
17878
|
}
|
|
17519
17879
|
}
|
|
17520
|
-
let content =
|
|
17880
|
+
let content = Fragment9.from(this.content);
|
|
17521
17881
|
if (!openEnd && this.match)
|
|
17522
|
-
content = content.append(this.match.fillBefore(
|
|
17882
|
+
content = content.append(this.match.fillBefore(Fragment9.empty, true));
|
|
17523
17883
|
return this.type ? this.type.create(this.attrs, content, this.marks) : content;
|
|
17524
17884
|
}
|
|
17525
17885
|
inlineContext(node) {
|
|
@@ -18536,7 +18896,7 @@ function mapFragment(fragment, f, parent) {
|
|
|
18536
18896
|
child = f(child, parent, i);
|
|
18537
18897
|
mapped.push(child);
|
|
18538
18898
|
}
|
|
18539
|
-
return
|
|
18899
|
+
return Fragment9.fromArray(mapped);
|
|
18540
18900
|
}
|
|
18541
18901
|
var AddMarkStep = class extends Step {
|
|
18542
18902
|
/**
|
|
@@ -18653,7 +19013,7 @@ var AddNodeMarkStep = class extends Step {
|
|
|
18653
19013
|
if (!node)
|
|
18654
19014
|
return StepResult.fail("No node at mark step's position");
|
|
18655
19015
|
let updated = node.type.create(node.attrs, null, this.mark.addToSet(node.marks));
|
|
18656
|
-
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(
|
|
19016
|
+
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment9.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
18657
19017
|
}
|
|
18658
19018
|
invert(doc3) {
|
|
18659
19019
|
let node = doc3.nodeAt(this.pos);
|
|
@@ -18699,7 +19059,7 @@ var RemoveNodeMarkStep = class extends Step {
|
|
|
18699
19059
|
if (!node)
|
|
18700
19060
|
return StepResult.fail("No node at mark step's position");
|
|
18701
19061
|
let updated = node.type.create(node.attrs, null, this.mark.removeFromSet(node.marks));
|
|
18702
|
-
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(
|
|
19062
|
+
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment9.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
18703
19063
|
}
|
|
18704
19064
|
invert(doc3) {
|
|
18705
19065
|
let node = doc3.nodeAt(this.pos);
|
|
@@ -18964,7 +19324,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
|
|
|
18964
19324
|
let m2, newline = /\r?\n|\r/g, slice2;
|
|
18965
19325
|
while (m2 = newline.exec(child.text)) {
|
|
18966
19326
|
if (!slice2)
|
|
18967
|
-
slice2 = new Slice(
|
|
19327
|
+
slice2 = new Slice(Fragment9.from(parentType.schema.text(" ", parentType.allowedMarks(child.marks))), 0, 0);
|
|
18968
19328
|
replSteps.push(new ReplaceStep(cur + m2.index, cur + m2.index + m2[0].length, slice2));
|
|
18969
19329
|
}
|
|
18970
19330
|
}
|
|
@@ -18972,7 +19332,7 @@ function clearIncompatible(tr2, pos, parentType, match = parentType.contentMatch
|
|
|
18972
19332
|
cur = end;
|
|
18973
19333
|
}
|
|
18974
19334
|
if (!match.validEnd) {
|
|
18975
|
-
let fill = match.fillBefore(
|
|
19335
|
+
let fill = match.fillBefore(Fragment9.empty, true);
|
|
18976
19336
|
tr2.replace(cur, cur, new Slice(fill, 0, 0));
|
|
18977
19337
|
}
|
|
18978
19338
|
for (let i = replSteps.length - 1; i >= 0; i--)
|
|
@@ -18998,20 +19358,20 @@ function lift(tr2, range, target) {
|
|
|
18998
19358
|
let { $from, $to, depth } = range;
|
|
18999
19359
|
let gapStart = $from.before(depth + 1), gapEnd = $to.after(depth + 1);
|
|
19000
19360
|
let start = gapStart, end = gapEnd;
|
|
19001
|
-
let before =
|
|
19361
|
+
let before = Fragment9.empty, openStart = 0;
|
|
19002
19362
|
for (let d = depth, splitting = false; d > target; d--)
|
|
19003
19363
|
if (splitting || $from.index(d) > 0) {
|
|
19004
19364
|
splitting = true;
|
|
19005
|
-
before =
|
|
19365
|
+
before = Fragment9.from($from.node(d).copy(before));
|
|
19006
19366
|
openStart++;
|
|
19007
19367
|
} else {
|
|
19008
19368
|
start--;
|
|
19009
19369
|
}
|
|
19010
|
-
let after =
|
|
19370
|
+
let after = Fragment9.empty, openEnd = 0;
|
|
19011
19371
|
for (let d = depth, splitting = false; d > target; d--)
|
|
19012
19372
|
if (splitting || $to.after(d + 1) < $to.end(d)) {
|
|
19013
19373
|
splitting = true;
|
|
19014
|
-
after =
|
|
19374
|
+
after = Fragment9.from($to.node(d).copy(after));
|
|
19015
19375
|
openEnd++;
|
|
19016
19376
|
} else {
|
|
19017
19377
|
end++;
|
|
@@ -19051,14 +19411,14 @@ function findWrappingInside(range, type) {
|
|
|
19051
19411
|
return inside;
|
|
19052
19412
|
}
|
|
19053
19413
|
function wrap(tr2, range, wrappers) {
|
|
19054
|
-
let content =
|
|
19414
|
+
let content = Fragment9.empty;
|
|
19055
19415
|
for (let i = wrappers.length - 1; i >= 0; i--) {
|
|
19056
19416
|
if (content.size) {
|
|
19057
19417
|
let match = wrappers[i].type.contentMatch.matchFragment(content);
|
|
19058
19418
|
if (!match || !match.validEnd)
|
|
19059
19419
|
throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
|
|
19060
19420
|
}
|
|
19061
|
-
content =
|
|
19421
|
+
content = Fragment9.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
19062
19422
|
}
|
|
19063
19423
|
let start = range.start, end = range.end;
|
|
19064
19424
|
tr2.step(new ReplaceAroundStep(start, end, start, end, new Slice(content, 0, 0), wrappers.length, true));
|
|
@@ -19083,7 +19443,7 @@ function setBlockType(tr2, from2, to, type, attrs) {
|
|
|
19083
19443
|
clearIncompatible(tr2, tr2.mapping.slice(mapFrom).map(pos, 1), type, void 0, convertNewlines === null);
|
|
19084
19444
|
let mapping = tr2.mapping.slice(mapFrom);
|
|
19085
19445
|
let startM = mapping.map(pos, 1), endM = mapping.map(pos + node.nodeSize, 1);
|
|
19086
|
-
tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(
|
|
19446
|
+
tr2.step(new ReplaceAroundStep(startM, endM, startM + 1, endM - 1, new Slice(Fragment9.from(type.create(attrsHere, null, node.marks)), 0, 0), 1, true));
|
|
19087
19447
|
if (convertNewlines === true)
|
|
19088
19448
|
replaceNewlines(tr2, node, pos, mapFrom);
|
|
19089
19449
|
return false;
|
|
@@ -19124,7 +19484,7 @@ function setNodeMarkup(tr2, pos, type, attrs, marks) {
|
|
|
19124
19484
|
return tr2.replaceWith(pos, pos + node.nodeSize, newNode);
|
|
19125
19485
|
if (!type.validContent(node.content))
|
|
19126
19486
|
throw new RangeError("Invalid content for node type " + type.name);
|
|
19127
|
-
tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(
|
|
19487
|
+
tr2.step(new ReplaceAroundStep(pos, pos + node.nodeSize, pos + 1, pos + node.nodeSize - 1, new Slice(Fragment9.from(newNode), 0, 0), 1, true));
|
|
19128
19488
|
}
|
|
19129
19489
|
function canSplit(doc3, pos, depth = 1, typesAfter) {
|
|
19130
19490
|
let $pos = doc3.resolve(pos), base2 = $pos.depth - depth;
|
|
@@ -19148,11 +19508,11 @@ function canSplit(doc3, pos, depth = 1, typesAfter) {
|
|
|
19148
19508
|
return $pos.node(base2).canReplaceWith(index2, index2, baseType ? baseType.type : $pos.node(base2 + 1).type);
|
|
19149
19509
|
}
|
|
19150
19510
|
function split(tr2, pos, depth = 1, typesAfter) {
|
|
19151
|
-
let $pos = tr2.doc.resolve(pos), before =
|
|
19511
|
+
let $pos = tr2.doc.resolve(pos), before = Fragment9.empty, after = Fragment9.empty;
|
|
19152
19512
|
for (let d = $pos.depth, e = $pos.depth - depth, i = depth - 1; d > e; d--, i--) {
|
|
19153
|
-
before =
|
|
19513
|
+
before = Fragment9.from($pos.node(d).copy(before));
|
|
19154
19514
|
let typeAfter = typesAfter && typesAfter[i];
|
|
19155
|
-
after =
|
|
19515
|
+
after = Fragment9.from(typeAfter ? typeAfter.type.create(typeAfter.attrs, after) : $pos.node(d).copy(after));
|
|
19156
19516
|
}
|
|
19157
19517
|
tr2.step(new ReplaceStep(pos, pos, new Slice(before.append(after), depth, depth), true));
|
|
19158
19518
|
}
|
|
@@ -19291,7 +19651,7 @@ var Fitter = class {
|
|
|
19291
19651
|
this.$to = $to;
|
|
19292
19652
|
this.unplaced = unplaced;
|
|
19293
19653
|
this.frontier = [];
|
|
19294
|
-
this.placed =
|
|
19654
|
+
this.placed = Fragment9.empty;
|
|
19295
19655
|
for (let i = 0; i <= $from.depth; i++) {
|
|
19296
19656
|
let node = $from.node(i);
|
|
19297
19657
|
this.frontier.push({
|
|
@@ -19300,7 +19660,7 @@ var Fitter = class {
|
|
|
19300
19660
|
});
|
|
19301
19661
|
}
|
|
19302
19662
|
for (let i = $from.depth; i > 0; i--)
|
|
19303
|
-
this.placed =
|
|
19663
|
+
this.placed = Fragment9.from($from.node(i).copy(this.placed));
|
|
19304
19664
|
}
|
|
19305
19665
|
get depth() {
|
|
19306
19666
|
return this.frontier.length - 1;
|
|
@@ -19357,7 +19717,7 @@ var Fitter = class {
|
|
|
19357
19717
|
let first2 = fragment.firstChild;
|
|
19358
19718
|
for (let frontierDepth = this.depth; frontierDepth >= 0; frontierDepth--) {
|
|
19359
19719
|
let { type, match } = this.frontier[frontierDepth], wrap2, inject = null;
|
|
19360
|
-
if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(
|
|
19720
|
+
if (pass == 1 && (first2 ? match.matchType(first2.type) || (inject = match.fillBefore(Fragment9.from(first2), false)) : parent && type.compatibleContent(parent.type)))
|
|
19361
19721
|
return { sliceDepth, frontierDepth, parent, inject };
|
|
19362
19722
|
else if (pass == 2 && first2 && (wrap2 = match.findWrapping(first2.type)))
|
|
19363
19723
|
return { sliceDepth, frontierDepth, parent, wrap: wrap2 };
|
|
@@ -19417,7 +19777,7 @@ var Fitter = class {
|
|
|
19417
19777
|
let toEnd = taken == fragment.childCount;
|
|
19418
19778
|
if (!toEnd)
|
|
19419
19779
|
openEndCount = -1;
|
|
19420
|
-
this.placed = addToFragment(this.placed, frontierDepth,
|
|
19780
|
+
this.placed = addToFragment(this.placed, frontierDepth, Fragment9.from(add));
|
|
19421
19781
|
this.frontier[frontierDepth].match = match;
|
|
19422
19782
|
if (toEnd && openEndCount < 0 && parent && parent.type == this.frontier[this.depth].type && this.frontier.length > 1)
|
|
19423
19783
|
this.closeFrontierNode();
|
|
@@ -19474,12 +19834,12 @@ var Fitter = class {
|
|
|
19474
19834
|
openFrontierNode(type, attrs = null, content) {
|
|
19475
19835
|
let top = this.frontier[this.depth];
|
|
19476
19836
|
top.match = top.match.matchType(type);
|
|
19477
|
-
this.placed = addToFragment(this.placed, this.depth,
|
|
19837
|
+
this.placed = addToFragment(this.placed, this.depth, Fragment9.from(type.create(attrs, content)));
|
|
19478
19838
|
this.frontier.push({ type, match: type.contentMatch });
|
|
19479
19839
|
}
|
|
19480
19840
|
closeFrontierNode() {
|
|
19481
19841
|
let open = this.frontier.pop();
|
|
19482
|
-
let add = open.match.fillBefore(
|
|
19842
|
+
let add = open.match.fillBefore(Fragment9.empty, true);
|
|
19483
19843
|
if (add.childCount)
|
|
19484
19844
|
this.placed = addToFragment(this.placed, this.frontier.length, add);
|
|
19485
19845
|
}
|
|
@@ -19508,7 +19868,7 @@ function closeNodeStart(node, openStart, openEnd) {
|
|
|
19508
19868
|
if (openStart > 0) {
|
|
19509
19869
|
frag = node.type.contentMatch.fillBefore(frag).append(frag);
|
|
19510
19870
|
if (openEnd <= 0)
|
|
19511
|
-
frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(
|
|
19871
|
+
frag = frag.append(node.type.contentMatch.matchFragment(frag).fillBefore(Fragment9.empty, true));
|
|
19512
19872
|
}
|
|
19513
19873
|
return node.copy(frag);
|
|
19514
19874
|
}
|
|
@@ -19600,7 +19960,7 @@ function closeFragment(fragment, depth, oldOpen, newOpen, parent) {
|
|
|
19600
19960
|
if (depth > newOpen) {
|
|
19601
19961
|
let match = parent.contentMatchAt(0);
|
|
19602
19962
|
let start = match.fillBefore(fragment).append(fragment);
|
|
19603
|
-
fragment = start.append(match.matchFragment(start).fillBefore(
|
|
19963
|
+
fragment = start.append(match.matchFragment(start).fillBefore(Fragment9.empty, true));
|
|
19604
19964
|
}
|
|
19605
19965
|
return fragment;
|
|
19606
19966
|
}
|
|
@@ -19610,7 +19970,7 @@ function replaceRangeWith(tr2, from2, to, node) {
|
|
|
19610
19970
|
if (point != null)
|
|
19611
19971
|
from2 = to = point;
|
|
19612
19972
|
}
|
|
19613
|
-
tr2.replaceRange(from2, to, new Slice(
|
|
19973
|
+
tr2.replaceRange(from2, to, new Slice(Fragment9.from(node), 0, 0));
|
|
19614
19974
|
}
|
|
19615
19975
|
function deleteRange(tr2, from2, to) {
|
|
19616
19976
|
let $from = tr2.doc.resolve(from2), $to = tr2.doc.resolve(to);
|
|
@@ -19658,7 +20018,7 @@ var AttrStep = class extends Step {
|
|
|
19658
20018
|
attrs[name] = node.attrs[name];
|
|
19659
20019
|
attrs[this.attr] = this.value;
|
|
19660
20020
|
let updated = node.type.create(attrs, null, node.marks);
|
|
19661
|
-
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(
|
|
20021
|
+
return StepResult.fromReplace(doc3, this.pos, this.pos + 1, new Slice(Fragment9.from(updated), 0, node.isLeaf ? 0 : 1));
|
|
19662
20022
|
}
|
|
19663
20023
|
getMap() {
|
|
19664
20024
|
return StepMap.empty;
|
|
@@ -19793,7 +20153,7 @@ var Transform = class {
|
|
|
19793
20153
|
fragment, node, or array of nodes.
|
|
19794
20154
|
*/
|
|
19795
20155
|
replaceWith(from2, to, content) {
|
|
19796
|
-
return this.replace(from2, to, new Slice(
|
|
20156
|
+
return this.replace(from2, to, new Slice(Fragment9.from(content), 0, 0));
|
|
19797
20157
|
}
|
|
19798
20158
|
/**
|
|
19799
20159
|
Delete the content between the given positions.
|
|
@@ -20295,7 +20655,7 @@ var NodeSelection = class extends Selection {
|
|
|
20295
20655
|
return new NodeSelection($pos);
|
|
20296
20656
|
}
|
|
20297
20657
|
content() {
|
|
20298
|
-
return new Slice(
|
|
20658
|
+
return new Slice(Fragment9.from(this.node), 0, 0);
|
|
20299
20659
|
}
|
|
20300
20660
|
eq(other) {
|
|
20301
20661
|
return other instanceof NodeSelection && other.anchor == this.anchor;
|
|
@@ -22117,7 +22477,7 @@ var NodeViewDesc = class extends ViewDesc {
|
|
|
22117
22477
|
}
|
|
22118
22478
|
}
|
|
22119
22479
|
if (!rule.contentElement)
|
|
22120
|
-
rule.getContent = () =>
|
|
22480
|
+
rule.getContent = () => Fragment9.empty;
|
|
22121
22481
|
}
|
|
22122
22482
|
return rule;
|
|
22123
22483
|
}
|
|
@@ -23436,7 +23796,7 @@ function parseFromClipboard(view, text, html, plainText, $context) {
|
|
|
23436
23796
|
text = f(text, inCode || plainText, view);
|
|
23437
23797
|
});
|
|
23438
23798
|
if (inCode)
|
|
23439
|
-
return text ? new Slice(
|
|
23799
|
+
return text ? new Slice(Fragment9.from(view.state.schema.text(text.replace(/\r\n?/g, "\n"))), 0, 0) : Slice.empty;
|
|
23440
23800
|
let parsed = view.someProp("clipboardTextParser", (f) => f(text, $context, plainText, view));
|
|
23441
23801
|
if (parsed) {
|
|
23442
23802
|
slice2 = parsed;
|
|
@@ -23525,13 +23885,13 @@ function normalizeSiblings(fragment, $context) {
|
|
|
23525
23885
|
}
|
|
23526
23886
|
});
|
|
23527
23887
|
if (result)
|
|
23528
|
-
return
|
|
23888
|
+
return Fragment9.from(result);
|
|
23529
23889
|
}
|
|
23530
23890
|
return fragment;
|
|
23531
23891
|
}
|
|
23532
23892
|
function withWrappers(node, wrap2, from2 = 0) {
|
|
23533
23893
|
for (let i = wrap2.length - 1; i >= from2; i--)
|
|
23534
|
-
node = wrap2[i].create(null,
|
|
23894
|
+
node = wrap2[i].create(null, Fragment9.from(node));
|
|
23535
23895
|
return node;
|
|
23536
23896
|
}
|
|
23537
23897
|
function addToSibling(wrap2, lastWrap, node, sibling, depth) {
|
|
@@ -23541,14 +23901,14 @@ function addToSibling(wrap2, lastWrap, node, sibling, depth) {
|
|
|
23541
23901
|
return sibling.copy(sibling.content.replaceChild(sibling.childCount - 1, inner));
|
|
23542
23902
|
let match = sibling.contentMatchAt(sibling.childCount);
|
|
23543
23903
|
if (match.matchType(depth == wrap2.length - 1 ? node.type : wrap2[depth + 1]))
|
|
23544
|
-
return sibling.copy(sibling.content.append(
|
|
23904
|
+
return sibling.copy(sibling.content.append(Fragment9.from(withWrappers(node, wrap2, depth + 1))));
|
|
23545
23905
|
}
|
|
23546
23906
|
}
|
|
23547
23907
|
function closeRight(node, depth) {
|
|
23548
23908
|
if (depth == 0)
|
|
23549
23909
|
return node;
|
|
23550
23910
|
let fragment = node.content.replaceChild(node.childCount - 1, closeRight(node.lastChild, depth - 1));
|
|
23551
|
-
let fill = node.contentMatchAt(node.childCount).fillBefore(
|
|
23911
|
+
let fill = node.contentMatchAt(node.childCount).fillBefore(Fragment9.empty, true);
|
|
23552
23912
|
return node.copy(fragment.append(fill));
|
|
23553
23913
|
}
|
|
23554
23914
|
function closeRange(fragment, side, from2, to, depth, openEnd) {
|
|
@@ -23558,7 +23918,7 @@ function closeRange(fragment, side, from2, to, depth, openEnd) {
|
|
|
23558
23918
|
if (depth < to - 1)
|
|
23559
23919
|
inner = closeRange(inner, side, from2, to, depth + 1, openEnd);
|
|
23560
23920
|
if (depth >= from2)
|
|
23561
|
-
inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(
|
|
23921
|
+
inner = side < 0 ? node.contentMatchAt(0).fillBefore(inner, openEnd <= depth).append(inner) : inner.append(node.contentMatchAt(node.childCount).fillBefore(Fragment9.empty, true));
|
|
23562
23922
|
return fragment.replaceChild(side < 0 ? 0 : fragment.childCount - 1, node.copy(inner));
|
|
23563
23923
|
}
|
|
23564
23924
|
function closeSlice(slice2, openStart, openEnd) {
|
|
@@ -23628,7 +23988,7 @@ function addContext(slice2, context) {
|
|
|
23628
23988
|
let type = schema.nodes[array[i]];
|
|
23629
23989
|
if (!type || type.hasRequiredAttrs())
|
|
23630
23990
|
break;
|
|
23631
|
-
content =
|
|
23991
|
+
content = Fragment9.from(type.create(array[i + 1], content));
|
|
23632
23992
|
openStart++;
|
|
23633
23993
|
openEnd++;
|
|
23634
23994
|
}
|
|
@@ -25489,7 +25849,7 @@ function isMarkChange(cur, prev) {
|
|
|
25489
25849
|
let updated = [];
|
|
25490
25850
|
for (let i = 0; i < prev.childCount; i++)
|
|
25491
25851
|
updated.push(update(prev.child(i)));
|
|
25492
|
-
if (
|
|
25852
|
+
if (Fragment9.from(updated).eq(cur))
|
|
25493
25853
|
return { mark, type };
|
|
25494
25854
|
}
|
|
25495
25855
|
function looksLikeBackspace(old, start, end, $newStart, $newEnd) {
|
|
@@ -26599,10 +26959,10 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
|
|
|
26599
26959
|
let canDelAfter = !isolated && $cut.parent.canReplace($cut.index(), $cut.index() + 1);
|
|
26600
26960
|
if (canDelAfter && (conn = (match = before.contentMatchAt(before.childCount)).findWrapping(after.type)) && match.matchType(conn[0] || after.type).validEnd) {
|
|
26601
26961
|
if (dispatch2) {
|
|
26602
|
-
let end = $cut.pos + after.nodeSize, wrap2 =
|
|
26962
|
+
let end = $cut.pos + after.nodeSize, wrap2 = Fragment9.empty;
|
|
26603
26963
|
for (let i = conn.length - 1; i >= 0; i--)
|
|
26604
|
-
wrap2 =
|
|
26605
|
-
wrap2 =
|
|
26964
|
+
wrap2 = Fragment9.from(conn[i].create(null, wrap2));
|
|
26965
|
+
wrap2 = Fragment9.from(before.copy(wrap2));
|
|
26606
26966
|
let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - 1, end, $cut.pos, end, new Slice(wrap2, 1, 0), conn.length, true));
|
|
26607
26967
|
let $joinAt = tr2.doc.resolve(end + 2 * conn.length);
|
|
26608
26968
|
if ($joinAt.nodeAfter && $joinAt.nodeAfter.type == before.type && canJoin(tr2.doc, $joinAt.pos))
|
|
@@ -26631,9 +26991,9 @@ function deleteBarrier(state, $cut, dispatch2, dir) {
|
|
|
26631
26991
|
afterDepth++;
|
|
26632
26992
|
if (at.canReplace(at.childCount, at.childCount, afterText.content)) {
|
|
26633
26993
|
if (dispatch2) {
|
|
26634
|
-
let end =
|
|
26994
|
+
let end = Fragment9.empty;
|
|
26635
26995
|
for (let i = wrap2.length - 1; i >= 0; i--)
|
|
26636
|
-
end =
|
|
26996
|
+
end = Fragment9.from(wrap2[i].copy(end));
|
|
26637
26997
|
let tr2 = state.tr.step(new ReplaceAroundStep($cut.pos - wrap2.length, $cut.pos + after.nodeSize, $cut.pos + afterDepth, $cut.pos + after.nodeSize - afterDepth, new Slice(end, wrap2.length, 0), 0, true));
|
|
26638
26998
|
dispatch2(tr2.scrollIntoView());
|
|
26639
26999
|
}
|
|
@@ -26738,9 +27098,9 @@ function wrapRangeInList(tr2, range, listType, attrs = null) {
|
|
|
26738
27098
|
return true;
|
|
26739
27099
|
}
|
|
26740
27100
|
function doWrapInList(tr2, range, wrappers, joinBefore, listType) {
|
|
26741
|
-
let content =
|
|
27101
|
+
let content = Fragment9.empty;
|
|
26742
27102
|
for (let i = wrappers.length - 1; i >= 0; i--)
|
|
26743
|
-
content =
|
|
27103
|
+
content = Fragment9.from(wrappers[i].type.create(wrappers[i].attrs, content));
|
|
26744
27104
|
tr2.step(new ReplaceAroundStep(range.start - (joinBefore ? 2 : 0), range.end, range.start, range.end, new Slice(content, 0, 0), wrappers.length, true));
|
|
26745
27105
|
let found2 = 0;
|
|
26746
27106
|
for (let i = 0; i < wrappers.length; i++)
|
|
@@ -26774,7 +27134,7 @@ function liftListItem(itemType) {
|
|
|
26774
27134
|
function liftToOuterList(state, dispatch2, itemType, range) {
|
|
26775
27135
|
let tr2 = state.tr, end = range.end, endOfList = range.$to.end(range.depth);
|
|
26776
27136
|
if (end < endOfList) {
|
|
26777
|
-
tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(
|
|
27137
|
+
tr2.step(new ReplaceAroundStep(end - 1, endOfList, end, endOfList, new Slice(Fragment9.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true));
|
|
26778
27138
|
range = new NodeRange(tr2.doc.resolve(range.$from.pos), tr2.doc.resolve(endOfList), range.depth);
|
|
26779
27139
|
}
|
|
26780
27140
|
const target = liftTarget(range);
|
|
@@ -26798,10 +27158,10 @@ function liftOutOfList(state, dispatch2, range) {
|
|
|
26798
27158
|
return false;
|
|
26799
27159
|
let atStart = range.startIndex == 0, atEnd = range.endIndex == list.childCount;
|
|
26800
27160
|
let parent = $start.node(-1), indexBefore = $start.index(-1);
|
|
26801
|
-
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ?
|
|
27161
|
+
if (!parent.canReplace(indexBefore + (atStart ? 0 : 1), indexBefore + 1, item.content.append(atEnd ? Fragment9.empty : Fragment9.from(list))))
|
|
26802
27162
|
return false;
|
|
26803
27163
|
let start = $start.pos, end = start + item.nodeSize;
|
|
26804
|
-
tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ?
|
|
27164
|
+
tr2.step(new ReplaceAroundStep(start - (atStart ? 1 : 0), end + (atEnd ? 1 : 0), start + 1, end - 1, new Slice((atStart ? Fragment9.empty : Fragment9.from(list.copy(Fragment9.empty))).append(atEnd ? Fragment9.empty : Fragment9.from(list.copy(Fragment9.empty))), atStart ? 0 : 1, atEnd ? 0 : 1), atStart ? 0 : 1));
|
|
26805
27165
|
dispatch2(tr2.scrollIntoView());
|
|
26806
27166
|
return true;
|
|
26807
27167
|
}
|
|
@@ -26819,8 +27179,8 @@ function sinkListItem(itemType) {
|
|
|
26819
27179
|
return false;
|
|
26820
27180
|
if (dispatch2) {
|
|
26821
27181
|
let nestedBefore = nodeBefore.lastChild && nodeBefore.lastChild.type == parent.type;
|
|
26822
|
-
let inner =
|
|
26823
|
-
let slice2 = new Slice(
|
|
27182
|
+
let inner = Fragment9.from(nestedBefore ? itemType.create() : null);
|
|
27183
|
+
let slice2 = new Slice(Fragment9.from(itemType.create(null, Fragment9.from(parent.type.create(null, inner)))), nestedBefore ? 3 : 1, 0);
|
|
26824
27184
|
let before = range.start, after = range.end;
|
|
26825
27185
|
dispatch2(state.tr.step(new ReplaceAroundStep(before - (nestedBefore ? 3 : 1), after, before, after, slice2, 1, true)).scrollIntoView());
|
|
26826
27186
|
}
|
|
@@ -27038,7 +27398,7 @@ function elementFromString(value) {
|
|
|
27038
27398
|
return removeWhitespaces(html);
|
|
27039
27399
|
}
|
|
27040
27400
|
function createNodeFromContent(content, schema, options) {
|
|
27041
|
-
if (content instanceof Node2 || content instanceof
|
|
27401
|
+
if (content instanceof Node2 || content instanceof Fragment9) {
|
|
27042
27402
|
return content;
|
|
27043
27403
|
}
|
|
27044
27404
|
options = {
|
|
@@ -27052,7 +27412,7 @@ function createNodeFromContent(content, schema, options) {
|
|
|
27052
27412
|
try {
|
|
27053
27413
|
const isArrayContent = Array.isArray(content) && content.length > 0;
|
|
27054
27414
|
if (isArrayContent) {
|
|
27055
|
-
return
|
|
27415
|
+
return Fragment9.fromArray(content.map((item) => schema.nodeFromJSON(item)));
|
|
27056
27416
|
}
|
|
27057
27417
|
const node = schema.nodeFromJSON(content);
|
|
27058
27418
|
if (options.errorOnInvalidContent) {
|
|
@@ -28186,7 +28546,7 @@ function inputRulesPlugin(props) {
|
|
|
28186
28546
|
if (typeof text === "string") {
|
|
28187
28547
|
text = text;
|
|
28188
28548
|
} else {
|
|
28189
|
-
text = getHTMLFromFragment(
|
|
28549
|
+
text = getHTMLFromFragment(Fragment9.from(text), state.schema);
|
|
28190
28550
|
}
|
|
28191
28551
|
const { from: from2 } = simulatedInputMeta;
|
|
28192
28552
|
const to = from2 + text.length;
|
|
@@ -28564,7 +28924,7 @@ function pasteRulesPlugin(props) {
|
|
|
28564
28924
|
if (typeof text === "string") {
|
|
28565
28925
|
text = text;
|
|
28566
28926
|
} else {
|
|
28567
|
-
text = getHTMLFromFragment(
|
|
28927
|
+
text = getHTMLFromFragment(Fragment9.from(text), state.schema);
|
|
28568
28928
|
}
|
|
28569
28929
|
const { from: from22 } = simulatedPasteMeta;
|
|
28570
28930
|
const to2 = from22 + text.length;
|
|
@@ -29222,7 +29582,7 @@ var insertContentAt = (position, value, options) => ({ tr: tr2, dispatch: dispat
|
|
|
29222
29582
|
if (isOnlyTextContent) {
|
|
29223
29583
|
if (Array.isArray(value)) {
|
|
29224
29584
|
newContent = value.map((v) => v.text || "").join("");
|
|
29225
|
-
} else if (value instanceof
|
|
29585
|
+
} else if (value instanceof Fragment9) {
|
|
29226
29586
|
let text = "";
|
|
29227
29587
|
value.forEach((node) => {
|
|
29228
29588
|
if (node.text) {
|
|
@@ -29689,10 +30049,10 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
|
|
|
29689
30049
|
return false;
|
|
29690
30050
|
}
|
|
29691
30051
|
if (dispatch2) {
|
|
29692
|
-
let wrap2 =
|
|
30052
|
+
let wrap2 = Fragment9.empty;
|
|
29693
30053
|
const depthBefore = $from.index(-1) ? 1 : $from.index(-2) ? 2 : 3;
|
|
29694
30054
|
for (let d = $from.depth - depthBefore; d >= $from.depth - 3; d -= 1) {
|
|
29695
|
-
wrap2 =
|
|
30055
|
+
wrap2 = Fragment9.from($from.node(d).copy(wrap2));
|
|
29696
30056
|
}
|
|
29697
30057
|
const depthAfter = (
|
|
29698
30058
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -29703,7 +30063,7 @@ var splitListItem = (typeOrName, overrideAttrs = {}) => ({ tr: tr2, state, dispa
|
|
|
29703
30063
|
...overrideAttrs
|
|
29704
30064
|
};
|
|
29705
30065
|
const nextType2 = ((_a = type.contentMatch.defaultType) == null ? void 0 : _a.createAndFill(newNextTypeAttributes2)) || void 0;
|
|
29706
|
-
wrap2 = wrap2.append(
|
|
30066
|
+
wrap2 = wrap2.append(Fragment9.from(type.createAndFill(null, nextType2) || void 0));
|
|
29707
30067
|
const start = $from.before($from.depth - (depthBefore - 1));
|
|
29708
30068
|
tr2.replace(start, $from.after(-depthAfter), new Slice(wrap2, 4 - depthBefore, 0));
|
|
29709
30069
|
let sel = -1;
|
|
@@ -31334,7 +31694,7 @@ function markPasteRule(config) {
|
|
|
31334
31694
|
}
|
|
31335
31695
|
|
|
31336
31696
|
// ../../node_modules/@tiptap/react/dist/index.js
|
|
31337
|
-
var
|
|
31697
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
31338
31698
|
var mergeRefs = (...refs) => {
|
|
31339
31699
|
return (node) => {
|
|
31340
31700
|
refs.forEach((ref) => {
|
|
@@ -31553,7 +31913,7 @@ function useEditorState(options) {
|
|
|
31553
31913
|
editorStateManager.getSnapshot,
|
|
31554
31914
|
editorStateManager.getServerSnapshot,
|
|
31555
31915
|
options.selector,
|
|
31556
|
-
(_a = options.equalityFn) != null ? _a :
|
|
31916
|
+
(_a = options.equalityFn) != null ? _a : import_react19.default
|
|
31557
31917
|
);
|
|
31558
31918
|
useIsomorphicLayoutEffect(() => {
|
|
31559
31919
|
return editorStateManager.watch(options.editor);
|
|
@@ -35149,9 +35509,9 @@ function beforeinput(view, event) {
|
|
|
35149
35509
|
let insert = $from.parent.contentMatchAt($from.index()).findWrapping(view.state.schema.nodes.text);
|
|
35150
35510
|
if (!insert)
|
|
35151
35511
|
return false;
|
|
35152
|
-
let frag =
|
|
35512
|
+
let frag = Fragment9.empty;
|
|
35153
35513
|
for (let i = insert.length - 1; i >= 0; i--)
|
|
35154
|
-
frag =
|
|
35514
|
+
frag = Fragment9.from(insert[i].createAndFill(null, frag));
|
|
35155
35515
|
let tr2 = view.state.tr.replace($from.pos, $from.pos, new Slice(frag, 0, 0));
|
|
35156
35516
|
tr2.setSelection(TextSelection.near(tr2.doc.resolve($from.pos + 1)));
|
|
35157
35517
|
view.dispatch(tr2);
|
|
@@ -36831,10 +37191,10 @@ var CellSelection = class _CellSelection extends Selection {
|
|
|
36831
37191
|
}
|
|
36832
37192
|
rowContent.push(cell);
|
|
36833
37193
|
}
|
|
36834
|
-
rows.push(table.child(row).copy(
|
|
37194
|
+
rows.push(table.child(row).copy(Fragment9.from(rowContent)));
|
|
36835
37195
|
}
|
|
36836
37196
|
const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
|
|
36837
|
-
return new Slice(
|
|
37197
|
+
return new Slice(Fragment9.from(fragment), 1, 1);
|
|
36838
37198
|
}
|
|
36839
37199
|
replace(tr2, content = Slice.empty) {
|
|
36840
37200
|
const mapFrom = tr2.steps.length, ranges = this.ranges;
|
|
@@ -36854,7 +37214,7 @@ var CellSelection = class _CellSelection extends Selection {
|
|
|
36854
37214
|
tr2.setSelection(sel);
|
|
36855
37215
|
}
|
|
36856
37216
|
replaceWith(tr2, node) {
|
|
36857
|
-
this.replace(tr2, new Slice(
|
|
37217
|
+
this.replace(tr2, new Slice(Fragment9.from(node), 0, 0));
|
|
36858
37218
|
}
|
|
36859
37219
|
forEachCell(f) {
|
|
36860
37220
|
const table = this.$anchorCell.node(-1);
|
|
@@ -37402,7 +37762,7 @@ function mergeCells(state, dispatch2) {
|
|
|
37402
37762
|
if (dispatch2) {
|
|
37403
37763
|
const tr2 = state.tr;
|
|
37404
37764
|
const seen = {};
|
|
37405
|
-
let content =
|
|
37765
|
+
let content = Fragment9.empty;
|
|
37406
37766
|
let mergedPos;
|
|
37407
37767
|
let mergedCell;
|
|
37408
37768
|
for (let row = rect.top; row < rect.bottom; row++) {
|
|
@@ -37783,14 +38143,14 @@ function ensureRectangular(schema, rows) {
|
|
|
37783
38143
|
width = Math.max(width, widths[r2]);
|
|
37784
38144
|
for (let r2 = 0; r2 < widths.length; r2++) {
|
|
37785
38145
|
if (r2 >= rows.length)
|
|
37786
|
-
rows.push(
|
|
38146
|
+
rows.push(Fragment9.empty);
|
|
37787
38147
|
if (widths[r2] < width) {
|
|
37788
38148
|
const empty2 = tableNodeTypes(schema).cell.createAndFill();
|
|
37789
38149
|
const cells = [];
|
|
37790
38150
|
for (let i = widths[r2]; i < width; i++) {
|
|
37791
38151
|
cells.push(empty2);
|
|
37792
38152
|
}
|
|
37793
|
-
rows[r2] = rows[r2].append(
|
|
38153
|
+
rows[r2] = rows[r2].append(Fragment9.from(cells));
|
|
37794
38154
|
}
|
|
37795
38155
|
}
|
|
37796
38156
|
return { height: rows.length, width, rows };
|
|
@@ -37822,7 +38182,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
|
|
|
37822
38182
|
for (let j = 1; j < cell.attrs.rowspan; j++)
|
|
37823
38183
|
added[row + j] = (added[row + j] || 0) + cell.attrs.colspan;
|
|
37824
38184
|
}
|
|
37825
|
-
newRows.push(
|
|
38185
|
+
newRows.push(Fragment9.from(cells));
|
|
37826
38186
|
}
|
|
37827
38187
|
rows = newRows;
|
|
37828
38188
|
width = newWidth;
|
|
@@ -37843,7 +38203,7 @@ function clipCells({ width, height, rows }, newWidth, newHeight) {
|
|
|
37843
38203
|
);
|
|
37844
38204
|
cells.push(cell);
|
|
37845
38205
|
}
|
|
37846
|
-
newRows.push(
|
|
38206
|
+
newRows.push(Fragment9.from(cells));
|
|
37847
38207
|
}
|
|
37848
38208
|
rows = newRows;
|
|
37849
38209
|
height = newHeight;
|
|
@@ -37878,7 +38238,7 @@ function growTable(tr2, map2, table, start, width, height, mapFrom) {
|
|
|
37878
38238
|
header ? emptyHead || (emptyHead = types.header_cell.createAndFill()) : empty2 || (empty2 = types.cell.createAndFill())
|
|
37879
38239
|
);
|
|
37880
38240
|
}
|
|
37881
|
-
const emptyRow = types.row.create(null,
|
|
38241
|
+
const emptyRow = types.row.create(null, Fragment9.from(cells)), rows = [];
|
|
37882
38242
|
for (let i = map2.height; i < height; i++)
|
|
37883
38243
|
rows.push(emptyRow);
|
|
37884
38244
|
tr2.insert(tr2.mapping.slice(mapFrom).map(start + table.nodeSize - 2), rows);
|
|
@@ -38087,7 +38447,7 @@ function handlePaste(view, _, slice2) {
|
|
|
38087
38447
|
width: 1,
|
|
38088
38448
|
height: 1,
|
|
38089
38449
|
rows: [
|
|
38090
|
-
|
|
38450
|
+
Fragment9.from(
|
|
38091
38451
|
fitSlice(tableNodeTypes(view.state.schema).cell, slice2)
|
|
38092
38452
|
)
|
|
38093
38453
|
]
|
|
@@ -70939,4 +71299,4 @@ var BadgePro = t__default.forwardRef(({
|
|
|
70939
71299
|
});
|
|
70940
71300
|
BadgePro.displayName = "BadgePro";
|
|
70941
71301
|
|
|
70942
|
-
export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, Calendar3 as AdvancedCalendar, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle,
|
|
71302
|
+
export { MoonUIAccordionPro as Accordion, MoonUIAccordionContentPro as AccordionContent, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, Calendar3 as AdvancedCalendar, AdvancedChart, AdvancedForms, MoonUIAlertPro as Alert, MoonUIAlertDescriptionPro as AlertDescription, MoonUIAlertTitlePro as AlertTitle, MoonUIAspectRatioPro as AspectRatio, MoonUIAvatarPro as Avatar, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarImagePro as AvatarImage, MoonUIBadgePro as Badge, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbPagePro as BreadcrumbPage, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIButtonPro as Button, Calendar, CalendarPro, MoonUICardPro as Card, MoonUICardContentPro as CardContent, MoonUICardDescriptionPro as CardDescription, MoonUICardFooterPro as CardFooter, MoonUICardHeaderPro as CardHeader, MoonUICardTitlePro as CardTitle, MoonUICheckboxPro as Checkbox, MoonUICollapsiblePro as Collapsible, MoonUICollapsibleContentPro as CollapsibleContent, MoonUICollapsibleTriggerPro as CollapsibleTrigger, MoonUIColorPickerPro as ColorPicker, MoonUICommandPro as Command, MoonUICommandDialogPro as CommandDialog, MoonUICommandEmptyPro as CommandEmpty, MoonUICommandGroupPro as CommandGroup, MoonUICommandInputPro as CommandInput, MoonUICommandItemPro as CommandItem, MoonUICommandListPro as CommandList, MoonUICommandSeparatorPro as CommandSeparator, MoonUICommandShortcutPro as CommandShortcut, Dashboard, DataTable, MoonUIDialogPro as Dialog, MoonUIDialogClosePro as DialogClose, MoonUIDialogContentPro as DialogContent, MoonUIDialogDescriptionPro as DialogDescription, MoonUIDialogFooterPro as DialogFooter, MoonUIDialogHeaderPro as DialogHeader, MoonUIDialogTitlePro as DialogTitle, MoonUIDialogTriggerPro as DialogTrigger, DraggableList, MoonUIDropdownMenuPro as DropdownMenu, MoonUIDropdownMenuCheckboxItemPro as DropdownMenuCheckboxItem, MoonUIDropdownMenuContentPro as DropdownMenuContent, MoonUIDropdownMenuGroupPro as DropdownMenuGroup, MoonUIDropdownMenuItemPro as DropdownMenuItem, MoonUIDropdownMenuLabelPro as DropdownMenuLabel, MoonUIDropdownMenuPortalPro as DropdownMenuPortal, MoonUIDropdownMenuRadioGroupPro as DropdownMenuRadioGroup, MoonUIDropdownMenuRadioItemPro as DropdownMenuRadioItem, MoonUIDropdownMenuSeparatorPro as DropdownMenuSeparator, MoonUIDropdownMenuShortcutPro as DropdownMenuShortcut, MoonUIDropdownMenuSubPro as DropdownMenuSub, MoonUIDropdownMenuSubContentPro as DropdownMenuSubContent, MoonUIDropdownMenuSubTriggerPro as DropdownMenuSubTrigger, MoonUIDropdownMenuTriggerPro as DropdownMenuTrigger, enhanced_exports as Enhanced, ErrorBoundary, FloatingActionButton, FormWizardNavigation, FormWizardProgress, FormWizardStep, GitHubStars, HealthCheck, HoverCard2 as HoverCard, HoverCardContent2 as HoverCardContent, HoverCardTrigger2 as HoverCardTrigger, MoonUIInputPro as Input, Kanban, LANGUAGE_COLORS, MoonUILabelPro as Label, LazyComponent, LazyImage, LazyList, MagneticButton, MemoryAnalytics, MemoryEfficientData, MoonUIAccordionContentPro, MoonUIAccordionItemPro, MoonUIAccordionPro, MoonUIAccordionTriggerPro, MoonUIAlertDescriptionPro, MoonUIAlertPro, MoonUIAlertTitlePro, MoonUIAnimatedButtonPro, MoonUIAspectRatioPro, MoonUIAvatarFallbackPro, MoonUIAvatarImagePro, MoonUIAvatarPro, MoonUIBadgePro, MoonUIBreadcrumbEllipsisPro, MoonUIBreadcrumbItemPro, MoonUIBreadcrumbLinkPro, MoonUIBreadcrumbListPro, MoonUIBreadcrumbPagePro, MoonUIBreadcrumbPro, MoonUIBreadcrumbSeparatorPro, MoonUIButtonPro, MoonUICardContentPro, MoonUICardDescriptionPro, MoonUICardFooterPro, MoonUICardHeaderPro, MoonUICardPro, MoonUICardTitlePro, MoonUICheckboxPro, MoonUICollapsibleContentPro, MoonUICollapsiblePro, MoonUICollapsibleTriggerPro, MoonUIColorPickerPro, MoonUICommandDialogPro, MoonUICommandEmptyPro, MoonUICommandGroupPro, MoonUICommandInputPro, MoonUICommandItemPro, MoonUICommandListPro, MoonUICommandPro, MoonUICommandSeparatorPro, MoonUICommandShortcutPro, MoonUICreditCardInputPro, MoonUIDialogClosePro, MoonUIDialogContentPro, MoonUIDialogDescriptionPro, MoonUIDialogFooterPro, MoonUIDialogHeaderPro, MoonUIDialogPro, MoonUIDialogTitlePro, MoonUIDialogTriggerPro, MoonUIDropdownMenuCheckboxItemPro, MoonUIDropdownMenuContentPro, MoonUIDropdownMenuGroupPro, MoonUIDropdownMenuItemPro, MoonUIDropdownMenuLabelPro, MoonUIDropdownMenuPortalPro, MoonUIDropdownMenuPro, MoonUIDropdownMenuRadioGroupPro, MoonUIDropdownMenuRadioItemPro, MoonUIDropdownMenuSeparatorPro, MoonUIDropdownMenuShortcutPro, MoonUIDropdownMenuSubContentPro, MoonUIDropdownMenuSubPro, MoonUIDropdownMenuSubTriggerPro, MoonUIDropdownMenuTriggerPro, MoonUIFileUploadPro, MoonUIFormWizardPro, MoonUIInputPro, MoonUILabelPro, MoonUIPaginationContentPro, MoonUIPaginationEllipsisPro, MoonUIPaginationItemPro, MoonUIPaginationLinkPro, MoonUIPaginationNextPro, MoonUIPaginationPreviousPro, MoonUIPaginationPro, MoonUIPhoneNumberInputPro, MoonUIPopoverContentPro, MoonUIPopoverPro, MoonUIPopoverTriggerPro, MoonUIProgressPro, MoonUIQuizFormPro, MoonUIRadioGroupContextPro, MoonUIRadioGroupItemPro, MoonUIRadioGroupPro, MoonUIRadioItemWithLabelPro, MoonUIRadioLabelPro, MoonUISelectContentPro, MoonUISelectGroupPro, MoonUISelectItemPro, MoonUISelectLabelPro, MoonUISelectPro, MoonUISelectSeparatorPro, MoonUISelectTriggerPro, MoonUISelectValuePro, MoonUISeparatorPro, MoonUISkeletonPro, MoonUISliderPro, MoonUISwitchPro, MoonUITableBodyPro, MoonUITableCaptionPro, MoonUITableCellPro, MoonUITableFooterPro, MoonUITableHeadPro, MoonUITableHeaderPro, MoonUITablePro, MoonUITableRowPro, MoonUITabsContentPro, MoonUITabsListPro, MoonUITabsPro, MoonUITabsTriggerPro, MoonUITextareaPro, MoonUIToastPro, MoonUITogglePro, MoonUITooltipContentPro, MoonUITooltipPro, MoonUITooltipProviderPro, MoonUITooltipTriggerPro, MoonUIalertVariantsPro, MoonUIaspectRatioVariantsPro, MoonUIbreadcrumbVariantsPro, MoonUIcollapsibleContentVariantsPro, MoonUIcollapsibleTriggerVariantsPro, MoonUIcommandVariantsPro, MoonUIradioGroupItemVariantsPro, MoonUItableVariantsPro, MoonUItoggleVariantsPro, OptimizedImage, MoonUIPaginationPro as Pagination, MoonUIPaginationContentPro as PaginationContent, MoonUIPaginationEllipsisPro as PaginationEllipsis, MoonUIPaginationItemPro as PaginationItem, MoonUIPaginationLinkPro as PaginationLink, MoonUIPaginationNextPro as PaginationNext, MoonUIPaginationPreviousPro as PaginationPrevious, PerformanceDebugger, PerformanceMonitor, PinchZoom, MoonUIPopoverPro as Popover, MoonUIPopoverContentPro as PopoverContent, MoonUIPopoverTriggerPro as PopoverTrigger, MoonUIProgressPro as Progress, MoonUIRadioGroupPro as RadioGroup, MoonUIRadioGroupContextPro as RadioGroupContext, MoonUIRadioGroupItemPro as RadioGroupItem, MoonUIRadioItemWithLabelPro as RadioItemWithLabel, MoonUIRadioLabelPro as RadioLabel, RealTimePerformanceMonitor, RichTextEditor, ScrollArea, ScrollBar, MoonUISelectPro as Select, MoonUISelectContentPro as SelectContent, MoonUISelectGroupPro as SelectGroup, MoonUISelectItemPro as SelectItem, MoonUISelectLabelPro as SelectLabel, MoonUISelectSeparatorPro as SelectSeparator, MoonUISelectTriggerPro as SelectTrigger, MoonUISelectValuePro as SelectValue, SelectableVirtualList, MoonUISeparatorPro as Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar2 as Sidebar, MoonUISkeletonPro as Skeleton, MoonUISliderPro as Slider, SpotlightCard, SwipeableCard, MoonUISwitchPro as Switch, MoonUITablePro as Table, MoonUITableBodyPro as TableBody, MoonUITableCaptionPro as TableCaption, MoonUITableCellPro as TableCell, MoonUITableFooterPro as TableFooter, MoonUITableHeadPro as TableHead, MoonUITableHeaderPro as TableHeader, MoonUITableRowPro as TableRow, MoonUITabsPro as Tabs, MoonUITabsContentPro as TabsContent, MoonUITabsListPro as TabsList, MoonUITabsTriggerPro as TabsTrigger, MoonUITextareaPro as Textarea, Timeline, MoonUIToastPro as Toast, MoonUITogglePro as Toggle, MoonUITooltipPro as Tooltip, MoonUITooltipContentPro as TooltipContent, MoonUITooltipProviderPro as TooltipProvider, MoonUITooltipTriggerPro as TooltipTrigger, VirtualList, MoonUIalertVariantsPro as alertVariants, MoonUIaspectRatioVariantsPro as aspectRatioVariants, moonUIBadgeVariantsPro as badgeVariants, MoonUIbreadcrumbVariantsPro as breadcrumbVariants, moonUIButtonProVariants as buttonVariants, cn, MoonUIcollapsibleContentVariantsPro as collapsibleContentVariants, MoonUIcollapsibleTriggerVariantsPro as collapsibleTriggerVariants, MoonUIcommandVariantsPro as commandVariants, getExpandableColumn, hoverCard3DVariants, moonUIAnimatedButtonProVariants, moonUIBadgeVariantsPro, moonUIButtonProVariants, moonUISeparatorVariantsPro, countries as phoneCountries, MoonUIradioGroupItemVariantsPro as radioGroupItemVariants, moonUISeparatorVariantsPro as separatorVariants, MoonUItableVariantsPro as tableVariants, MoonUItoggleVariantsPro as toggleVariants, useExpandableRows, useFormWizard, useStreamingData, useVirtualList };
|