@wordpress/block-library
Version:
Block library for the WordPress editor.
32 lines (31 loc) • 1.02 kB
JavaScript
import { RichText, useBlockProps } from "@wordpress/block-editor";
import metadata from "./block.json";
import Tracks from "./tracks.mjs";
import { jsx, jsxs } from "react/jsx-runtime";
// packages/block-library/src/video/deprecated.jsx
const { attributes: blockAttributes } = metadata;
const deprecated = [{
attributes: blockAttributes,
save({ attributes }) {
const { autoplay, caption, controls, loop, muted, poster, preload, src, playsInline, tracks } = attributes;
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,
children: /* @__PURE__ */ jsx(Tracks, { tracks })
}), !RichText.isEmpty(caption) && /* @__PURE__ */ jsx(RichText.Content, {
tagName: "figcaption",
value: caption
})]
});
}
}];
export { deprecated as default };
//# sourceMappingURL=deprecated.mjs.map