@contentful/field-editor-rich-text 2.3.19 → 3.0.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.
@@ -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,84 +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 = useMemo(function () {
2157
- return type === 'Entry' ? entries : assets;
2158
- }, [assets, entries, type]);
2159
-
2160
- var _useState = useState(store == null ? void 0 : store[id]),
2161
- entity = _useState[0],
2162
- setEntity = _useState[1]; // Deep compare the entity value to keep re-rendering to minimal
2163
-
2164
-
2165
- useEffect(function () {
2166
- if (!store) {
2167
- return;
2168
- }
2169
-
2170
- var newValue = store[id];
2171
-
2172
- if (!areEqual(entity, newValue)) {
2173
- setEntity(newValue);
2174
- }
2175
- }, [store, entity, id]); // Fetch the entity if needed
2176
-
2177
- useEffect(function () {
2178
- if (!store) {
2179
- return;
2180
- }
2181
-
2182
- (type === 'Entry' ? getEntry : getAsset)(id); // "getEntry" and "getAsset" instances change with every
2183
- // entity store update causing page lag on initial load
2184
- // TODO: consider rewriting useEntities() hook to avoid that happening in
2185
- // first place.
2186
- // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: explain this disable
2187
- }, [type, id, store]);
2188
- useEffect(function () {
2189
- if (entity) {
2190
- onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
2191
- }
2192
- }, [onEntityFetchComplete, entity]);
2193
- return entity;
2194
- }
2195
-
2196
- /**
2197
- * A userland implementation of useEvent RFC
2198
- *
2199
- * See: https://github.com/reactjs/rfcs/pull/220
2200
- */
2201
-
2202
- var useStableCallback = function useStableCallback(callback) {
2203
- var callbackRef = useRef(callback); // Makes sure the callbackRef points to the latest `callback` props
2204
- // The useLayoutEffect is here for concurrent safety. It has the
2205
- // disadvantage of not being able to use the result callback during
2206
- // the render but that's Ok.
2207
-
2208
- useLayoutEffect(function () {
2209
- callbackRef.current = callback;
2210
- }); // The stable callback that won't change
2211
-
2212
- return useCallback(function () {
2213
- return callbackRef.current.apply(callbackRef, arguments);
2214
- }, []);
2215
- };
2216
-
2217
2145
  var InternalAssetCard = /*#__PURE__*/memo(function (props) {
2218
2146
  if (props.asset === undefined) {
2219
2147
  return /*#__PURE__*/createElement(AssetCard, {
@@ -2245,26 +2173,29 @@ var InternalAssetCard = /*#__PURE__*/memo(function (props) {
2245
2173
  }, areEqual);
2246
2174
  InternalAssetCard.displayName = 'InternalAssetCard';
2247
2175
  function FetchingWrappedAssetCard(props) {
2248
- var onEntityFetchComplete = props.onEntityFetchComplete,
2249
- assetId = props.assetId;
2176
+ var onEntityFetchComplete = props.onEntityFetchComplete;
2250
2177
 
2251
- var _useEntities = useEntities(),
2252
- loadEntityScheduledActions = _useEntities.loadEntityScheduledActions; // FIXME: remove when useEntities() has been refactored to avoid
2253
- // unnecessary re-rendering
2178
+ var _useEntity = useEntity('Asset', props.assetId),
2179
+ asset = _useEntity.data,
2180
+ status = _useEntity.status;
2254
2181
 
2182
+ var _useEntityLoader = useEntityLoader(),
2183
+ getEntityScheduledActions = _useEntityLoader.getEntityScheduledActions;
2255
2184
 
2256
- var stableLoadEntityScheduledActions = useStableCallback(loadEntityScheduledActions);
2257
- var asset = useFetchedEntity({
2258
- type: 'Asset',
2259
- id: assetId,
2260
- onEntityFetchComplete: onEntityFetchComplete
2261
- });
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]);
2262
2193
  return /*#__PURE__*/createElement(InternalAssetCard, {
2263
2194
  asset: asset,
2264
2195
  sdk: props.sdk,
2265
2196
  isDisabled: props.isDisabled,
2266
2197
  isSelected: props.isSelected,
2267
- loadEntityScheduledActions: stableLoadEntityScheduledActions,
2198
+ loadEntityScheduledActions: loadEntityScheduledActions,
2268
2199
  locale: props.locale,
2269
2200
  onEdit: props.onEdit,
2270
2201
  onRemove: props.onRemove
@@ -2313,17 +2244,21 @@ var FetchingWrappedEntryCard = function FetchingWrappedEntryCard(props) {
2313
2244
  var entryId = props.entryId,
2314
2245
  onEntityFetchComplete = props.onEntityFetchComplete;
2315
2246
 
2316
- var _useEntities = useEntities(),
2317
- loadEntityScheduledActions = _useEntities.loadEntityScheduledActions; // FIXME: remove when useEntities() has been refactored to avoid
2318
- // unnecessary re-rendering
2247
+ var _useEntity = useEntity('Entry', entryId),
2248
+ entry = _useEntity.data,
2249
+ status = _useEntity.status;
2319
2250
 
2251
+ var _useEntityLoader = useEntityLoader(),
2252
+ getEntityScheduledActions = _useEntityLoader.getEntityScheduledActions;
2320
2253
 
2321
- var stableLoadEntityScheduledActions = useStableCallback(loadEntityScheduledActions);
2322
- var entry = useFetchedEntity({
2323
- type: 'Entry',
2324
- id: entryId,
2325
- onEntityFetchComplete: onEntityFetchComplete
2326
- });
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]);
2327
2262
  return /*#__PURE__*/createElement(InternalEntryCard, {
2328
2263
  entry: entry,
2329
2264
  sdk: props.sdk,
@@ -2332,7 +2267,7 @@ var FetchingWrappedEntryCard = function FetchingWrappedEntryCard(props) {
2332
2267
  isSelected: props.isSelected,
2333
2268
  onEdit: props.onEdit,
2334
2269
  onRemove: props.onRemove,
2335
- loadEntityScheduledActions: stableLoadEntityScheduledActions
2270
+ loadEntityScheduledActions: loadEntityScheduledActions
2336
2271
  });
2337
2272
  };
2338
2273
 
@@ -2374,7 +2309,7 @@ function LinkedEntityBlock(props) {
2374
2309
  at: pathToElement
2375
2310
  });
2376
2311
  }, [editor, element]);
2377
- return /*#__PURE__*/React__default.createElement("div", Object.assign({}, attributes, {
2312
+ return /*#__PURE__*/React__default.createElement("div", _extends({}, attributes, {
2378
2313
  className: styles$1.root,
2379
2314
  "data-entity-type": entityType,
2380
2315
  "data-entity-id": entityId,
@@ -2758,29 +2693,32 @@ var styles$3 = {
2758
2693
  })
2759
2694
  };
2760
2695
  function FetchingWrappedInlineEntryCard(props) {
2761
- var _useEntities = useEntities(),
2762
- getEntry = _useEntities.getEntry,
2763
- loadEntityScheduledActions = _useEntities.loadEntityScheduledActions,
2764
- entries = _useEntities.entries;
2765
-
2766
- var entry = React__default.useMemo(function () {
2767
- return entries[props.entryId];
2768
- }, [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
+
2769
2707
  var allContentTypes = props.sdk.space.getCachedContentTypes();
2770
2708
  var onEntityFetchComplete = props.onEntityFetchComplete;
2771
2709
  var contentType = React__default.useMemo(function () {
2772
- if (!entry || entry === 'failed' || !allContentTypes) return undefined;
2710
+ if (!entry || !allContentTypes) return undefined;
2773
2711
  return allContentTypes.find(function (contentType) {
2774
2712
  return contentType.sys.id === entry.sys.contentType.sys.id;
2775
2713
  });
2776
2714
  }, [allContentTypes, entry]);
2777
2715
  React__default.useEffect(function () {
2778
- if (!entry) {
2716
+ if (requestStatus !== 'success') {
2779
2717
  return;
2780
2718
  }
2781
2719
 
2782
2720
  onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
2783
- }, [entry, onEntityFetchComplete]);
2721
+ }, [requestStatus, onEntityFetchComplete]);
2784
2722
  var contentTypeName = contentType ? contentType.name : '';
2785
2723
  var title = React__default.useMemo(function () {
2786
2724
  return getEntryTitle({
@@ -2791,14 +2729,8 @@ function FetchingWrappedInlineEntryCard(props) {
2791
2729
  defaultTitle: 'Untitled'
2792
2730
  });
2793
2731
  }, [entry, contentType, props.sdk.field.locale, props.sdk.locales["default"]]);
2794
- React__default.useEffect(function () {
2795
- if (!props.entryId) return;
2796
- getEntry(props.entryId); // We don't include getEntry below because it's part of the constate-derived
2797
- // useEntities(), not props.
2798
- // eslint-disable-next-line -- TODO: explain this disable
2799
- }, [props.entryId]);
2800
2732
 
2801
- if (entry === 'failed') {
2733
+ if (requestStatus === 'error') {
2802
2734
  return /*#__PURE__*/React__default.createElement(InlineEntryCard, {
2803
2735
  title: "Entry missing or inaccessible",
2804
2736
  testId: INLINES.EMBEDDED_ENTRY,
@@ -2806,15 +2738,15 @@ function FetchingWrappedInlineEntryCard(props) {
2806
2738
  });
2807
2739
  }
2808
2740
 
2809
- if (entry === undefined) {
2741
+ if (requestStatus === 'loading') {
2810
2742
  return /*#__PURE__*/React__default.createElement(InlineEntryCard, {
2811
2743
  isLoading: true
2812
2744
  });
2813
2745
  }
2814
2746
 
2815
- var status = getEntryStatus(entry.sys);
2747
+ var entryStatus = getEntryStatus(entry.sys);
2816
2748
 
2817
- if (status === 'deleted') {
2749
+ if (entryStatus === 'deleted') {
2818
2750
  return /*#__PURE__*/React__default.createElement(InlineEntryCard, {
2819
2751
  title: "Entry missing or inaccessible",
2820
2752
  testId: INLINES.EMBEDDED_ENTRY,
@@ -2831,7 +2763,7 @@ function FetchingWrappedInlineEntryCard(props) {
2831
2763
  testId: INLINES.EMBEDDED_ENTRY,
2832
2764
  isSelected: props.isSelected,
2833
2765
  title: contentTypeName + ": " + title,
2834
- status: status,
2766
+ status: entryStatus,
2835
2767
  actions: [/*#__PURE__*/React__default.createElement(MenuItem, {
2836
2768
  key: "edit",
2837
2769
  onClick: props.onEdit
@@ -2905,7 +2837,7 @@ function EmbeddedEntityInline(props) {
2905
2837
  });
2906
2838
  }
2907
2839
 
2908
- return /*#__PURE__*/createElement("span", Object.assign({}, props.attributes, {
2840
+ return /*#__PURE__*/createElement("span", _extends({}, props.attributes, {
2909
2841
  className: styles$4.root,
2910
2842
  "data-embedded-entity-inline-id": entryId,
2911
2843
  // COMPAT: This makes copy & paste work for Firefox
@@ -3256,7 +3188,7 @@ var styles$6 = {
3256
3188
 
3257
3189
  function createHeading(Tag, block) {
3258
3190
  return function Heading(props) {
3259
- return /*#__PURE__*/createElement(Tag, Object.assign({}, props.attributes, {
3191
+ return /*#__PURE__*/createElement(Tag, _extends({}, props.attributes, {
3260
3192
  className: cx(styles$6.headings.root, styles$6.headings[block])
3261
3193
  }), props.children);
3262
3194
  };
@@ -3457,7 +3389,7 @@ function ToolbarHrButton(props) {
3457
3389
  function Hr(props) {
3458
3390
  var isSelected = useSelected();
3459
3391
  var isFocused = useFocused();
3460
- return /*#__PURE__*/createElement("div", Object.assign({}, props.attributes, {
3392
+ return /*#__PURE__*/createElement("div", _extends({}, props.attributes, {
3461
3393
  className: styles$8.container,
3462
3394
  "data-void-element": BLOCKS.HR
3463
3395
  }), /*#__PURE__*/createElement("div", {
@@ -3795,7 +3727,8 @@ function _addOrEditLink() {
3795
3727
  });
3796
3728
  logAction(isEditing ? 'edit' : 'insert', {
3797
3729
  nodeType: type,
3798
- 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
+
3799
3732
  });
3800
3733
  focus(editor);
3801
3734
 
@@ -4229,7 +4162,7 @@ var styles$b = (_styles = {}, _styles[BLOCKS.UL_LIST] = /*#__PURE__*/css(_templa
4229
4162
 
4230
4163
  function createList(Tag, block) {
4231
4164
  return function List(props) {
4232
- return /*#__PURE__*/createElement(Tag, Object.assign({}, props.attributes, {
4165
+ return /*#__PURE__*/createElement(Tag, _extends({}, props.attributes, {
4233
4166
  className: cx(baseStyle, styles$b[block])
4234
4167
  }), props.children);
4235
4168
  };
@@ -4241,7 +4174,7 @@ var ListOL = /*#__PURE__*/createList('ol', BLOCKS.OL_LIST);
4241
4174
  var _templateObject$5;
4242
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);
4243
4176
  function ListItem(props) {
4244
- return /*#__PURE__*/createElement("li", Object.assign({}, props.attributes, {
4177
+ return /*#__PURE__*/createElement("li", _extends({}, props.attributes, {
4245
4178
  className: style
4246
4179
  }), props.children);
4247
4180
  }
@@ -5217,7 +5150,7 @@ var styles$c = {
5217
5150
  })
5218
5151
  };
5219
5152
  function Bold(props) {
5220
- return /*#__PURE__*/createElement("strong", Object.assign({}, props.attributes, {
5153
+ return /*#__PURE__*/createElement("strong", _extends({}, props.attributes, {
5221
5154
  className: styles$c.bold
5222
5155
  }), props.children);
5223
5156
  }
@@ -5265,7 +5198,7 @@ var styles$d = {
5265
5198
  })
5266
5199
  };
5267
5200
  function Code(props) {
5268
- return /*#__PURE__*/createElement("code", Object.assign({}, props.attributes, {
5201
+ return /*#__PURE__*/createElement("code", _extends({}, props.attributes, {
5269
5202
  className: styles$d.code
5270
5203
  }), props.children);
5271
5204
  }
@@ -5302,7 +5235,7 @@ var styles$e = {
5302
5235
  })
5303
5236
  };
5304
5237
  function Italic(props) {
5305
- return /*#__PURE__*/createElement("em", Object.assign({}, props.attributes, {
5238
+ return /*#__PURE__*/createElement("em", _extends({}, props.attributes, {
5306
5239
  className: styles$e.italic
5307
5240
  }), props.children);
5308
5241
  }
@@ -5339,7 +5272,7 @@ var ToolbarUnderlineButton = /*#__PURE__*/createMarkToolbarButton({
5339
5272
  icon: /*#__PURE__*/createElement(FormatUnderlinedIcon, null)
5340
5273
  });
5341
5274
  function Underline(props) {
5342
- return /*#__PURE__*/createElement("u", Object.assign({}, props.attributes), props.children);
5275
+ return /*#__PURE__*/createElement("u", _extends({}, props.attributes), props.children);
5343
5276
  }
5344
5277
  var createUnderlinePlugin = function createUnderlinePlugin() {
5345
5278
  return createUnderlinePlugin$1({
@@ -5581,7 +5514,7 @@ var createNormalizerPlugin = function createNormalizerPlugin() {
5581
5514
  var _templateObject$6, _styles$1;
5582
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);
5583
5516
  function Paragraph(props) {
5584
- return /*#__PURE__*/createElement("div", Object.assign({}, props.attributes, {
5517
+ return /*#__PURE__*/createElement("div", _extends({}, props.attributes, {
5585
5518
  className: styles$f[BLOCKS.PARAGRAPH]
5586
5519
  }), props.children);
5587
5520
  }
@@ -5801,7 +5734,7 @@ var style$1 = /*#__PURE__*/css({
5801
5734
  fontStyle: 'normal'
5802
5735
  });
5803
5736
  function Quote(props) {
5804
- return /*#__PURE__*/createElement("blockquote", Object.assign({}, props.attributes, {
5737
+ return /*#__PURE__*/createElement("blockquote", _extends({}, props.attributes, {
5805
5738
  className: style$1
5806
5739
  }), props.children);
5807
5740
  }
@@ -6341,7 +6274,7 @@ var _templateObject$7;
6341
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);
6342
6275
  var Cell = function Cell(props) {
6343
6276
  var isSelected = useSelected();
6344
- return /*#__PURE__*/createElement("td", Object.assign({}, props.attributes, props.element.data, {
6277
+ return /*#__PURE__*/createElement("td", _extends({}, props.attributes, props.element.data, {
6345
6278
  className: style$2
6346
6279
  }), isSelected && /*#__PURE__*/createElement(TableActions, null), props.children);
6347
6280
  };
@@ -6350,7 +6283,7 @@ var _templateObject$8;
6350
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);
6351
6284
  var HeaderCell = function HeaderCell(props) {
6352
6285
  var isSelected = useSelected();
6353
- return /*#__PURE__*/createElement("th", Object.assign({}, props.attributes, props.element.data, {
6286
+ return /*#__PURE__*/createElement("th", _extends({}, props.attributes, props.element.data, {
6354
6287
  className: style$3
6355
6288
  }), isSelected && /*#__PURE__*/createElement(TableActions, null), props.children);
6356
6289
  };
@@ -6358,7 +6291,7 @@ var HeaderCell = function HeaderCell(props) {
6358
6291
  var _templateObject$9;
6359
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);
6360
6293
  var Row = function Row(props) {
6361
- return /*#__PURE__*/createElement("tr", Object.assign({}, props.attributes, {
6294
+ return /*#__PURE__*/createElement("tr", _extends({}, props.attributes, {
6362
6295
  className: style$4
6363
6296
  }), props.children);
6364
6297
  };
@@ -6368,7 +6301,7 @@ var style$5 = /*#__PURE__*/css(_templateObject$a || (_templateObject$a = /*#__PU
6368
6301
  var Table = function Table(props) {
6369
6302
  return /*#__PURE__*/createElement("div", {
6370
6303
  "data-block-type": BLOCKS.TABLE
6371
- }, /*#__PURE__*/createElement("table", Object.assign({
6304
+ }, /*#__PURE__*/createElement("table", _extends({
6372
6305
  className: style$5
6373
6306
  }, props.attributes), /*#__PURE__*/createElement("tbody", null, props.children)));
6374
6307
  };
@@ -7644,7 +7577,7 @@ var RichTextEditor = function RichTextEditor(props) {
7644
7577
  var lastRemoteValue = _ref.lastRemoteValue,
7645
7578
  disabled = _ref.disabled,
7646
7579
  setValue = _ref.setValue;
7647
- return /*#__PURE__*/React__default.createElement(ConnectedRichTextEditor, Object.assign({}, otherProps, {
7580
+ return /*#__PURE__*/React__default.createElement(ConnectedRichTextEditor, _extends({}, otherProps, {
7648
7581
  key: "rich-text-editor-" + id,
7649
7582
  value: lastRemoteValue,
7650
7583
  sdk: sdk,
@@ -7999,7 +7932,7 @@ var openRichTextDialog = function openRichTextDialog(sdk) {
7999
7932
  if (((_options$parameters = options.parameters) == null ? void 0 : _options$parameters.type) === 'rich-text-hyperlink-dialog') {
8000
7933
  return ModalDialogLauncher.openDialog(options, function (_ref) {
8001
7934
  var onClose = _ref.onClose;
8002
- return /*#__PURE__*/React__default.createElement(HyperlinkDialog, Object.assign({}, options.parameters, {
7935
+ return /*#__PURE__*/React__default.createElement(HyperlinkDialog, _extends({}, options.parameters, {
8003
7936
  onClose: onClose,
8004
7937
  sdk: sdk
8005
7938
  }));
@@ -8015,7 +7948,7 @@ var renderRichTextDialog = function renderRichTextDialog(sdk) {
8015
7948
 
8016
7949
  if ((parameters == null ? void 0 : parameters.type) === 'rich-text-hyperlink-dialog') {
8017
7950
  sdk.window.startAutoResizer();
8018
- return /*#__PURE__*/React__default.createElement(HyperlinkDialog, Object.assign({}, sdk.parameters.invocation, {
7951
+ return /*#__PURE__*/React__default.createElement(HyperlinkDialog, _extends({}, sdk.parameters.invocation, {
8019
7952
  onClose: sdk.close,
8020
7953
  sdk: sdk
8021
7954
  }));