UNPKG

@wordpress/block-library

Version:
34 lines (33 loc) 1.15 kB
// packages/block-library/src/tab-list/edit.js import { useBlockProps, useInnerBlocksProps, store as blockEditorStore } from "@wordpress/block-editor"; import { useSelect } from "@wordpress/data"; import AddTabToolbarControl from "../tab-panel/add-tab-toolbar-control.mjs"; import RemoveTabToolbarControl from "../tab-panel/remove-tab-toolbar-control.mjs"; import { Fragment, jsx, jsxs } from "react/jsx-runtime"; function Edit({ clientId }) { const tabsClientId = useSelect( (select) => select(blockEditorStore).getBlockRootClientId(clientId), [clientId] ); const blockProps = useBlockProps(); const innerBlocksProps = useInnerBlocksProps(blockProps, { allowedBlocks: ["core/tab"], orientation: "horizontal", templateLock: false, renderAppender: false }); return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(AddTabToolbarControl, { tabsClientId }), /* @__PURE__ */ jsx(RemoveTabToolbarControl, { tabsClientId }), /* @__PURE__ */ jsx("div", { ...innerBlocksProps }) ] }); } var edit_default = Edit; export { edit_default as default }; //# sourceMappingURL=edit.mjs.map