UNPKG

@mirrormedia/lilith-draft-editor

Version:
27 lines (20 loc) 902 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _draftJs = require("draft-js"); var _mirrormedia = _interopRequireDefault(require("@mirrormedia/lilith-draft-renderer/lib/website/mirrormedia")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } //Because `annotationDecorator` and `linkDecorator` is generated by different `contentLayout`, //so it is needed to generate decorators by using function `decoratorsGenerator`. const { annotationDecorator, linkDecorator } = _mirrormedia.default.entityDecorators; const decoratorsGenerator = (contentLayout = 'normal') => { return new _draftJs.CompositeDecorator([annotationDecorator(contentLayout), linkDecorator(contentLayout)]); }; const decorators = decoratorsGenerator('normal'); var _default = decorators; exports.default = _default;