@contentful/field-editor-rich-text 2.3.20 → 3.0.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.
@@ -1,5 +1,5 @@
1
- import React__default, { createContext, useContext, useMemo, useState, useEffect, useRef, createElement, Fragment, useCallback, useLayoutEffect, memo } from 'react';
2
- import { useEntities, MissingEntityCard, WrappedAssetCard, WrappedEntryCard, ScheduledIconWithTooltip, EntityProvider, getScheduleTooltipContent } from '@contentful/field-editor-reference';
1
+ import React__default, { createContext, useContext, useMemo, useState, useEffect, useRef, createElement, Fragment, memo, useCallback } from 'react';
2
+ import { MissingEntityCard, WrappedAssetCard, useEntity, useEntityLoader, WrappedEntryCard, ScheduledIconWithTooltip, EntityProvider, getScheduleTooltipContent } from '@contentful/field-editor-reference';
3
3
  import { entityHelpers, ModalDialogLauncher, FieldConnector } from '@contentful/field-editor-shared';
4
4
  import { BLOCKS, INLINES, TEXT_CONTAINERS, HEADINGS, LIST_ITEM_BLOCKS, MARKS, CONTAINERS, TOP_LEVEL_BLOCKS, VOID_BLOCKS, EMPTY_DOCUMENT } from '@contentful/rich-text-types';
5
5
  import { usePlateEditorRef, usePlateEditorState, toggleNodeType, getText, getAbove, removeMark, setMarks, isMarkActive, getNodes, setNodes, isAncestorEmpty, match, getLastChildPath, wrapNodes, getPluginType, unwrapNodes, isCollapsed, isRangeAcrossBlocks, ELEMENT_DEFAULT, findNode, getParent, getBlockAbove, isSelectionAtBlockStart, isSelectionAtBlockEnd, isFirstChild, insertNodes, moveChildren, isBlockAboveEmpty, mockPlugin, deleteFragment, toggleMark, someHtmlElement, KEY_DESERIALIZE_HTML, hasSingleChild, isLastChild, someNode, getChildren as getChildren$1, queryNode, createDeserializeHtmlPlugin, createDeserializeAstPlugin, createPlateEditor, getPlateSelectors, getPlateActions, Plate } from '@udecode/plate-core';
@@ -1948,7 +1948,7 @@ var CommandList = function CommandList(_ref5) {
1948
1948
  contentEditable: false
1949
1949
  }, /*#__PURE__*/createElement("div", {
1950
1950
  role: "alert"
1951
- }, /*#__PURE__*/createElement(ScreenReaderOnly, null, "Richtext commands. Currently focused item: ", selectedItem, ". Press ", /*#__PURE__*/createElement("kbd", null, "enter"), " to select, ", /*#__PURE__*/createElement("kbd", null, "arrows"), " to navigate, ", /*#__PURE__*/createElement("kbd", null, "escape"), " to close.")), /*#__PURE__*/createElement(Portal, null, /*#__PURE__*/createElement("div", Object.assign({
1951
+ }, /*#__PURE__*/createElement(ScreenReaderOnly, null, "Richtext commands. Currently focused item: ", selectedItem, ". Press ", /*#__PURE__*/createElement("kbd", null, "enter"), " to select, ", /*#__PURE__*/createElement("kbd", null, "arrows"), " to navigate, ", /*#__PURE__*/createElement("kbd", null, "escape"), " to close.")), /*#__PURE__*/createElement(Portal, null, /*#__PURE__*/createElement("div", _extends({
1952
1952
  "aria-hidden": true,
1953
1953
  ref: popoverContainer,
1954
1954
  style: popper.styles.popper
@@ -1992,7 +1992,7 @@ var CommandPrompt = function CommandPrompt(props) {
1992
1992
  textElement = _React$useState[0],
1993
1993
  setTextElement = _React$useState[1];
1994
1994
 
1995
- return /*#__PURE__*/createElement("span", Object.assign({
1995
+ return /*#__PURE__*/createElement("span", _extends({
1996
1996
  ref: function ref(e) {
1997
1997
  setTextElement(e);
1998
1998
  }
@@ -2136,82 +2136,12 @@ function withLinkTracking(Component) {
2136
2136
  var onEntityFetchComplete = React__default.useCallback(function () {
2137
2137
  return editor.tracking.onViewportAction('linkRendered');
2138
2138
  }, [editor]);
2139
- return /*#__PURE__*/React__default.createElement(Component, Object.assign({}, props, {
2139
+ return /*#__PURE__*/React__default.createElement(Component, _extends({}, props, {
2140
2140
  onEntityFetchComplete: onEntityFetchComplete
2141
2141
  }));
2142
2142
  };
2143
2143
  }
2144
2144
 
2145
- function useFetchedEntity(_ref) {
2146
- var type = _ref.type,
2147
- id = _ref.id,
2148
- onEntityFetchComplete = _ref.onEntityFetchComplete;
2149
-
2150
- var _useEntities = useEntities(),
2151
- entries = _useEntities.entries,
2152
- assets = _useEntities.assets,
2153
- getEntry = _useEntities.getEntry,
2154
- getAsset = _useEntities.getAsset;
2155
-
2156
- var store = type === 'Entry' ? entries : assets;
2157
-
2158
- var _useState = useState(store == null ? void 0 : store[id]),
2159
- entity = _useState[0],
2160
- setEntity = _useState[1]; // Deep compare the entity value to keep re-rendering to minimal
2161
-
2162
-
2163
- useEffect(function () {
2164
- if (!store) {
2165
- return;
2166
- }
2167
-
2168
- var newValue = store[id];
2169
-
2170
- if (!areEqual(entity, newValue)) {
2171
- setEntity(newValue);
2172
- }
2173
- }, [store, entity, id]); // Fetch the entity if needed
2174
-
2175
- useEffect(function () {
2176
- if (!store) {
2177
- return;
2178
- }
2179
-
2180
- (type === 'Entry' ? getEntry : getAsset)(id); // "getEntry" and "getAsset" instances change with every
2181
- // entity store update causing page lag on initial load
2182
- // TODO: consider rewriting useEntities() hook to avoid that happening in
2183
- // first place.
2184
- // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: explain this disable
2185
- }, [type, id]);
2186
- useEffect(function () {
2187
- if (entity) {
2188
- onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
2189
- }
2190
- }, [onEntityFetchComplete, entity]);
2191
- return entity;
2192
- }
2193
-
2194
- /**
2195
- * A userland implementation of useEvent RFC
2196
- *
2197
- * See: https://github.com/reactjs/rfcs/pull/220
2198
- */
2199
-
2200
- var useStableCallback = function useStableCallback(callback) {
2201
- var callbackRef = useRef(callback); // Makes sure the callbackRef points to the latest `callback` props
2202
- // The useLayoutEffect is here for concurrent safety. It has the
2203
- // disadvantage of not being able to use the result callback during
2204
- // the render but that's Ok.
2205
-
2206
- useLayoutEffect(function () {
2207
- callbackRef.current = callback;
2208
- }); // The stable callback that won't change
2209
-
2210
- return useCallback(function () {
2211
- return callbackRef.current.apply(callbackRef, arguments);
2212
- }, []);
2213
- };
2214
-
2215
2145
  var InternalAssetCard = /*#__PURE__*/memo(function (props) {
2216
2146
  if (props.asset === undefined) {
2217
2147
  return /*#__PURE__*/createElement(AssetCard, {
@@ -2243,26 +2173,29 @@ var InternalAssetCard = /*#__PURE__*/memo(function (props) {
2243
2173
  }, areEqual);
2244
2174
  InternalAssetCard.displayName = 'InternalAssetCard';
2245
2175
  function FetchingWrappedAssetCard(props) {
2246
- var onEntityFetchComplete = props.onEntityFetchComplete,
2247
- assetId = props.assetId;
2176
+ var onEntityFetchComplete = props.onEntityFetchComplete;
2248
2177
 
2249
- var _useEntities = useEntities(),
2250
- loadEntityScheduledActions = _useEntities.loadEntityScheduledActions; // FIXME: remove when useEntities() has been refactored to avoid
2251
- // unnecessary re-rendering
2178
+ var _useEntity = useEntity('Asset', props.assetId),
2179
+ asset = _useEntity.data,
2180
+ status = _useEntity.status;
2252
2181
 
2182
+ var _useEntityLoader = useEntityLoader(),
2183
+ getEntityScheduledActions = _useEntityLoader.getEntityScheduledActions;
2253
2184
 
2254
- var stableLoadEntityScheduledActions = useStableCallback(loadEntityScheduledActions);
2255
- var asset = useFetchedEntity({
2256
- type: 'Asset',
2257
- id: assetId,
2258
- onEntityFetchComplete: onEntityFetchComplete
2259
- });
2185
+ var loadEntityScheduledActions = useCallback(function () {
2186
+ return getEntityScheduledActions('Asset', props.assetId);
2187
+ }, [getEntityScheduledActions, props.assetId]);
2188
+ useEffect(function () {
2189
+ if (status === 'success') {
2190
+ onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
2191
+ }
2192
+ }, [onEntityFetchComplete, status]);
2260
2193
  return /*#__PURE__*/createElement(InternalAssetCard, {
2261
2194
  asset: asset,
2262
2195
  sdk: props.sdk,
2263
2196
  isDisabled: props.isDisabled,
2264
2197
  isSelected: props.isSelected,
2265
- loadEntityScheduledActions: stableLoadEntityScheduledActions,
2198
+ loadEntityScheduledActions: loadEntityScheduledActions,
2266
2199
  locale: props.locale,
2267
2200
  onEdit: props.onEdit,
2268
2201
  onRemove: props.onRemove
@@ -2311,17 +2244,21 @@ var FetchingWrappedEntryCard = function FetchingWrappedEntryCard(props) {
2311
2244
  var entryId = props.entryId,
2312
2245
  onEntityFetchComplete = props.onEntityFetchComplete;
2313
2246
 
2314
- var _useEntities = useEntities(),
2315
- loadEntityScheduledActions = _useEntities.loadEntityScheduledActions; // FIXME: remove when useEntities() has been refactored to avoid
2316
- // unnecessary re-rendering
2247
+ var _useEntity = useEntity('Entry', entryId),
2248
+ entry = _useEntity.data,
2249
+ status = _useEntity.status;
2317
2250
 
2251
+ var _useEntityLoader = useEntityLoader(),
2252
+ getEntityScheduledActions = _useEntityLoader.getEntityScheduledActions;
2318
2253
 
2319
- var stableLoadEntityScheduledActions = useStableCallback(loadEntityScheduledActions);
2320
- var entry = useFetchedEntity({
2321
- type: 'Entry',
2322
- id: entryId,
2323
- onEntityFetchComplete: onEntityFetchComplete
2324
- });
2254
+ var loadEntityScheduledActions = useCallback(function () {
2255
+ return getEntityScheduledActions('Entry', entryId);
2256
+ }, [getEntityScheduledActions, entryId]);
2257
+ useEffect(function () {
2258
+ if (status === 'success') {
2259
+ onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
2260
+ }
2261
+ }, [onEntityFetchComplete, status]);
2325
2262
  return /*#__PURE__*/createElement(InternalEntryCard, {
2326
2263
  entry: entry,
2327
2264
  sdk: props.sdk,
@@ -2330,7 +2267,7 @@ var FetchingWrappedEntryCard = function FetchingWrappedEntryCard(props) {
2330
2267
  isSelected: props.isSelected,
2331
2268
  onEdit: props.onEdit,
2332
2269
  onRemove: props.onRemove,
2333
- loadEntityScheduledActions: stableLoadEntityScheduledActions
2270
+ loadEntityScheduledActions: loadEntityScheduledActions
2334
2271
  });
2335
2272
  };
2336
2273
 
@@ -2372,7 +2309,7 @@ function LinkedEntityBlock(props) {
2372
2309
  at: pathToElement
2373
2310
  });
2374
2311
  }, [editor, element]);
2375
- return /*#__PURE__*/React__default.createElement("div", Object.assign({}, attributes, {
2312
+ return /*#__PURE__*/React__default.createElement("div", _extends({}, attributes, {
2376
2313
  className: styles$1.root,
2377
2314
  "data-entity-type": entityType,
2378
2315
  "data-entity-id": entityId,
@@ -2756,29 +2693,32 @@ var styles$3 = {
2756
2693
  })
2757
2694
  };
2758
2695
  function FetchingWrappedInlineEntryCard(props) {
2759
- var _useEntities = useEntities(),
2760
- getEntry = _useEntities.getEntry,
2761
- loadEntityScheduledActions = _useEntities.loadEntityScheduledActions,
2762
- entries = _useEntities.entries;
2763
-
2764
- var entry = React__default.useMemo(function () {
2765
- return entries[props.entryId];
2766
- }, [entries, props.entryId]);
2696
+ var _useEntity = useEntity('Entry', props.entryId),
2697
+ entry = _useEntity.data,
2698
+ requestStatus = _useEntity.status;
2699
+
2700
+ var _useEntityLoader = useEntityLoader(),
2701
+ getEntityScheduledActions = _useEntityLoader.getEntityScheduledActions;
2702
+
2703
+ var loadEntityScheduledActions = function loadEntityScheduledActions() {
2704
+ return getEntityScheduledActions('Entry', props.entryId);
2705
+ };
2706
+
2767
2707
  var allContentTypes = props.sdk.space.getCachedContentTypes();
2768
2708
  var onEntityFetchComplete = props.onEntityFetchComplete;
2769
2709
  var contentType = React__default.useMemo(function () {
2770
- if (!entry || entry === 'failed' || !allContentTypes) return undefined;
2710
+ if (!entry || !allContentTypes) return undefined;
2771
2711
  return allContentTypes.find(function (contentType) {
2772
2712
  return contentType.sys.id === entry.sys.contentType.sys.id;
2773
2713
  });
2774
2714
  }, [allContentTypes, entry]);
2775
2715
  React__default.useEffect(function () {
2776
- if (!entry) {
2716
+ if (requestStatus !== 'success') {
2777
2717
  return;
2778
2718
  }
2779
2719
 
2780
2720
  onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
2781
- }, [entry, onEntityFetchComplete]);
2721
+ }, [requestStatus, onEntityFetchComplete]);
2782
2722
  var contentTypeName = contentType ? contentType.name : '';
2783
2723
  var title = React__default.useMemo(function () {
2784
2724
  return getEntryTitle({
@@ -2789,14 +2729,8 @@ function FetchingWrappedInlineEntryCard(props) {
2789
2729
  defaultTitle: 'Untitled'
2790
2730
  });
2791
2731
  }, [entry, contentType, props.sdk.field.locale, props.sdk.locales["default"]]);
2792
- React__default.useEffect(function () {
2793
- if (!props.entryId) return;
2794
- getEntry(props.entryId); // We don't include getEntry below because it's part of the constate-derived
2795
- // useEntities(), not props.
2796
- // eslint-disable-next-line -- TODO: explain this disable
2797
- }, [props.entryId]);
2798
2732
 
2799
- if (entry === 'failed') {
2733
+ if (requestStatus === 'error') {
2800
2734
  return /*#__PURE__*/React__default.createElement(InlineEntryCard, {
2801
2735
  title: "Entry missing or inaccessible",
2802
2736
  testId: INLINES.EMBEDDED_ENTRY,
@@ -2804,15 +2738,15 @@ function FetchingWrappedInlineEntryCard(props) {
2804
2738
  });
2805
2739
  }
2806
2740
 
2807
- if (entry === undefined) {
2741
+ if (requestStatus === 'loading') {
2808
2742
  return /*#__PURE__*/React__default.createElement(InlineEntryCard, {
2809
2743
  isLoading: true
2810
2744
  });
2811
2745
  }
2812
2746
 
2813
- var status = getEntryStatus(entry.sys);
2747
+ var entryStatus = getEntryStatus(entry.sys);
2814
2748
 
2815
- if (status === 'deleted') {
2749
+ if (entryStatus === 'deleted') {
2816
2750
  return /*#__PURE__*/React__default.createElement(InlineEntryCard, {
2817
2751
  title: "Entry missing or inaccessible",
2818
2752
  testId: INLINES.EMBEDDED_ENTRY,
@@ -2829,7 +2763,7 @@ function FetchingWrappedInlineEntryCard(props) {
2829
2763
  testId: INLINES.EMBEDDED_ENTRY,
2830
2764
  isSelected: props.isSelected,
2831
2765
  title: contentTypeName + ": " + title,
2832
- status: status,
2766
+ status: entryStatus,
2833
2767
  actions: [/*#__PURE__*/React__default.createElement(MenuItem, {
2834
2768
  key: "edit",
2835
2769
  onClick: props.onEdit
@@ -2903,7 +2837,7 @@ function EmbeddedEntityInline(props) {
2903
2837
  });
2904
2838
  }
2905
2839
 
2906
- return /*#__PURE__*/createElement("span", Object.assign({}, props.attributes, {
2840
+ return /*#__PURE__*/createElement("span", _extends({}, props.attributes, {
2907
2841
  className: styles$4.root,
2908
2842
  "data-embedded-entity-inline-id": entryId,
2909
2843
  // COMPAT: This makes copy & paste work for Firefox
@@ -3254,7 +3188,7 @@ var styles$6 = {
3254
3188
 
3255
3189
  function createHeading(Tag, block) {
3256
3190
  return function Heading(props) {
3257
- return /*#__PURE__*/createElement(Tag, Object.assign({}, props.attributes, {
3191
+ return /*#__PURE__*/createElement(Tag, _extends({}, props.attributes, {
3258
3192
  className: cx(styles$6.headings.root, styles$6.headings[block])
3259
3193
  }), props.children);
3260
3194
  };
@@ -3455,7 +3389,7 @@ function ToolbarHrButton(props) {
3455
3389
  function Hr(props) {
3456
3390
  var isSelected = useSelected();
3457
3391
  var isFocused = useFocused();
3458
- return /*#__PURE__*/createElement("div", Object.assign({}, props.attributes, {
3392
+ return /*#__PURE__*/createElement("div", _extends({}, props.attributes, {
3459
3393
  className: styles$8.container,
3460
3394
  "data-void-element": BLOCKS.HR
3461
3395
  }), /*#__PURE__*/createElement("div", {
@@ -3793,7 +3727,8 @@ function _addOrEditLink() {
3793
3727
  });
3794
3728
  logAction(isEditing ? 'edit' : 'insert', {
3795
3729
  nodeType: type,
3796
- linkType: (_target$sys$linkType = target == null ? void 0 : target.sys.linkType) != null ? _target$sys$linkType : 'uri'
3730
+ linkType: (_target$sys$linkType = target == null ? void 0 : target.sys.linkType) != null ? _target$sys$linkType : 'uri' // we want to keep the same values we've been using for the old editor, which can be `uri`, `Asset` or `Entry`
3731
+
3797
3732
  });
3798
3733
  focus(editor);
3799
3734
 
@@ -4227,7 +4162,7 @@ var styles$b = (_styles = {}, _styles[BLOCKS.UL_LIST] = /*#__PURE__*/css(_templa
4227
4162
 
4228
4163
  function createList(Tag, block) {
4229
4164
  return function List(props) {
4230
- return /*#__PURE__*/createElement(Tag, Object.assign({}, props.attributes, {
4165
+ return /*#__PURE__*/createElement(Tag, _extends({}, props.attributes, {
4231
4166
  className: cx(baseStyle, styles$b[block])
4232
4167
  }), props.children);
4233
4168
  };
@@ -4239,7 +4174,7 @@ var ListOL = /*#__PURE__*/createList('ol', BLOCKS.OL_LIST);
4239
4174
  var _templateObject$5;
4240
4175
  var style = /*#__PURE__*/css(_templateObject$5 || (_templateObject$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0;\n list-style: inherit;\n margin-top: ", ";\n\n ol,\n ul {\n margin: 0 0 0 ", ";\n }\n"])), tokens.spacingXs, tokens.spacingL);
4241
4176
  function ListItem(props) {
4242
- return /*#__PURE__*/createElement("li", Object.assign({}, props.attributes, {
4177
+ return /*#__PURE__*/createElement("li", _extends({}, props.attributes, {
4243
4178
  className: style
4244
4179
  }), props.children);
4245
4180
  }
@@ -5215,7 +5150,7 @@ var styles$c = {
5215
5150
  })
5216
5151
  };
5217
5152
  function Bold(props) {
5218
- return /*#__PURE__*/createElement("strong", Object.assign({}, props.attributes, {
5153
+ return /*#__PURE__*/createElement("strong", _extends({}, props.attributes, {
5219
5154
  className: styles$c.bold
5220
5155
  }), props.children);
5221
5156
  }
@@ -5263,7 +5198,7 @@ var styles$d = {
5263
5198
  })
5264
5199
  };
5265
5200
  function Code(props) {
5266
- return /*#__PURE__*/createElement("code", Object.assign({}, props.attributes, {
5201
+ return /*#__PURE__*/createElement("code", _extends({}, props.attributes, {
5267
5202
  className: styles$d.code
5268
5203
  }), props.children);
5269
5204
  }
@@ -5300,7 +5235,7 @@ var styles$e = {
5300
5235
  })
5301
5236
  };
5302
5237
  function Italic(props) {
5303
- return /*#__PURE__*/createElement("em", Object.assign({}, props.attributes, {
5238
+ return /*#__PURE__*/createElement("em", _extends({}, props.attributes, {
5304
5239
  className: styles$e.italic
5305
5240
  }), props.children);
5306
5241
  }
@@ -5337,7 +5272,7 @@ var ToolbarUnderlineButton = /*#__PURE__*/createMarkToolbarButton({
5337
5272
  icon: /*#__PURE__*/createElement(FormatUnderlinedIcon, null)
5338
5273
  });
5339
5274
  function Underline(props) {
5340
- return /*#__PURE__*/createElement("u", Object.assign({}, props.attributes), props.children);
5275
+ return /*#__PURE__*/createElement("u", _extends({}, props.attributes), props.children);
5341
5276
  }
5342
5277
  var createUnderlinePlugin = function createUnderlinePlugin() {
5343
5278
  return createUnderlinePlugin$1({
@@ -5579,7 +5514,7 @@ var createNormalizerPlugin = function createNormalizerPlugin() {
5579
5514
  var _templateObject$6, _styles$1;
5580
5515
  var styles$f = (_styles$1 = {}, _styles$1[BLOCKS.PARAGRAPH] = /*#__PURE__*/css(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n line-height: ", ";\n margin-bottom: 1.5em;\n "])), tokens.lineHeightDefault), _styles$1);
5581
5516
  function Paragraph(props) {
5582
- return /*#__PURE__*/createElement("div", Object.assign({}, props.attributes, {
5517
+ return /*#__PURE__*/createElement("div", _extends({}, props.attributes, {
5583
5518
  className: styles$f[BLOCKS.PARAGRAPH]
5584
5519
  }), props.children);
5585
5520
  }
@@ -5799,7 +5734,7 @@ var style$1 = /*#__PURE__*/css({
5799
5734
  fontStyle: 'normal'
5800
5735
  });
5801
5736
  function Quote(props) {
5802
- return /*#__PURE__*/createElement("blockquote", Object.assign({}, props.attributes, {
5737
+ return /*#__PURE__*/createElement("blockquote", _extends({}, props.attributes, {
5803
5738
  className: style$1
5804
5739
  }), props.children);
5805
5740
  }
@@ -6339,7 +6274,7 @@ var _templateObject$7;
6339
6274
  var style$2 = /*#__PURE__*/css(_templateObject$7 || (_templateObject$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 1px solid ", ";\n border-collapse: collapse;\n padding: 10px 12px;\n min-width: 48px;\n position: relative;\n vertical-align: top;\n\n div:last-child {\n margin-bottom: 0;\n }\n"])), tokens.gray400);
6340
6275
  var Cell = function Cell(props) {
6341
6276
  var isSelected = useSelected();
6342
- return /*#__PURE__*/createElement("td", Object.assign({}, props.attributes, props.element.data, {
6277
+ return /*#__PURE__*/createElement("td", _extends({}, props.attributes, props.element.data, {
6343
6278
  className: style$2
6344
6279
  }), isSelected && /*#__PURE__*/createElement(TableActions, null), props.children);
6345
6280
  };
@@ -6348,7 +6283,7 @@ var _templateObject$8;
6348
6283
  var style$3 = /*#__PURE__*/css(_templateObject$8 || (_templateObject$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n background-clip: padding-box;\n background-color: ", ";\n border: 1px solid ", ";\n border-collapse: collapse;\n padding: 10px 12px;\n font-weight: ", ";\n text-align: left;\n min-width: 48px;\n position: relative;\n\n div:last-child {\n margin-bottom: 0;\n }\n"])), tokens.gray200, tokens.gray400, tokens.fontWeightNormal);
6349
6284
  var HeaderCell = function HeaderCell(props) {
6350
6285
  var isSelected = useSelected();
6351
- return /*#__PURE__*/createElement("th", Object.assign({}, props.attributes, props.element.data, {
6286
+ return /*#__PURE__*/createElement("th", _extends({}, props.attributes, props.element.data, {
6352
6287
  className: style$3
6353
6288
  }), isSelected && /*#__PURE__*/createElement(TableActions, null), props.children);
6354
6289
  };
@@ -6356,7 +6291,7 @@ var HeaderCell = function HeaderCell(props) {
6356
6291
  var _templateObject$9;
6357
6292
  var style$4 = /*#__PURE__*/css(_templateObject$9 || (_templateObject$9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 1px solid ", ";\n border-collapse: collapse;\n\n &:hover td {\n background-color: transparent !important;\n }\n"])), tokens.gray400);
6358
6293
  var Row = function Row(props) {
6359
- return /*#__PURE__*/createElement("tr", Object.assign({}, props.attributes, {
6294
+ return /*#__PURE__*/createElement("tr", _extends({}, props.attributes, {
6360
6295
  className: style$4
6361
6296
  }), props.children);
6362
6297
  };
@@ -6366,7 +6301,7 @@ var style$5 = /*#__PURE__*/css(_templateObject$a || (_templateObject$a = /*#__PU
6366
6301
  var Table = function Table(props) {
6367
6302
  return /*#__PURE__*/createElement("div", {
6368
6303
  "data-block-type": BLOCKS.TABLE
6369
- }, /*#__PURE__*/createElement("table", Object.assign({
6304
+ }, /*#__PURE__*/createElement("table", _extends({
6370
6305
  className: style$5
6371
6306
  }, props.attributes), /*#__PURE__*/createElement("tbody", null, props.children)));
6372
6307
  };
@@ -7642,7 +7577,7 @@ var RichTextEditor = function RichTextEditor(props) {
7642
7577
  var lastRemoteValue = _ref.lastRemoteValue,
7643
7578
  disabled = _ref.disabled,
7644
7579
  setValue = _ref.setValue;
7645
- return /*#__PURE__*/React__default.createElement(ConnectedRichTextEditor, Object.assign({}, otherProps, {
7580
+ return /*#__PURE__*/React__default.createElement(ConnectedRichTextEditor, _extends({}, otherProps, {
7646
7581
  key: "rich-text-editor-" + id,
7647
7582
  value: lastRemoteValue,
7648
7583
  sdk: sdk,
@@ -7997,7 +7932,7 @@ var openRichTextDialog = function openRichTextDialog(sdk) {
7997
7932
  if (((_options$parameters = options.parameters) == null ? void 0 : _options$parameters.type) === 'rich-text-hyperlink-dialog') {
7998
7933
  return ModalDialogLauncher.openDialog(options, function (_ref) {
7999
7934
  var onClose = _ref.onClose;
8000
- return /*#__PURE__*/React__default.createElement(HyperlinkDialog, Object.assign({}, options.parameters, {
7935
+ return /*#__PURE__*/React__default.createElement(HyperlinkDialog, _extends({}, options.parameters, {
8001
7936
  onClose: onClose,
8002
7937
  sdk: sdk
8003
7938
  }));
@@ -8013,7 +7948,7 @@ var renderRichTextDialog = function renderRichTextDialog(sdk) {
8013
7948
 
8014
7949
  if ((parameters == null ? void 0 : parameters.type) === 'rich-text-hyperlink-dialog') {
8015
7950
  sdk.window.startAutoResizer();
8016
- return /*#__PURE__*/React__default.createElement(HyperlinkDialog, Object.assign({}, sdk.parameters.invocation, {
7951
+ return /*#__PURE__*/React__default.createElement(HyperlinkDialog, _extends({}, sdk.parameters.invocation, {
8017
7952
  onClose: sdk.close,
8018
7953
  sdk: sdk
8019
7954
  }));