UNPKG

@wordpress/block-library

Version:
31 lines (30 loc) • 963 B
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); let _wordpress_blocks = require("@wordpress/blocks"); // packages/block-library/src/separator/transforms.js const transforms = { from: [{ type: "input", regExp: /^-{3,}$/, transform: () => { const defaultVariation = (0, _wordpress_blocks.getBlockVariations)("core/separator")?.find((variation) => variation.isDefault); return [(0, _wordpress_blocks.createBlock)("core/separator", defaultVariation?.attributes ?? {}), (0, _wordpress_blocks.createBlock)((0, _wordpress_blocks.getDefaultBlockName)())]; } }, { type: "raw", selector: "hr", schema: { hr: {} } }], to: [{ type: "block", blocks: ["core/spacer"], transform: ({ anchor }) => { return (0, _wordpress_blocks.createBlock)("core/spacer", { anchor: anchor || void 0 }); } }] }; exports.default = transforms; //# sourceMappingURL=transforms.cjs.map