@wordpress/block-library
Version:
Block library for the WordPress editor.
49 lines (48 loc) • 1.21 kB
JavaScript
// packages/block-library/src/more/index.js
import { more as icon } from "@wordpress/icons";
import { __ } from "@wordpress/i18n";
import { privateApis as blocksPrivateApis } from "@wordpress/blocks";
import initBlock from "../utils/init-block";
import edit from "./edit";
import metadata from "./block.json";
import save from "./save";
import transforms from "./transforms";
import { unlock } from "../lock-unlock";
var { fieldsKey, formKey } = unlock(blocksPrivateApis);
var { name } = metadata;
var settings = {
icon,
example: {},
__experimentalLabel(attributes, { context }) {
const customName = attributes?.metadata?.name;
if (context === "list-view" && customName) {
return customName;
}
if (context === "accessibility") {
return attributes.customText;
}
},
transforms,
edit,
save
};
if (window.__experimentalContentOnlyInspectorFields) {
settings[fieldsKey] = [
{
id: "customText",
label: __("Content"),
type: "richtext"
}
];
settings[formKey] = {
fields: ["customText"]
};
}
var init = () => initBlock({ name, metadata, settings });
export {
init,
metadata,
name,
settings
};
//# sourceMappingURL=index.js.map