@contentful/field-editor-rich-text 1.0.6 → 1.1.1
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.
- package/CHANGELOG.md +24 -0
- package/dist/field-editor-rich-text.cjs.development.js +22 -20
- package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
- package/dist/field-editor-rich-text.esm.js +22 -20
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/package.json +8 -8
|
@@ -2768,19 +2768,13 @@ function _fetchAllData() {
|
|
|
2768
2768
|
case 4:
|
|
2769
2769
|
entity = _context.sent;
|
|
2770
2770
|
|
|
2771
|
-
if (
|
|
2772
|
-
|
|
2773
|
-
|
|
2771
|
+
if (entity.sys.contentType) {
|
|
2772
|
+
contentTypeId = entity.sys.contentType.sys.id;
|
|
2773
|
+
contentType = sdk.space.getCachedContentTypes().find(function (ct) {
|
|
2774
|
+
return ct.sys.id === contentTypeId;
|
|
2775
|
+
});
|
|
2774
2776
|
}
|
|
2775
2777
|
|
|
2776
|
-
contentTypeId = entity.sys.contentType.sys.id;
|
|
2777
|
-
_context.next = 9;
|
|
2778
|
-
return sdk.space.getContentType(contentTypeId);
|
|
2779
|
-
|
|
2780
|
-
case 9:
|
|
2781
|
-
contentType = _context.sent;
|
|
2782
|
-
|
|
2783
|
-
case 10:
|
|
2784
2778
|
entityTitle = entityType === 'Entry' ? entityHelpers.getEntryTitle({
|
|
2785
2779
|
entry: entity,
|
|
2786
2780
|
contentType: contentType,
|
|
@@ -2799,10 +2793,10 @@ function _fetchAllData() {
|
|
|
2799
2793
|
localeCode: localeCode,
|
|
2800
2794
|
defaultLocaleCode: defaultLocaleCode
|
|
2801
2795
|
});
|
|
2802
|
-
_context.next =
|
|
2796
|
+
_context.next = 10;
|
|
2803
2797
|
return sdk.space.getEntityScheduledActions(entityType, entityId);
|
|
2804
2798
|
|
|
2805
|
-
case
|
|
2799
|
+
case 10:
|
|
2806
2800
|
jobs = _context.sent;
|
|
2807
2801
|
entityStatus = entityHelpers.getEntryStatus(entity.sys);
|
|
2808
2802
|
return _context.abrupt("return", {
|
|
@@ -2814,7 +2808,7 @@ function _fetchAllData() {
|
|
|
2814
2808
|
contentTypeName: contentType ? contentType.name : ''
|
|
2815
2809
|
});
|
|
2816
2810
|
|
|
2817
|
-
case
|
|
2811
|
+
case 13:
|
|
2818
2812
|
case "end":
|
|
2819
2813
|
return _context.stop();
|
|
2820
2814
|
}
|
|
@@ -3022,12 +3016,20 @@ var HyperlinkPlugin = function HyperlinkPlugin(_ref) {
|
|
|
3022
3016
|
return next();
|
|
3023
3017
|
},
|
|
3024
3018
|
normalizeNode: function normalizeNode(node, editor, next) {
|
|
3025
|
-
if (isHyperlink(node.type)
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
}
|
|
3030
|
-
}
|
|
3019
|
+
if (isHyperlink(node.type)) {
|
|
3020
|
+
if (node.text.trim() === '') {
|
|
3021
|
+
return function () {
|
|
3022
|
+
editor.removeNodeByKey(node.key);
|
|
3023
|
+
};
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
if (node.getInlines().size > 0) {
|
|
3027
|
+
return function () {
|
|
3028
|
+
node.getInlines().forEach(function (inlineNode) {
|
|
3029
|
+
return editor.unwrapInlineByKey(inlineNode.key, node.type);
|
|
3030
|
+
});
|
|
3031
|
+
};
|
|
3032
|
+
}
|
|
3031
3033
|
}
|
|
3032
3034
|
|
|
3033
3035
|
next();
|