@wordpress/block-library
Version:
Block library for the WordPress editor.
20 lines (19 loc) • 735 B
JavaScript
import clsx from "clsx";
import { RichText, useBlockProps } from "@wordpress/block-editor";
import { isRTL } from "@wordpress/i18n";
import { jsx } from "react/jsx-runtime";
// packages/block-library/src/paragraph/save.jsx
function save({ attributes }) {
const { content, dropCap, direction, style } = attributes;
const textAlign = style?.typography?.textAlign;
const className = clsx({ "has-drop-cap": textAlign === (isRTL() ? "left" : "right") || textAlign === "center" ? false : dropCap });
return /* @__PURE__ */ jsx("p", {
...useBlockProps.save({
className,
dir: direction
}),
children: /* @__PURE__ */ jsx(RichText.Content, { value: content })
});
}
export { save as default };
//# sourceMappingURL=save.mjs.map