@wordpress/block-library
Version:
Block library for the WordPress editor.
27 lines (26 loc) • 999 B
JavaScript
import { __ } from "@wordpress/i18n";
import { preformatted } from "@wordpress/icons";
import initBlock from "../utils/init-block.mjs";
import edit from "./edit.mjs";
import metadata from "./block.json";
import save from "./save.mjs";
import transforms from "./transforms.mjs";
// packages/block-library/src/preformatted/index.js
const { name } = metadata;
const settings = {
icon: preformatted,
example: { attributes: { content: __("EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;") } },
transforms,
edit,
save,
merge(attributes, attributesToMerge) {
return { content: attributes.content + "\n\n" + attributesToMerge.content };
}
};
const init = () => initBlock({
name,
metadata,
settings
});
export { init, metadata, name, settings };
//# sourceMappingURL=index.mjs.map