UNPKG

@wordpress/block-library

Version:
57 lines (56 loc) 1.29 kB
// packages/block-library/src/video/save.js import { RichText, useBlockProps, __experimentalGetElementClassName } from "@wordpress/block-editor"; import Tracks from "./tracks.mjs"; import { jsx, jsxs } from "react/jsx-runtime"; function save({ attributes }) { const { autoplay, caption, controls, loop, muted, poster, preload, src, playsInline, tracks, width, height } = attributes; const aspectRatio = width && height ? `${width} / ${height}` : void 0; return /* @__PURE__ */ jsxs("figure", { ...useBlockProps.save(), children: [ src && /* @__PURE__ */ jsx( "video", { autoPlay: autoplay, controls, loop, muted, poster, preload: preload !== "metadata" ? preload : void 0, src, playsInline, width, height, style: aspectRatio ? { aspectRatio } : void 0, children: /* @__PURE__ */ jsx(Tracks, { tracks }) } ), !RichText.isEmpty(caption) && /* @__PURE__ */ jsx( RichText.Content, { className: __experimentalGetElementClassName("caption"), tagName: "figcaption", value: caption } ) ] }); } export { save as default }; //# sourceMappingURL=save.mjs.map