@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
31 lines (30 loc) • 899 B
JavaScript
// packages/editor/src/components/revision-block-diff/index.js
import { store as blockEditorStore } from "@wordpress/block-editor";
import { useSelect } from "@wordpress/data";
import { __ } from "@wordpress/i18n";
import RevisionDiffPanel from "../revision-diff-panel/index.mjs";
import { jsx } from "react/jsx-runtime";
function RevisionBlockDiffPanel() {
const { block } = useSelect((select) => {
const { getSelectedBlock } = select(blockEditorStore);
return {
block: getSelectedBlock()
};
}, []);
if (!block) {
return null;
}
const changedAttributes = block.attributes?.__revisionDiffStatus?.changedAttributes;
return /* @__PURE__ */ jsx(
RevisionDiffPanel,
{
title: __("Changed attributes"),
entries: changedAttributes,
initialOpen: true
}
);
}
export {
RevisionBlockDiffPanel as default
};
//# sourceMappingURL=index.mjs.map