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