@wordpress/core-data
Version:
Access to and manipulation of core WordPress entities.
20 lines (19 loc) • 625 B
JavaScript
// packages/core-data/src/footnotes/get-rich-text-values-cached.js
import { privateApis as blockEditorPrivateApis } from "@wordpress/block-editor";
import { unlock } from "../lock-unlock";
var unlockedApis;
var cache = /* @__PURE__ */ new WeakMap();
function getRichTextValuesCached(block) {
if (!unlockedApis) {
unlockedApis = unlock(blockEditorPrivateApis);
}
if (!cache.has(block)) {
const values = unlockedApis.getRichTextValues([block]);
cache.set(block, values);
}
return cache.get(block);
}
export {
getRichTextValuesCached as default
};
//# sourceMappingURL=get-rich-text-values-cached.js.map