@wordpress/block-library
Version:
Block library for the WordPress editor.
57 lines (56 loc) • 1.42 kB
JavaScript
// 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.mjs";
import metadata from "./block.json";
import edit from "./edit.mjs";
import variations from "./variations.mjs";
import { unlock } from "../lock-unlock.mjs";
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: "text",
Edit: "rich-text"
// TODO: replace with custom component
},
{
id: "buttonText",
label: __("Button text"),
type: "text",
Edit: "rich-text"
// TODO: replace with custom component
},
{
id: "placeholder",
label: __("Placeholder"),
type: "text",
Edit: "rich-text"
// TODO: replace with custom component
}
];
settings[formKey] = {
fields: ["label", "buttonText", "placeholder"]
};
}
var init = () => initBlock({ name, metadata, settings });
export {
init,
metadata,
name,
settings
};
//# sourceMappingURL=index.mjs.map