UNPKG

@wordpress/block-library

Version:
36 lines (35 loc) • 1.01 kB
import { addSubmenu, page } from "@wordpress/icons"; import { _x } from "@wordpress/i18n"; import initBlock from "../utils/init-block.mjs"; import metadata from "./block.json"; import edit from "./edit.mjs"; import save from "./save.mjs"; import transforms from "./transforms.mjs"; // packages/block-library/src/navigation-submenu/index.js const { name } = metadata; const settings = { icon: ({ context }) => { if (context === "list-view") return page; return addSubmenu; }, __experimentalLabel(attributes, { context }) { const { label } = attributes; const customName = attributes?.metadata?.name; if ((context === "list-view" || context === "breadcrumb") && customName) return customName; return label; }, edit, example: { attributes: { label: _x("About", "Example link text for Navigation Submenu"), type: "page" } }, save, transforms }; const init = () => initBlock({ name, metadata, settings }); export { init, metadata, name, settings }; //# sourceMappingURL=index.mjs.map