UNPKG

@wordpress/block-library

Version:
52 lines (51 loc) 1.21 kB
// packages/block-library/src/search/index.js import { __ } from "@wordpress/i18n"; import { search as icon } from "@wordpress/icons"; import { privateApis as blocksPrivateApis } from "@wordpress/blocks"; import initBlock from "../utils/init-block"; import metadata from "./block.json"; import edit from "./edit"; import variations from "./variations"; import { unlock } from "../lock-unlock"; var { fieldsKey, formKey } = unlock(blocksPrivateApis); var { name } = metadata; var settings = { icon, example: { attributes: { buttonText: __("Search"), label: __("Search") }, viewportWidth: 400 }, variations, edit }; if (window.__experimentalContentOnlyInspectorFields) { settings[fieldsKey] = [ { id: "label", label: __("Label"), type: "richtext", shownByDefault: true }, { id: "buttonText", label: __("Button text"), type: "richtext" }, { id: "placeholder", label: __("Placeholder"), type: "richtext" } ]; settings[formKey] = { fields: ["label"] }; } var init = () => initBlock({ name, metadata, settings }); export { init, metadata, name, settings }; //# sourceMappingURL=index.js.map