返回 presentation-ai
sequence-arrow.tsx
1 "use client";
2
3 import { PlateElement, type PlateElementProps } from "platejs/react";
4
5 import { cn } from "@/lib/utils";
6
7 export default function SequenceArrow(props: PlateElementProps) {
8 const { orientation, alignment = "center" } = props.element;
9 return (
10 <PlateElement {...props} className="relative my-4">
11 {/* Container for alignment control */}
12 <div
13 className={cn(
14 "flex w-full",
15 // Apply alignment to the container, not the sequence arrow structure
16 alignment === "left" && "justify-start",
17 alignment === "right" && "justify-end",
18 alignment === "center" && "justify-center",
19 )}
20 >
21 {/* Sequence arrow structure - always full width */}
22 <div
23 className={cn(
24 "grid w-full gap-1",
25 orientation === "horizontal"
26 ? "auto-cols-fr grid-flow-col"
27 : "grid-flow-row",
28 "[&_:is(.presentation-heading)]:[-webkit-background-clip:unset!important;]",
29 "[&_:is(.presentation-heading)]:[-webkit-text-fill-color:unset!important;]",
30 "[&_:is(.presentation-heading)]:[background-clip:unset!important;]",
31 "[&_:is(.presentation-heading)]:[background:none!important;]",
32 "[&_:is(.presentation-heading)]:text-(--presentation-text)!",
33 )}
34 >
35 {props.children}
36 </div>
37 </div>
38 </PlateElement>
39 );
40 }
41
41 lines Plain Text