@contentful/field-editor-rich-text 3.16.11 → 3.16.13

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.
Files changed (210) hide show
  1. package/dist/cjs/ContentfulEditorProvider.js +8 -8
  2. package/dist/cjs/RichTextEditor.js +6 -4
  3. package/dist/cjs/SdkProvider.js +4 -2
  4. package/dist/cjs/SyncEditorChanges.js +4 -2
  5. package/dist/cjs/Toolbar/_tests_/toolbar.test.js +6 -4
  6. package/dist/cjs/Toolbar/components/EmbedEntityWidget.js +4 -2
  7. package/dist/cjs/Toolbar/components/EmbeddedEntityDropdownButton.js +4 -2
  8. package/dist/cjs/Toolbar/components/StickyToolbarWrapper.js +1 -1
  9. package/dist/cjs/Toolbar/index.js +5 -3
  10. package/dist/cjs/__fixtures__/FakeSdk.js +3 -3
  11. package/dist/cjs/__fixtures__/asset/index.js +5 -5
  12. package/dist/cjs/__fixtures__/entry/index.js +3 -3
  13. package/dist/cjs/__fixtures__/fixtures.js +3 -1
  14. package/dist/cjs/dialogs/HypelinkDialog/HyperlinkDialog.js +17 -15
  15. package/dist/cjs/dialogs/openRichTextDialog.js +4 -2
  16. package/dist/cjs/dialogs/renderRichTextDialog.js +3 -1
  17. package/dist/cjs/helpers/__tests__/removeInternalMarks.test.js +1 -1
  18. package/dist/cjs/helpers/editor.js +42 -42
  19. package/dist/cjs/helpers/environment.js +3 -3
  20. package/dist/cjs/helpers/formatDateAndTime.js +3 -3
  21. package/dist/cjs/helpers/nodeFactory.js +6 -6
  22. package/dist/cjs/helpers/sdkNavigatorSlideIn.js +1 -1
  23. package/dist/cjs/helpers/transformers.js +5 -5
  24. package/dist/cjs/helpers/validations.js +5 -5
  25. package/dist/cjs/index.js +6 -4
  26. package/dist/cjs/internal/constants.js +3 -1
  27. package/dist/cjs/internal/hooks.js +7 -5
  28. package/dist/cjs/internal/misc.js +12 -10
  29. package/dist/cjs/internal/queries.js +107 -105
  30. package/dist/cjs/internal/transforms.js +49 -47
  31. package/dist/cjs/plugins/Break/createExitBreakPlugin.test.js +1 -1
  32. package/dist/cjs/plugins/Break/createSoftBreakPlugin.test.js +1 -1
  33. package/dist/cjs/plugins/CommandPalette/components/CommandList.js +9 -7
  34. package/dist/cjs/plugins/CommandPalette/components/CommandPrompt.js +3 -1
  35. package/dist/cjs/plugins/CommandPalette/hooks/useCommandList.js +3 -1
  36. package/dist/cjs/plugins/CommandPalette/onKeyDown.spec.js +5 -3
  37. package/dist/cjs/plugins/CommandPalette/useCommands.js +2 -2
  38. package/dist/cjs/plugins/DragAndDrop/index.js +4 -1
  39. package/dist/cjs/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +6 -4
  40. package/dist/cjs/plugins/EmbeddedEntityBlock/index.js +3 -3
  41. package/dist/cjs/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +7 -5
  42. package/dist/cjs/plugins/EmbeddedEntityInline/LinkedEntityInline.js +6 -4
  43. package/dist/cjs/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +2 -2
  44. package/dist/cjs/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +7 -5
  45. package/dist/cjs/plugins/EmbeddedResourceInline/LinkedResourceInline.js +2 -2
  46. package/dist/cjs/plugins/Heading/components/Heading.js +3 -1
  47. package/dist/cjs/plugins/Heading/components/ToolbarHeadingButton.js +3 -1
  48. package/dist/cjs/plugins/Heading/createHeadingPlugin.js +1 -1
  49. package/dist/cjs/plugins/Hr/index.js +8 -6
  50. package/dist/cjs/plugins/Hyperlink/HyperlinkModal.js +7 -5
  51. package/dist/cjs/plugins/Hyperlink/components/EntityHyperlink.js +6 -4
  52. package/dist/cjs/plugins/Hyperlink/components/LinkPopover.js +4 -2
  53. package/dist/cjs/plugins/Hyperlink/components/ResourceHyperlink.js +6 -4
  54. package/dist/cjs/plugins/Hyperlink/components/ToolbarHyperlinkButton.js +3 -1
  55. package/dist/cjs/plugins/Hyperlink/components/UrlHyperlink.js +4 -2
  56. package/dist/cjs/plugins/Hyperlink/components/linkHandlers.js +3 -3
  57. package/dist/cjs/plugins/Hyperlink/createHyperlinkPlugin.js +4 -2
  58. package/dist/cjs/plugins/Hyperlink/useEntityInfo.js +3 -3
  59. package/dist/cjs/plugins/Hyperlink/useResourceEntityInfo.js +5 -3
  60. package/dist/cjs/plugins/Hyperlink/utils.js +4 -4
  61. package/dist/cjs/plugins/List/__tests__/insertListBreak.test.js +1 -1
  62. package/dist/cjs/plugins/List/__tests__/insertListFragment.test.js +1 -1
  63. package/dist/cjs/plugins/List/components/List.js +6 -4
  64. package/dist/cjs/plugins/List/components/ListItem.js +3 -1
  65. package/dist/cjs/plugins/List/components/ToolbarListButton.js +3 -1
  66. package/dist/cjs/plugins/List/insertListBreak.js +2 -2
  67. package/dist/cjs/plugins/List/insertListFragment.js +1 -1
  68. package/dist/cjs/plugins/List/onKeyDownList.js +1 -1
  69. package/dist/cjs/plugins/List/transforms/moveListItemDown.js +1 -1
  70. package/dist/cjs/plugins/List/transforms/moveListItems.js +1 -1
  71. package/dist/cjs/plugins/List/transforms/moveListItems.test.js +1 -1
  72. package/dist/cjs/plugins/List/transforms/toggleList.js +3 -3
  73. package/dist/cjs/plugins/List/transforms/toggleList.spec.js +9 -9
  74. package/dist/cjs/plugins/List/transforms/unwrapList.js +1 -1
  75. package/dist/cjs/plugins/List/utils.js +11 -11
  76. package/dist/cjs/plugins/List/withList.js +1 -1
  77. package/dist/cjs/plugins/Marks/Bold.js +6 -4
  78. package/dist/cjs/plugins/Marks/Code.js +6 -4
  79. package/dist/cjs/plugins/Marks/Italic.js +6 -4
  80. package/dist/cjs/plugins/Marks/Subscript.js +7 -5
  81. package/dist/cjs/plugins/Marks/Superscript.js +7 -5
  82. package/dist/cjs/plugins/Marks/Underline.js +3 -1
  83. package/dist/cjs/plugins/Marks/components/MarkToolbarButton.js +5 -3
  84. package/dist/cjs/plugins/Marks/helpers.js +4 -4
  85. package/dist/cjs/plugins/Normalizer/createNormalizerPlugin.test.js +3 -3
  86. package/dist/cjs/plugins/Normalizer/utils.js +3 -3
  87. package/dist/cjs/plugins/Normalizer/withNormalizer.js +2 -2
  88. package/dist/cjs/plugins/Paragraph/Paragraph.js +3 -1
  89. package/dist/cjs/plugins/Paragraph/createParagraphPlugin.js +1 -1
  90. package/dist/cjs/plugins/PasteHTML/createPasteHTMLPlugin.js +5 -5
  91. package/dist/cjs/plugins/Quote/components/Quote.js +3 -1
  92. package/dist/cjs/plugins/Quote/components/ToolbarQuoteButton.js +3 -1
  93. package/dist/cjs/plugins/Quote/toggleQuote.js +4 -4
  94. package/dist/cjs/plugins/Quote/withQuote.js +2 -2
  95. package/dist/cjs/plugins/Table/__tests__/helpers.test.js +1 -1
  96. package/dist/cjs/plugins/Table/actions/addColumn.js +4 -4
  97. package/dist/cjs/plugins/Table/actions/addRow.js +3 -3
  98. package/dist/cjs/plugins/Table/components/Cell.js +3 -1
  99. package/dist/cjs/plugins/Table/components/HeaderCell.js +3 -1
  100. package/dist/cjs/plugins/Table/components/Row.js +3 -1
  101. package/dist/cjs/plugins/Table/components/Table.js +3 -1
  102. package/dist/cjs/plugins/Table/components/TableActions.js +6 -4
  103. package/dist/cjs/plugins/Table/components/ToolbarButton.js +3 -1
  104. package/dist/cjs/plugins/Table/createTablePlugin.js +1 -1
  105. package/dist/cjs/plugins/Table/helpers.js +12 -12
  106. package/dist/cjs/plugins/Table/insertTableFragment.js +1 -1
  107. package/dist/cjs/plugins/Table/onKeyDownTable.js +2 -2
  108. package/dist/cjs/plugins/Table/tableTracking.js +6 -6
  109. package/dist/cjs/plugins/Text/__tests__/createTextPlugin.test.js +2 -2
  110. package/dist/cjs/plugins/Text/createTextPlugin.js +3 -3
  111. package/dist/cjs/plugins/Tracking/createTrackingPlugin.js +4 -4
  112. package/dist/cjs/plugins/Tracking/utils.js +3 -1
  113. package/dist/cjs/plugins/index.js +3 -3
  114. package/dist/cjs/plugins/shared/EmbeddedBlockToolbarIcon.js +7 -5
  115. package/dist/cjs/plugins/shared/EmbeddedBlockUtil.js +5 -5
  116. package/dist/cjs/plugins/shared/EmbeddedInlineToolbarIcon.js +4 -2
  117. package/dist/cjs/plugins/shared/EmbeddedInlineUtil.js +4 -4
  118. package/dist/cjs/plugins/shared/FetchingWrappedAssetCard.js +6 -4
  119. package/dist/cjs/plugins/shared/FetchingWrappedEntryCard.js +7 -5
  120. package/dist/cjs/plugins/shared/FetchingWrappedResourceCard.js +6 -4
  121. package/dist/cjs/plugins/shared/LinkedBlockWrapper.js +1 -1
  122. package/dist/cjs/plugins/shared/LinkedInlineWrapper.js +4 -2
  123. package/dist/cjs/plugins/shared/ResourceNewBadge.js +3 -1
  124. package/dist/cjs/plugins/shared/ToolbarButton.js +4 -2
  125. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +4 -2
  126. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +4 -2
  127. package/dist/cjs/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +9 -7
  128. package/dist/cjs/test-utils/validation.js +3 -3
  129. package/dist/esm/ContentfulEditorProvider.js +1 -1
  130. package/dist/esm/RichTextEditor.js +3 -3
  131. package/dist/esm/SdkProvider.js +1 -1
  132. package/dist/esm/SyncEditorChanges.js +1 -1
  133. package/dist/esm/Toolbar/_tests_/toolbar.test.js +3 -3
  134. package/dist/esm/Toolbar/components/EmbedEntityWidget.js +1 -1
  135. package/dist/esm/Toolbar/components/EmbeddedEntityDropdownButton.js +1 -1
  136. package/dist/esm/Toolbar/components/StickyToolbarWrapper.js +1 -1
  137. package/dist/esm/Toolbar/index.js +2 -2
  138. package/dist/esm/__fixtures__/FakeSdk.js +3 -3
  139. package/dist/esm/dialogs/HypelinkDialog/HyperlinkDialog.js +11 -11
  140. package/dist/esm/dialogs/openRichTextDialog.js +1 -1
  141. package/dist/esm/helpers/__tests__/removeInternalMarks.test.js +1 -1
  142. package/dist/esm/helpers/editor.js +3 -3
  143. package/dist/esm/helpers/sdkNavigatorSlideIn.js +1 -1
  144. package/dist/esm/plugins/Break/createExitBreakPlugin.test.js +1 -1
  145. package/dist/esm/plugins/Break/createSoftBreakPlugin.test.js +1 -1
  146. package/dist/esm/plugins/CommandPalette/components/CommandList.js +6 -6
  147. package/dist/esm/plugins/CommandPalette/onKeyDown.spec.js +2 -2
  148. package/dist/esm/plugins/CommandPalette/useCommands.js +2 -2
  149. package/dist/esm/plugins/DragAndDrop/index.js +4 -1
  150. package/dist/esm/plugins/EmbeddedEntityBlock/LinkedEntityBlock.js +3 -3
  151. package/dist/esm/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.js +4 -4
  152. package/dist/esm/plugins/EmbeddedEntityInline/LinkedEntityInline.js +3 -3
  153. package/dist/esm/plugins/EmbeddedResourceBlock/LinkedResourceBlock.js +2 -2
  154. package/dist/esm/plugins/EmbeddedResourceInline/FetchingWrappedResourceInlineCard.js +4 -4
  155. package/dist/esm/plugins/EmbeddedResourceInline/LinkedResourceInline.js +2 -2
  156. package/dist/esm/plugins/Heading/createHeadingPlugin.js +1 -1
  157. package/dist/esm/plugins/Hyperlink/HyperlinkModal.js +4 -4
  158. package/dist/esm/plugins/Hyperlink/components/EntityHyperlink.js +3 -3
  159. package/dist/esm/plugins/Hyperlink/components/LinkPopover.js +1 -1
  160. package/dist/esm/plugins/Hyperlink/components/ResourceHyperlink.js +3 -3
  161. package/dist/esm/plugins/Hyperlink/components/UrlHyperlink.js +1 -1
  162. package/dist/esm/plugins/Hyperlink/createHyperlinkPlugin.js +1 -1
  163. package/dist/esm/plugins/Hyperlink/useEntityInfo.js +3 -3
  164. package/dist/esm/plugins/Hyperlink/useResourceEntityInfo.js +2 -2
  165. package/dist/esm/plugins/Hyperlink/utils.js +1 -1
  166. package/dist/esm/plugins/List/__tests__/insertListBreak.test.js +1 -1
  167. package/dist/esm/plugins/List/__tests__/insertListFragment.test.js +1 -1
  168. package/dist/esm/plugins/List/insertListBreak.js +2 -2
  169. package/dist/esm/plugins/List/insertListFragment.js +1 -1
  170. package/dist/esm/plugins/List/onKeyDownList.js +1 -1
  171. package/dist/esm/plugins/List/transforms/moveListItemDown.js +1 -1
  172. package/dist/esm/plugins/List/transforms/moveListItems.js +1 -1
  173. package/dist/esm/plugins/List/transforms/moveListItems.test.js +1 -1
  174. package/dist/esm/plugins/List/transforms/toggleList.js +3 -3
  175. package/dist/esm/plugins/List/transforms/toggleList.spec.js +9 -9
  176. package/dist/esm/plugins/List/transforms/unwrapList.js +1 -1
  177. package/dist/esm/plugins/List/utils.js +1 -1
  178. package/dist/esm/plugins/List/withList.js +1 -1
  179. package/dist/esm/plugins/Marks/components/MarkToolbarButton.js +2 -2
  180. package/dist/esm/plugins/Marks/helpers.js +1 -1
  181. package/dist/esm/plugins/Normalizer/createNormalizerPlugin.test.js +3 -3
  182. package/dist/esm/plugins/Normalizer/withNormalizer.js +2 -2
  183. package/dist/esm/plugins/Paragraph/createParagraphPlugin.js +1 -1
  184. package/dist/esm/plugins/PasteHTML/createPasteHTMLPlugin.js +1 -1
  185. package/dist/esm/plugins/Quote/toggleQuote.js +1 -1
  186. package/dist/esm/plugins/Quote/withQuote.js +2 -2
  187. package/dist/esm/plugins/Table/__tests__/helpers.test.js +1 -1
  188. package/dist/esm/plugins/Table/actions/addColumn.js +1 -1
  189. package/dist/esm/plugins/Table/createTablePlugin.js +1 -1
  190. package/dist/esm/plugins/Table/insertTableFragment.js +1 -1
  191. package/dist/esm/plugins/Table/onKeyDownTable.js +2 -2
  192. package/dist/esm/plugins/Table/tableTracking.js +6 -6
  193. package/dist/esm/plugins/Text/__tests__/createTextPlugin.test.js +2 -2
  194. package/dist/esm/plugins/Text/createTextPlugin.js +3 -3
  195. package/dist/esm/plugins/Tracking/createTrackingPlugin.js +1 -1
  196. package/dist/esm/plugins/shared/EmbeddedBlockToolbarIcon.js +1 -1
  197. package/dist/esm/plugins/shared/EmbeddedBlockUtil.js +5 -5
  198. package/dist/esm/plugins/shared/EmbeddedInlineToolbarIcon.js +1 -1
  199. package/dist/esm/plugins/shared/EmbeddedInlineUtil.js +4 -4
  200. package/dist/esm/plugins/shared/FetchingWrappedAssetCard.js +3 -3
  201. package/dist/esm/plugins/shared/FetchingWrappedEntryCard.js +4 -4
  202. package/dist/esm/plugins/shared/FetchingWrappedResourceCard.js +3 -3
  203. package/dist/esm/plugins/shared/LinkedBlockWrapper.js +1 -1
  204. package/dist/esm/plugins/shared/LinkedInlineWrapper.js +1 -1
  205. package/dist/esm/plugins/shared/ToolbarButton.js +1 -1
  206. package/dist/esm/plugins/shared/__tests__/FetchingWrappedAssetCard.test.js +1 -1
  207. package/dist/esm/plugins/shared/__tests__/FetchingWrappedEntryCard.test.js +1 -1
  208. package/dist/esm/plugins/shared/__tests__/FetchingWrappedResourceCard.test.js +6 -6
  209. package/dist/esm/test-utils/validation.js +3 -3
  210. package/package.json +4 -4
@@ -37,7 +37,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
37
37
  if (cache && cache.has(obj)) {
38
38
  return cache.get(obj);
39
39
  }
40
- var newObj = {};
40
+ var newObj = {
41
+ __proto__: null
42
+ };
41
43
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
42
44
  for(var key in obj){
43
45
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -36,7 +36,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
36
36
  if (cache && cache.has(obj)) {
37
37
  return cache.get(obj);
38
38
  }
39
- var newObj = {};
39
+ var newObj = {
40
+ __proto__: null
41
+ };
40
42
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
41
43
  for(var key in obj){
42
44
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- toggleQuote: function() {
13
- return toggleQuote;
14
- },
15
12
  onKeyDownToggleQuote: function() {
16
13
  return onKeyDownToggleQuote;
14
+ },
15
+ toggleQuote: function() {
16
+ return toggleQuote;
17
17
  }
18
18
  });
19
19
  const _richtexttypes = require("@contentful/rich-text-types");
@@ -48,7 +48,7 @@ function toggleQuote(editor, logAction) {
48
48
  });
49
49
  }
50
50
  const onKeyDownToggleQuote = (editor, plugin)=>(event)=>{
51
- const { hotkey } = plugin.options;
51
+ const { hotkey } = plugin.options;
52
52
  if (hotkey && (0, _ishotkey.default)(hotkey, event)) {
53
53
  event.preventDefault();
54
54
  toggleQuote(editor, editor.tracking.onShortcutAction);
@@ -13,7 +13,7 @@ const _slate = require("slate");
13
13
  const _queries = require("../../internal/queries");
14
14
  const _transforms = require("../../internal/transforms");
15
15
  const withQuote = (editor)=>{
16
- const { insertFragment } = editor;
16
+ const { insertFragment } = editor;
17
17
  editor.insertFragment = (fragment)=>{
18
18
  const startingNode = fragment.length && fragment[0];
19
19
  const startsWithBlockquote = _slate.Element.isElement(startingNode) && startingNode.type === _richtexttypes.BLOCKS.QUOTE;
@@ -24,7 +24,7 @@ const withQuote = (editor)=>{
24
24
  });
25
25
  const containerIsNotEmpty = containerEntry && (0, _queries.getText)(editor, containerEntry[1]) !== '';
26
26
  if (startsWithBlockquote && containerIsNotEmpty) {
27
- const { selection } = editor;
27
+ const { selection } = editor;
28
28
  const isContentSelected = (selection)=>!!selection && _slate.Point.compare(selection.anchor, selection.focus) !== 0;
29
29
  if (isContentSelected(selection)) {
30
30
  (0, _transforms.deleteText)(editor, {
@@ -6,7 +6,7 @@ const _testutils = require("../../../test-utils");
6
6
  const _helpers = require("../helpers");
7
7
  test('insertTableAndFocusFirstCell', ()=>{
8
8
  const input = (0, _testutils.jsx)("editor", null, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null), (0, _testutils.jsx)("cursor", null)), (0, _testutils.jsx)("hp", null));
9
- const { editor } = (0, _testutils.createTestEditor)({
9
+ const { editor } = (0, _testutils.createTestEditor)({
10
10
  input
11
11
  });
12
12
  (0, _helpers.insertTableAndFocusFirstCell)(editor);
@@ -9,18 +9,18 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- addColumnRight: function() {
13
- return addColumnRight;
14
- },
15
12
  addColumnLeft: function() {
16
13
  return addColumnLeft;
14
+ },
15
+ addColumnRight: function() {
16
+ return addColumnRight;
17
17
  }
18
18
  });
19
19
  const _richtexttypes = require("@contentful/rich-text-types");
20
20
  const _platetable = require("@udecode/plate-table");
21
21
  const _queries = require("../../../internal/queries");
22
22
  const _transforms = require("../../../internal/transforms");
23
- const addColumn = (editor, { header }, getNextCellPath)=>{
23
+ const addColumn = (editor, { header }, getNextCellPath)=>{
24
24
  if ((0, _queries.someNode)(editor, {
25
25
  match: {
26
26
  type: _richtexttypes.BLOCKS.TABLE
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- addRowBelow: function() {
13
- return addRowBelow;
14
- },
15
12
  addRowAbove: function() {
16
13
  return addRowAbove;
14
+ },
15
+ addRowBelow: function() {
16
+ return addRowBelow;
17
17
  }
18
18
  });
19
19
  const _richtexttypes = require("@contentful/rich-text-types");
@@ -39,7 +39,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
39
39
  if (cache && cache.has(obj)) {
40
40
  return cache.get(obj);
41
41
  }
42
- var newObj = {};
42
+ var newObj = {
43
+ __proto__: null
44
+ };
43
45
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
44
46
  for(var key in obj){
45
47
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -39,7 +39,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
39
39
  if (cache && cache.has(obj)) {
40
40
  return cache.get(obj);
41
41
  }
42
- var newObj = {};
42
+ var newObj = {
43
+ __proto__: null
44
+ };
43
45
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
44
46
  for(var key in obj){
45
47
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -37,7 +37,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
37
37
  if (cache && cache.has(obj)) {
38
38
  return cache.get(obj);
39
39
  }
40
- var newObj = {};
40
+ var newObj = {
41
+ __proto__: null
42
+ };
41
43
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
42
44
  for(var key in obj){
43
45
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -38,7 +38,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
38
38
  if (cache && cache.has(obj)) {
39
39
  return cache.get(obj);
40
40
  }
41
- var newObj = {};
41
+ var newObj = {
42
+ __proto__: null
43
+ };
42
44
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
43
45
  for(var key in obj){
44
46
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- styles: function() {
13
- return styles;
14
- },
15
12
  TableActions: function() {
16
13
  return TableActions;
14
+ },
15
+ styles: function() {
16
+ return styles;
17
17
  }
18
18
  });
19
19
  const _react = _interop_require_wildcard(require("react"));
@@ -50,7 +50,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
50
50
  if (cache && cache.has(obj)) {
51
51
  return cache.get(obj);
52
52
  }
53
- var newObj = {};
53
+ var newObj = {
54
+ __proto__: null
55
+ };
54
56
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
55
57
  for(var key in obj){
56
58
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -35,7 +35,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
35
35
  if (cache && cache.has(obj)) {
36
36
  return cache.get(obj);
37
37
  }
38
- var newObj = {};
38
+ var newObj = {
39
+ __proto__: null
40
+ };
39
41
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
40
42
  for(var key in obj){
41
43
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -28,7 +28,7 @@ const createTablePlugin = ()=>(0, _platetable.createTablePlugin)({
28
28
  onKeyDown: _onKeyDownTable.onKeyDownTable
29
29
  },
30
30
  withOverrides: (editor, plugin)=>{
31
- const { normalizeNode } = editor;
31
+ const { normalizeNode } = editor;
32
32
  (0, _platetable.withTable)(editor, plugin);
33
33
  editor.normalizeNode = normalizeNode;
34
34
  (0, _tableTracking.addTableTrackingEvents)(editor);
@@ -9,9 +9,21 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
+ createEmptyTableCells: function() {
13
+ return createEmptyTableCells;
14
+ },
15
+ getNoOfMissingTableCellsInRow: function() {
16
+ return getNoOfMissingTableCellsInRow;
17
+ },
12
18
  insertTableAndFocusFirstCell: function() {
13
19
  return insertTableAndFocusFirstCell;
14
20
  },
21
+ isNotEmpty: function() {
22
+ return isNotEmpty;
23
+ },
24
+ isTable: function() {
25
+ return isTable;
26
+ },
15
27
  isTableActive: function() {
16
28
  return isTableActive;
17
29
  },
@@ -20,18 +32,6 @@ _export(exports, {
20
32
  },
21
33
  replaceEmptyParagraphWithTable: function() {
22
34
  return replaceEmptyParagraphWithTable;
23
- },
24
- getNoOfMissingTableCellsInRow: function() {
25
- return getNoOfMissingTableCellsInRow;
26
- },
27
- createEmptyTableCells: function() {
28
- return createEmptyTableCells;
29
- },
30
- isNotEmpty: function() {
31
- return isNotEmpty;
32
- },
33
- isTable: function() {
34
- return isTable;
35
35
  }
36
36
  });
37
37
  const _richtexttypes = require("@contentful/rich-text-types");
@@ -33,7 +33,7 @@ const trimUnnecessaryTableWrapper = (node)=>{
33
33
  return cell.children;
34
34
  };
35
35
  const insertTableFragment = (editor)=>{
36
- const { insertFragment } = editor;
36
+ const { insertFragment } = editor;
37
37
  return (fragments)=>{
38
38
  if (!editor.selection) {
39
39
  return;
@@ -43,7 +43,7 @@ const onKeyDownTable = (editor, plugin)=>{
43
43
  if (event.key === 'Backspace') {
44
44
  const entry = (0, _platetable.getTableEntries)(editor, {});
45
45
  if (entry) {
46
- const { table , row , cell } = entry;
46
+ const { table, row, cell } = entry;
47
47
  const cellText = (0, _queries.getText)(editor, cell[1]);
48
48
  const isFirstCell = (0, _queries.isFirstChild)(row[1]);
49
49
  const isFirstRow = (0, _queries.isFirstChild)(table[1]);
@@ -58,7 +58,7 @@ const onKeyDownTable = (editor, plugin)=>{
58
58
  event.preventDefault();
59
59
  const entry = (0, _platetable.getTableEntries)(editor, {});
60
60
  if (entry) {
61
- const { table , row , cell } = entry;
61
+ const { table, row, cell } = entry;
62
62
  const isLastCell = (0, _queries.isLastChildPath)(row, cell[1]);
63
63
  const isLastRow = (0, _queries.isLastChildPath)(table, row[1]);
64
64
  if (isLastRow && isLastCell) {
@@ -20,22 +20,22 @@ const _richtexttypes = require("@contentful/rich-text-types");
20
20
  const _queries = require("../../internal/queries");
21
21
  const _Tracking = require("../../plugins/Tracking");
22
22
  function hasTables(nodes) {
23
- return nodes.some(({ type })=>{
23
+ return nodes.some(({ type })=>{
24
24
  return type === _richtexttypes.BLOCKS.TABLE;
25
25
  });
26
26
  }
27
- const isTableHeaderCell = ({ type })=>type === _richtexttypes.BLOCKS.TABLE_HEADER_CELL;
27
+ const isTableHeaderCell = ({ type })=>type === _richtexttypes.BLOCKS.TABLE_HEADER_CELL;
28
28
  function hasHeadersOutsideFirstRow(nodes) {
29
- return nodes.filter(({ type })=>type === _richtexttypes.BLOCKS.TABLE).flatMap(({ children })=>children.slice(1)).some(({ children })=>children.some(isTableHeaderCell));
29
+ return nodes.filter(({ type })=>type === _richtexttypes.BLOCKS.TABLE).flatMap(({ children })=>children.slice(1)).some(({ children })=>children.some(isTableHeaderCell));
30
30
  }
31
31
  function addTableTrackingEvents(editor) {
32
- const { insertData } = editor;
32
+ const { insertData } = editor;
33
33
  editor.insertData = (data)=>{
34
34
  const html = data.getData('text/html');
35
35
  if (html) {
36
- const { children: markupBefore } = editor;
36
+ const { children: markupBefore } = editor;
37
37
  insertData(data);
38
- const { children: markupAfter } = editor;
38
+ const { children: markupAfter } = editor;
39
39
  setTimeout(()=>{
40
40
  if (hasTables(markupBefore)) return;
41
41
  if (hasTables(markupAfter)) {
@@ -19,7 +19,7 @@ describe('delete backward', ()=>{
19
19
  const render = (children)=>(0, _testutils.jsx)("editor", null, children, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)));
20
20
  for (const t of tests){
21
21
  test(t.title, ()=>{
22
- const { editor } = (0, _testutils.createTestEditor)({
22
+ const { editor } = (0, _testutils.createTestEditor)({
23
23
  input: render(t.input)
24
24
  });
25
25
  editor.deleteBackward('character');
@@ -56,7 +56,7 @@ describe('delete forward', ()=>{
56
56
  const render = (children)=>(0, _testutils.jsx)("editor", null, children, (0, _testutils.jsx)("hp", null, (0, _testutils.jsx)("htext", null)));
57
57
  for (const t of tests){
58
58
  test(t.title, ()=>{
59
- const { editor } = (0, _testutils.createTestEditor)({
59
+ const { editor } = (0, _testutils.createTestEditor)({
60
60
  input: render(t.input)
61
61
  });
62
62
  editor.deleteForward('character');
@@ -23,9 +23,9 @@ function createTextPlugin(restrictedMarks = []) {
23
23
  }
24
24
  },
25
25
  withOverrides: (editor)=>{
26
- const { insertText } = editor;
26
+ const { insertText } = editor;
27
27
  editor.insertText = (text)=>{
28
- const { selection } = editor;
28
+ const { selection } = editor;
29
29
  if (selection && (0, _queries.isRangeCollapsed)(selection)) {
30
30
  const inlinePath = (0, _queries.getAboveNode)(editor, {
31
31
  match: (n)=>(0, _queries.isInline)(editor, n),
@@ -41,7 +41,7 @@ function createTextPlugin(restrictedMarks = []) {
41
41
  }
42
42
  return insertText(text);
43
43
  };
44
- const { deleteForward , deleteBackward } = editor;
44
+ const { deleteForward, deleteBackward } = editor;
45
45
  editor.deleteBackward = (unit)=>{
46
46
  deleteEmptyParagraph(unit, editor, deleteBackward);
47
47
  };
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getPastingSource: function() {
13
- return getPastingSource;
14
- },
15
12
  createTrackingPlugin: function() {
16
13
  return createTrackingPlugin;
14
+ },
15
+ getPastingSource: function() {
16
+ return getPastingSource;
17
17
  }
18
18
  });
19
19
  const _utils = require("./utils");
@@ -76,7 +76,7 @@ const createTrackingPlugin = (onAction)=>{
76
76
  return {
77
77
  key: 'TrackingPlugin',
78
78
  withOverrides: (editor)=>{
79
- const { insertData } = editor;
79
+ const { insertData } = editor;
80
80
  editor.tracking = trackingActions;
81
81
  editor.insertData = (data)=>{
82
82
  const isCopyAndPaste = data.types.length !== 0;
@@ -37,7 +37,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
37
37
  if (cache && cache.has(obj)) {
38
38
  return cache.get(obj);
39
39
  }
40
- var newObj = {};
40
+ var newObj = {
41
+ __proto__: null
42
+ };
41
43
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
42
44
  for(var key in obj){
43
45
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getPlugins: function() {
13
- return getPlugins;
14
- },
15
12
  disableCorePlugins: function() {
16
13
  return disableCorePlugins;
14
+ },
15
+ getPlugins: function() {
16
+ return getPlugins;
17
17
  }
18
18
  });
19
19
  const _plateserializerdocx = require("@udecode/plate-serializer-docx");
@@ -9,11 +9,11 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- styles: function() {
13
- return styles;
14
- },
15
12
  EmbeddedBlockToolbarIcon: function() {
16
13
  return EmbeddedBlockToolbarIcon;
14
+ },
15
+ styles: function() {
16
+ return styles;
17
17
  }
18
18
  });
19
19
  const _react = _interop_require_wildcard(require("react"));
@@ -46,7 +46,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
46
46
  if (cache && cache.has(obj)) {
47
47
  return cache.get(obj);
48
48
  }
49
- var newObj = {};
49
+ var newObj = {
50
+ __proto__: null
51
+ };
50
52
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
51
53
  for(var key in obj){
52
54
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -69,7 +71,7 @@ const styles = {
69
71
  marginRight: '10px'
70
72
  })
71
73
  };
72
- function EmbeddedBlockToolbarIcon({ isDisabled , nodeType , onClose }) {
74
+ function EmbeddedBlockToolbarIcon({ isDisabled, nodeType, onClose }) {
73
75
  const editor = (0, _ContentfulEditorProvider.useContentfulEditor)();
74
76
  const sdk = (0, _SdkProvider.useSdkContext)();
75
77
  const handleClick = async (event)=>{
@@ -31,7 +31,7 @@ function _interop_require_default(obj) {
31
31
  };
32
32
  }
33
33
  function getWithEmbeddedBlockEvents(nodeType, sdk) {
34
- return (editor, { options: { hotkey } })=>(event)=>{
34
+ return (editor, { options: { hotkey } })=>(event)=>{
35
35
  const [, pathToSelectedElement] = (0, _editor.getNodeEntryFromSelection)(editor, nodeType);
36
36
  if (pathToSelectedElement) {
37
37
  const isDelete = event.key === 'Delete';
@@ -57,14 +57,14 @@ async function selectEntityAndInsert(nodeType, sdk, editor, logAction) {
57
57
  logAction('openCreateEmbedDialog', {
58
58
  nodeType
59
59
  });
60
- const { field , dialogs } = sdk;
60
+ const { field, dialogs } = sdk;
61
61
  const baseConfig = (0, _config.newEntitySelectorConfigFromRichTextField)(field, nodeType);
62
62
  const selectEntity = baseConfig.entityType === 'Asset' ? dialogs.selectSingleAsset : dialogs.selectSingleEntry;
63
63
  const config = {
64
64
  ...baseConfig,
65
65
  withCreate: true
66
66
  };
67
- const { selection } = editor;
67
+ const { selection } = editor;
68
68
  const rteSlide = (0, _sdkNavigatorSlideIn.watchCurrentSlide)(sdk.navigator);
69
69
  const entity = await selectEntity(config);
70
70
  if (!entity) {
@@ -91,9 +91,9 @@ async function selectResourceEntityAndInsert(sdk, editor, logAction) {
91
91
  logAction('openCreateEmbedDialog', {
92
92
  nodeType: _richtexttypes.BLOCKS.EMBEDDED_RESOURCE
93
93
  });
94
- const { field , dialogs } = sdk;
94
+ const { field, dialogs } = sdk;
95
95
  const config = (0, _config.newResourceEntitySelectorConfigFromRichTextField)(field, _richtexttypes.BLOCKS.EMBEDDED_RESOURCE);
96
- const { selection } = editor;
96
+ const { selection } = editor;
97
97
  const entity = await dialogs.selectSingleResourceEntry(config);
98
98
  if (!entity) {
99
99
  logAction('cancelCreateEmbedDialog', {
@@ -45,7 +45,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
45
45
  if (cache && cache.has(obj)) {
46
46
  return cache.get(obj);
47
47
  }
48
- var newObj = {};
48
+ var newObj = {
49
+ __proto__: null
50
+ };
49
51
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
50
52
  for(var key in obj){
51
53
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -76,7 +78,7 @@ const styles = {
76
78
  }
77
79
  })
78
80
  };
79
- function EmbeddedInlineToolbarIcon({ onClose , nodeType , isDisabled }) {
81
+ function EmbeddedInlineToolbarIcon({ onClose, nodeType, isDisabled }) {
80
82
  const editor = (0, _ContentfulEditorProvider.useContentfulEditor)();
81
83
  const sdk = (0, _SdkProvider.useSdkContext)();
82
84
  async function handleClick(event) {
@@ -31,7 +31,7 @@ function _interop_require_default(obj) {
31
31
  };
32
32
  }
33
33
  function getWithEmbeddedEntryInlineEvents(nodeType, sdk) {
34
- return function withEmbeddedEntryInlineEvents(editor, { options: { hotkey } }) {
34
+ return function withEmbeddedEntryInlineEvents(editor, { options: { hotkey } }) {
35
35
  return function handleEvent(event) {
36
36
  if (!editor) return;
37
37
  if (hotkey && (0, _ishotkey.default)(hotkey, event)) {
@@ -82,7 +82,7 @@ async function selectEntityAndInsert(editor, sdk, logAction) {
82
82
  ...(0, _config.newEntitySelectorConfigFromRichTextField)(sdk.field, nodeType),
83
83
  withCreate: true
84
84
  };
85
- const { selection } = editor;
85
+ const { selection } = editor;
86
86
  const rteSlide = (0, _sdkNavigatorSlideIn.watchCurrentSlide)(sdk.navigator);
87
87
  const entry = await sdk.dialogs.selectSingleEntry(config);
88
88
  if (!entry) {
@@ -106,12 +106,12 @@ async function selectResourceEntityAndInsert(editor, sdk, logAction) {
106
106
  logAction('openCreateEmbedDialog', {
107
107
  nodeType
108
108
  });
109
- const { dialogs , field } = sdk;
109
+ const { dialogs, field } = sdk;
110
110
  const config = {
111
111
  ...(0, _config.newResourceEntitySelectorConfigFromRichTextField)(field, nodeType),
112
112
  withCreate: true
113
113
  };
114
- const { selection } = editor;
114
+ const { selection } = editor;
115
115
  const entry = await dialogs.selectSingleResourceEntry(config);
116
116
  if (!entry) {
117
117
  logAction('cancelCreateEmbedDialog', {
@@ -38,7 +38,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
38
38
  if (cache && cache.has(obj)) {
39
39
  return cache.get(obj);
40
40
  }
41
- var newObj = {};
41
+ var newObj = {
42
+ __proto__: null
43
+ };
42
44
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
43
45
  for(var key in obj){
44
46
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -85,9 +87,9 @@ const InternalAssetCard = _react.memo((props)=>{
85
87
  }, _fastdeepequal.default);
86
88
  InternalAssetCard.displayName = 'InternalAssetCard';
87
89
  function FetchingWrappedAssetCard(props) {
88
- const { onEntityFetchComplete } = props;
89
- const { data: asset , status } = (0, _fieldeditorreference.useEntity)('Asset', props.assetId);
90
- const { getEntityScheduledActions } = (0, _fieldeditorreference.useEntityLoader)();
90
+ const { onEntityFetchComplete } = props;
91
+ const { data: asset, status } = (0, _fieldeditorreference.useEntity)('Asset', props.assetId);
92
+ const { getEntityScheduledActions } = (0, _fieldeditorreference.useEntityLoader)();
91
93
  const loadEntityScheduledActions = _react.useCallback(()=>getEntityScheduledActions('Asset', props.assetId), [
92
94
  getEntityScheduledActions,
93
95
  props.assetId
@@ -38,7 +38,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
38
38
  if (cache && cache.has(obj)) {
39
39
  return cache.get(obj);
40
40
  }
41
- var newObj = {};
41
+ var newObj = {
42
+ __proto__: null
43
+ };
42
44
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
43
45
  for(var key in obj){
44
46
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -57,7 +59,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
57
59
  return newObj;
58
60
  }
59
61
  const InternalEntryCard = _react.memo((props)=>{
60
- const { entry , sdk , loadEntityScheduledActions } = props;
62
+ const { entry, sdk, loadEntityScheduledActions } = props;
61
63
  if (entry === undefined) {
62
64
  return _react.createElement(_f36components.EntryCard, {
63
65
  isLoading: true
@@ -88,9 +90,9 @@ const InternalEntryCard = _react.memo((props)=>{
88
90
  }, _fastdeepequal.default);
89
91
  InternalEntryCard.displayName = 'ReferenceCard';
90
92
  const FetchingWrappedEntryCard = (props)=>{
91
- const { entryId , onEntityFetchComplete } = props;
92
- const { data: entry , status } = (0, _fieldeditorreference.useEntity)('Entry', entryId);
93
- const { getEntityScheduledActions } = (0, _fieldeditorreference.useEntityLoader)();
93
+ const { entryId, onEntityFetchComplete } = props;
94
+ const { data: entry, status } = (0, _fieldeditorreference.useEntity)('Entry', entryId);
95
+ const { getEntityScheduledActions } = (0, _fieldeditorreference.useEntityLoader)();
94
96
  const loadEntityScheduledActions = _react.useCallback(()=>getEntityScheduledActions('Entry', entryId), [
95
97
  getEntityScheduledActions,
96
98
  entryId
@@ -38,7 +38,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
38
38
  if (cache && cache.has(obj)) {
39
39
  return cache.get(obj);
40
40
  }
41
- var newObj = {};
41
+ var newObj = {
42
+ __proto__: null
43
+ };
42
44
  var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
43
45
  for(var key in obj){
44
46
  if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -62,7 +64,7 @@ const InternalEntryCard = _react.memo((props)=>{
62
64
  isLoading: true
63
65
  });
64
66
  }
65
- const { contentType , resource: entry , space } = props.data;
67
+ const { contentType, resource: entry, space } = props.data;
66
68
  return _react.createElement(_fieldeditorreference.WrappedEntryCard, {
67
69
  size: "default",
68
70
  getAsset: ()=>Promise.resolve(),
@@ -81,8 +83,8 @@ const InternalEntryCard = _react.memo((props)=>{
81
83
  }, _fastdeepequal.default);
82
84
  InternalEntryCard.displayName = 'ReferenceCard';
83
85
  const FetchingWrappedResourceCard = (props)=>{
84
- const { link , onEntityFetchComplete } = props;
85
- const { data , status , error } = (0, _fieldeditorreference.useResource)(link.linkType, link.urn);
86
+ const { link, onEntityFetchComplete } = props;
87
+ const { data, status, error } = (0, _fieldeditorreference.useResource)(link.linkType, link.urn);
86
88
  _react.useEffect(()=>{
87
89
  if (status === 'success') {
88
90
  onEntityFetchComplete?.();
@@ -28,7 +28,7 @@ const styles = {
28
28
  width: '100%'
29
29
  })
30
30
  };
31
- function LinkedBlockWrapper({ attributes , card , children , link }) {
31
+ function LinkedBlockWrapper({ attributes, card, children, link }) {
32
32
  return _react.default.createElement("div", {
33
33
  ...attributes,
34
34
  className: styles.root,