@wordpress/block-library
Version:
Block library for the WordPress editor.
46 lines (45 loc) • 1.03 kB
JavaScript
// packages/block-library/src/social-link/index.js
import { __ } from "@wordpress/i18n";
import { share as icon } from "@wordpress/icons";
import { privateApis as blocksPrivateApis } from "@wordpress/blocks";
import initBlock from "../utils/init-block";
import edit from "./edit";
import metadata from "./block.json";
import variations from "./variations";
import { unlock } from "../lock-unlock";
var { fieldsKey, formKey } = unlock(blocksPrivateApis);
var { name } = metadata;
var settings = {
icon,
edit,
variations
};
if (window.__experimentalContentOnlyInspectorFields) {
settings[fieldsKey] = [
{
id: "link",
label: __("Link"),
type: "link",
mapping: {
href: "url",
rel: "rel"
}
},
{
id: "label",
label: __("Label"),
type: "richtext"
}
];
settings[formKey] = {
fields: ["link"]
};
}
var init = () => initBlock({ name, metadata, settings });
export {
init,
metadata,
name,
settings
};
//# sourceMappingURL=index.js.map