@contentful/field-editor-rich-text 3.4.15 → 3.4.17

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.
@@ -6257,12 +6257,10 @@ var sanitizeHTML = function sanitizeHTML(html) {
6257
6257
 
6258
6258
  if (doc.querySelector('table')) {
6259
6259
  // remove div container from tables
6260
- // capture groups explained:
6261
- // 1. and 3. every content/linebreaks before and after the div container
6262
- // 2. the table inside the container, including content and linebreaks
6263
6260
  // The div container including attributes and possible linebreaks inside wil be removed
6264
6261
  replacers.unshift(function (innerHtml) {
6265
- return innerHtml.replace(/(.*\s)?<div.*>\s*(<table(?:.|\s)*<\/table>)\s*<\/div>(.*\s)?/g, '$1$2$3');
6262
+ var result = innerHtml.replace(/<div[^>]*>\s*(<table(?:.|\s)*<\/table>)\s*<\/div>/g, '$1');
6263
+ return result;
6266
6264
  });
6267
6265
  }
6268
6266
 
@@ -7176,6 +7174,7 @@ var actionOrigin = {
7176
7174
  TOOLBAR: 'toolbar-icon',
7177
7175
  SHORTCUT: 'shortcut',
7178
7176
  VIEWPORT: 'viewport-interaction',
7177
+ SHORTCUT_OR_VIEWPORT: 'shortcut-or-viewport',
7179
7178
  COMMAND_PALETTE: 'command-palette'
7180
7179
  };
7181
7180
  function getPastingSource(data) {
@@ -7233,6 +7232,15 @@ var createTrackingPlugin = function createTrackingPlugin(onAction) {
7233
7232
  origin: actionOrigin.SHORTCUT
7234
7233
  }, data));
7235
7234
  },
7235
+ onShortcutOrViewportAction: function onShortcutOrViewportAction(actionName, data) {
7236
+ if (data === void 0) {
7237
+ data = {};
7238
+ }
7239
+
7240
+ return onAction(actionName, _extends({
7241
+ origin: actionOrigin.SHORTCUT_OR_VIEWPORT
7242
+ }, data));
7243
+ },
7236
7244
  onToolbarAction: function onToolbarAction(actionName, data) {
7237
7245
  if (data === void 0) {
7238
7246
  data = {};
@@ -7268,7 +7276,7 @@ var createTrackingPlugin = function createTrackingPlugin(onAction) {
7268
7276
  var characterCountBefore = getCharacterCount(editor);
7269
7277
  setTimeout(function () {
7270
7278
  var characterCountAfter = getCharacterCount(editor);
7271
- trackingActions.onShortcutAction('paste', {
7279
+ trackingActions.onShortcutOrViewportAction('paste', {
7272
7280
  characterCountAfter: characterCountAfter,
7273
7281
  characterCountBefore: characterCountBefore,
7274
7282
  characterCountSelection: characterCountSelection,