@mirrormedia/lilith-draft-editor 1.1.0-alpha.15 → 1.1.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,10 +11,17 @@ var _mirrormedia = _interopRequireDefault(require("@mirrormedia/lilith-draft-ren
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
+ //Because `annotationDecorator` and `linkDecorator` is generated by different `contentLayout`,
15
+ //so it is needed to generate decorators by using function `decoratorsGenerator`.
14
16
  const {
15
17
  annotationDecorator,
16
18
  linkDecorator
17
19
  } = _mirrormedia.default.entityDecorators;
18
- const decorators = new _draftJs.CompositeDecorator([annotationDecorator, linkDecorator]);
20
+
21
+ const decoratorsGenerator = (contentLayout = 'normal') => {
22
+ return new _draftJs.CompositeDecorator([annotationDecorator(contentLayout), linkDecorator(contentLayout)]);
23
+ };
24
+
25
+ const decorators = decoratorsGenerator('normal');
19
26
  var _default = decorators;
20
27
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirrormedia/lilith-draft-editor",
3
- "version": "1.1.0-alpha.15",
3
+ "version": "1.1.0-alpha.16",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
25
  "draft-js": "^0.11.7",
26
- "@mirrormedia/lilith-draft-renderer": "1.2.0-alpha.29"
26
+ "@mirrormedia/lilith-draft-renderer": "1.2.0-alpha.30"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "18.2.0",