json-joy
Version:
Collection of libraries for building collaborative editing apps.
16 lines (15 loc) • 594 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.AnchorView = void 0;
const context_1 = require("../context");
const constants_1 = require("../../constants");
const AnchorView = (props) => {
const { plugins } = (0, context_1.usePeritext)();
// This zero-width non-breaking space prevents word wrapping at position where
// anchor is inserted.
let children = constants_1.Char.ZeroLengthSpace;
for (const map of plugins)
children = map.anchor?.(props, children) ?? children;
return children;
};
exports.AnchorView = AnchorView;
;