@wordpress/editor
Version:
Enhanced block editor for WordPress posts.
16 lines (15 loc) • 512 B
JavaScript
// packages/editor/src/components/character-count/index.js
import { useSelect } from "@wordpress/data";
import { count as characterCount } from "@wordpress/wordcount";
import { store as editorStore } from "../../store/index.mjs";
function CharacterCount() {
const content = useSelect(
(select) => select(editorStore).getEditedPostAttribute("content"),
[]
);
return characterCount(content, "characters_including_spaces");
}
export {
CharacterCount as default
};
//# sourceMappingURL=index.mjs.map