| 1 | import { type TElement } from "platejs"; |
| 2 | import { createTPlatePlugin } from "platejs/react"; |
| 3 | |
| 4 | import FlexBox from "../custom-elements/flex-box"; |
| 5 | import { FLEX_BOX } from "../lib"; |
| 6 | |
| 7 | export const FlexBoxPlugin = createTPlatePlugin({ |
| 8 | key: FLEX_BOX, |
| 9 | node: { |
| 10 | isElement: true, |
| 11 | type: FLEX_BOX, |
| 12 | component: FlexBox, |
| 13 | }, |
| 14 | }); |
| 15 | |
| 16 | export type TFlexBoxElement = TElement & { |
| 17 | type: typeof FLEX_BOX; |
| 18 | align?: "start" | "center" | "end" | "stretch" | "baseline"; |
| 19 | justify?: "start" | "center" | "end" | "between" | "around" | "evenly"; |
| 20 | gap?: "sm" | "md" | "lg" | "xl" | "none"; |
| 21 | }; |
| 22 |