@wordpress/block-library
Version:
Block library for the WordPress editor.
24 lines (23 loc) • 1.07 kB
JavaScript
import { useCallback } from "@wordpress/element";
import { useBlockProps, useInnerBlocksProps } from "@wordpress/block-editor";
import TermsQueryInspectorControls from "./inspector-controls/index.mjs";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
// packages/block-library/src/terms-query/edit/terms-query-content.jsx
function TermsQueryContent({ attributes, setAttributes, clientId, context }) {
const { tagName: TagName } = attributes;
const blockProps = useBlockProps();
const innerBlocksProps = useInnerBlocksProps(blockProps, {});
const setQuery = useCallback((newQuery) => setAttributes((prevAttributes) => ({ termQuery: {
...prevAttributes.termQuery,
...newQuery
} })), [setAttributes]);
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(TermsQueryInspectorControls, {
attributes,
setQuery,
setAttributes,
clientId,
templateSlug: context?.templateSlug
}), /* @__PURE__ */ jsx(TagName, { ...innerBlocksProps })] });
}
export { TermsQueryContent as default };
//# sourceMappingURL=terms-query-content.mjs.map