@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 CHANGED
@@ -3,6 +3,30 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@1.1.0...@contentful/field-editor-rich-text@1.1.1) (2022-01-20)
7
+
8
+ ### Bug Fixes
9
+
10
+ - remove empty text hyperlinks ([#997](https://github.com/contentful/field-editors/issues/997)) ([d998132](https://github.com/contentful/field-editors/commit/d998132fbe948a98f6e800211a794bdd1e292233))
11
+
12
+ # [1.1.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@1.0.8...@contentful/field-editor-rich-text@1.1.0) (2022-01-11)
13
+
14
+ ### Features
15
+
16
+ - bump f36 packages to stable v4 [BAU-521] ([#988](https://github.com/contentful/field-editors/issues/988)) ([419cf56](https://github.com/contentful/field-editors/commit/419cf56692179b074fcfa2743469d5265ed98429))
17
+
18
+ ## [1.0.8](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@1.0.7...@contentful/field-editor-rich-text@1.0.8) (2021-12-23)
19
+
20
+ ### Bug Fixes
21
+
22
+ - markdown buttons ([#968](https://github.com/contentful/field-editors/issues/968)) ([9803b98](https://github.com/contentful/field-editors/commit/9803b98c25d92df6148686ffe2749a77f7efdbb9))
23
+
24
+ ## [1.0.7](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@1.0.6...@contentful/field-editor-rich-text@1.0.7) (2021-12-22)
25
+
26
+ ### Bug Fixes
27
+
28
+ - cache content types for Hyperlink ([#967](https://github.com/contentful/field-editors/issues/967)) ([07e376d](https://github.com/contentful/field-editors/commit/07e376de5157fa6477f060550aacf96af3ab5e85))
29
+
6
30
  ## [1.0.6](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@1.0.5...@contentful/field-editor-rich-text@1.0.6) (2021-12-20)
7
31
 
8
32
  **Note:** Version bump only for package @contentful/field-editor-rich-text
@@ -2775,19 +2775,13 @@ function _fetchAllData() {
2775
2775
  case 4:
2776
2776
  entity = _context.sent;
2777
2777
 
2778
- if (!entity.sys.contentType) {
2779
- _context.next = 10;
2780
- break;
2778
+ if (entity.sys.contentType) {
2779
+ contentTypeId = entity.sys.contentType.sys.id;
2780
+ contentType = sdk.space.getCachedContentTypes().find(function (ct) {
2781
+ return ct.sys.id === contentTypeId;
2782
+ });
2781
2783
  }
2782
2784
 
2783
- contentTypeId = entity.sys.contentType.sys.id;
2784
- _context.next = 9;
2785
- return sdk.space.getContentType(contentTypeId);
2786
-
2787
- case 9:
2788
- contentType = _context.sent;
2789
-
2790
- case 10:
2791
2785
  entityTitle = entityType === 'Entry' ? fieldEditorShared.entityHelpers.getEntryTitle({
2792
2786
  entry: entity,
2793
2787
  contentType: contentType,
@@ -2806,10 +2800,10 @@ function _fetchAllData() {
2806
2800
  localeCode: localeCode,
2807
2801
  defaultLocaleCode: defaultLocaleCode
2808
2802
  });
2809
- _context.next = 14;
2803
+ _context.next = 10;
2810
2804
  return sdk.space.getEntityScheduledActions(entityType, entityId);
2811
2805
 
2812
- case 14:
2806
+ case 10:
2813
2807
  jobs = _context.sent;
2814
2808
  entityStatus = fieldEditorShared.entityHelpers.getEntryStatus(entity.sys);
2815
2809
  return _context.abrupt("return", {
@@ -2821,7 +2815,7 @@ function _fetchAllData() {
2821
2815
  contentTypeName: contentType ? contentType.name : ''
2822
2816
  });
2823
2817
 
2824
- case 17:
2818
+ case 13:
2825
2819
  case "end":
2826
2820
  return _context.stop();
2827
2821
  }
@@ -3029,12 +3023,20 @@ var HyperlinkPlugin = function HyperlinkPlugin(_ref) {
3029
3023
  return next();
3030
3024
  },
3031
3025
  normalizeNode: function normalizeNode(node, editor, next) {
3032
- if (isHyperlink(node.type) && node.getInlines().size > 0) {
3033
- return function () {
3034
- node.getInlines().forEach(function (inlineNode) {
3035
- return editor.unwrapInlineByKey(inlineNode.key, node.type);
3036
- });
3037
- };
3026
+ if (isHyperlink(node.type)) {
3027
+ if (node.text.trim() === '') {
3028
+ return function () {
3029
+ editor.removeNodeByKey(node.key);
3030
+ };
3031
+ }
3032
+
3033
+ if (node.getInlines().size > 0) {
3034
+ return function () {
3035
+ node.getInlines().forEach(function (inlineNode) {
3036
+ return editor.unwrapInlineByKey(inlineNode.key, node.type);
3037
+ });
3038
+ };
3039
+ }
3038
3040
  }
3039
3041
 
3040
3042
  next();