@contentful/field-editor-rich-text 2.1.3 → 2.2.0

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,12 @@
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
+ # [2.2.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@2.1.3...@contentful/field-editor-rich-text@2.2.0) (2022-07-06)
7
+
8
+ ### Features
9
+
10
+ - add tracking for rich-text-commands ([#1174](https://github.com/contentful/field-editors/issues/1174)) ([75fc492](https://github.com/contentful/field-editors/commit/75fc49210a5789bf029ddb81413349d74f441f28))
11
+
6
12
  ## [2.1.3](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@2.1.2...@contentful/field-editor-rich-text@2.1.3) (2022-07-06)
7
13
 
8
14
  ### Bug Fixes
@@ -1609,6 +1609,9 @@ var useCommands = function useCommands(sdk, query, editor) {
1609
1609
  editor.insertSoftBreak();
1610
1610
  insertBlock(editor, Contentful.BLOCKS.EMBEDDED_ENTRY, entry.entry);
1611
1611
  slate.Transforms.select(editor, selection);
1612
+ editor.tracking.onCommandPaletteAction('insert', {
1613
+ nodeType: Contentful.BLOCKS.EMBEDDED_ENTRY
1614
+ });
1612
1615
  }
1613
1616
  }
1614
1617
  };
@@ -1638,6 +1641,9 @@ var useCommands = function useCommands(sdk, query, editor) {
1638
1641
  removeCommand(editor);
1639
1642
  slate.Transforms.insertNodes(editor, inlineNode);
1640
1643
  editor.insertText('');
1644
+ editor.tracking.onCommandPaletteAction('insert', {
1645
+ nodeType: Contentful.INLINES.EMBEDDED_ENTRY
1646
+ });
1641
1647
  }
1642
1648
  };
1643
1649
  }));
@@ -1675,6 +1681,9 @@ var useCommands = function useCommands(sdk, query, editor) {
1675
1681
  editor.insertSoftBreak();
1676
1682
  insertBlock(editor, Contentful.BLOCKS.EMBEDDED_ASSET, asset.entity);
1677
1683
  slate.Transforms.select(editor, selection);
1684
+ editor.tracking.onCommandPaletteAction('insert', {
1685
+ nodeType: Contentful.BLOCKS.EMBEDDED_ASSET
1686
+ });
1678
1687
  }
1679
1688
  }
1680
1689
  };
@@ -1936,6 +1945,7 @@ var createOnKeyDown = function createOnKeyDown() {
1936
1945
  var _setMarks;
1937
1946
 
1938
1947
  plateCore.setMarks(editor, (_setMarks = {}, _setMarks[COMMAND_PROMPT] = true, _setMarks));
1948
+ editor.tracking.onCommandPaletteAction('openRichTextCommandPalette');
1939
1949
  }
1940
1950
 
1941
1951
  var isActive = plateCore.isMarkActive(editor, COMMAND_PROMPT);
@@ -1965,6 +1975,7 @@ var createOnKeyDown = function createOnKeyDown() {
1965
1975
  key: COMMAND_PROMPT,
1966
1976
  at: _range
1967
1977
  });
1978
+ editor.tracking.onCommandPaletteAction('cancelRichTextCommandPalette');
1968
1979
  }
1969
1980
  }
1970
1981
  };