@contentful/field-editor-reference 4.4.0 → 4.5.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.
@@ -8,6 +8,7 @@ import moment from 'moment';
8
8
  import deepEqual from 'deep-equal';
9
9
  import { FieldConnector, isValidImage, entityHelpers, shortenStorageUnit } from '@contentful/field-editor-shared';
10
10
  import constate from 'constate';
11
+ import { createClient } from 'contentful-management';
11
12
  import isNumber from 'lodash-es/isNumber';
12
13
  import arrayMove from 'array-move';
13
14
  import { SortableContainer, SortableHandle, SortableElement } from 'react-sortable-hoc';
@@ -82,6 +83,44 @@ function _objectWithoutPropertiesLoose(source, excluded) {
82
83
  return target;
83
84
  }
84
85
 
86
+ function _unsupportedIterableToArray(o, minLen) {
87
+ if (!o) return;
88
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
89
+ var n = Object.prototype.toString.call(o).slice(8, -1);
90
+ if (n === "Object" && o.constructor) n = o.constructor.name;
91
+ if (n === "Map" || n === "Set") return Array.from(o);
92
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
93
+ }
94
+
95
+ function _arrayLikeToArray(arr, len) {
96
+ if (len == null || len > arr.length) len = arr.length;
97
+
98
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
99
+
100
+ return arr2;
101
+ }
102
+
103
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
104
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
105
+ if (it) return (it = it.call(o)).next.bind(it);
106
+
107
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
108
+ if (it) o = it;
109
+ var i = 0;
110
+ return function () {
111
+ if (i >= o.length) return {
112
+ done: true
113
+ };
114
+ return {
115
+ done: false,
116
+ value: o[i++]
117
+ };
118
+ };
119
+ }
120
+
121
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
122
+ }
123
+
85
124
  var container = /*#__PURE__*/css({
86
125
  display: 'flex',
87
126
  border: "1px dashed " + tokens.gray500,
@@ -1822,7 +1861,7 @@ function AssetThumbnail(props) {
1822
1861
  }
1823
1862
 
1824
1863
  function reducer(state, action) {
1825
- var _extends2, _extends3, _extends4, _extends5, _extends6;
1864
+ var _extends2, _extends3, _extends4, _extends5, _extends6, _extends7, _extends8;
1826
1865
 
1827
1866
  switch (action.type) {
1828
1867
  case 'set_entry':
@@ -1850,6 +1889,16 @@ function reducer(state, action) {
1850
1889
  scheduledActions: _extends({}, state.scheduledActions, (_extends6 = {}, _extends6[action.key] = action.actions, _extends6))
1851
1890
  });
1852
1891
 
1892
+ case 'set_resource':
1893
+ return _extends({}, state, {
1894
+ resources: _extends({}, state.resources, (_extends7 = {}, _extends7[action.resourceType + "." + action.urn] = action.resourceInfo, _extends7))
1895
+ });
1896
+
1897
+ case 'set_resource_failed':
1898
+ return _extends({}, state, {
1899
+ resources: _extends({}, state.resources, (_extends8 = {}, _extends8[action.resourceType + "." + action.urn] = 'failed', _extends8))
1900
+ });
1901
+
1853
1902
  default:
1854
1903
  return state;
1855
1904
  }
@@ -1858,10 +1907,34 @@ function reducer(state, action) {
1858
1907
  var initialState = {
1859
1908
  entries: {},
1860
1909
  assets: {},
1861
- scheduledActions: {}
1910
+ scheduledActions: {},
1911
+ resources: {}
1912
+ };
1913
+
1914
+ var isNotNil = function isNotNil(entity) {
1915
+ return Boolean(entity && entity !== 'failed');
1916
+ };
1917
+
1918
+ var nonNilResources = function nonNilResources(map) {
1919
+ return Object.entries(map).filter(function (_ref) {
1920
+ var value = _ref[1];
1921
+ return isNotNil(value);
1922
+ });
1862
1923
  };
1863
1924
 
1864
1925
  function useEntitiesStore(props) {
1926
+ var spaceId = props.sdk.ids.space;
1927
+ var environmentId = props.sdk.ids.environment;
1928
+
1929
+ var _React$useState = useState(function () {
1930
+ return createClient({
1931
+ apiAdapter: props.sdk.cmaAdapter
1932
+ }, {
1933
+ type: 'plain'
1934
+ });
1935
+ }),
1936
+ cmaClient = _React$useState[0];
1937
+
1865
1938
  var _React$useReducer = useReducer(reducer, initialState),
1866
1939
  state = _React$useReducer[0],
1867
1940
  dispatch = _React$useReducer[1];
@@ -1889,78 +1962,348 @@ function useEntitiesStore(props) {
1889
1962
  return [];
1890
1963
  });
1891
1964
  }, [props.sdk.space, state.scheduledActions]);
1892
- var loadEntry = useCallback(function (id) {
1893
- return props.sdk.space.getEntry(id).then(function (entry) {
1894
- dispatch({
1895
- type: 'set_entry',
1896
- id: id,
1897
- entry: entry
1898
- });
1899
- return entry;
1900
- })["catch"](function () {
1901
- dispatch({
1902
- type: 'set_entry_failed',
1903
- id: id
1904
- });
1905
- });
1906
- }, [props.sdk.space]);
1907
- var loadAsset = useCallback(function (id) {
1908
- return props.sdk.space.getAsset(id).then(function (asset) {
1909
- dispatch({
1910
- type: 'set_asset',
1911
- id: id,
1912
- asset: asset
1913
- });
1914
- return asset;
1915
- })["catch"](function () {
1916
- dispatch({
1917
- type: 'set_asset_failed',
1918
- id: id
1919
- });
1920
- });
1921
- }, [props.sdk.space]);
1922
- var getOrLoadAsset = useCallback(function (id) {
1923
- if (state.assets[id] && state.assets[id] !== 'failed') {
1924
- return Promise.resolve(state.assets[id]);
1925
- }
1965
+ var loadEntry = useCallback( /*#__PURE__*/function () {
1966
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(entryId) {
1967
+ var entry;
1968
+ return runtime_1.wrap(function _callee$(_context) {
1969
+ while (1) {
1970
+ switch (_context.prev = _context.next) {
1971
+ case 0:
1972
+ _context.prev = 0;
1973
+ _context.next = 3;
1974
+ return cmaClient.entry.get({
1975
+ spaceId: spaceId,
1976
+ environmentId: environmentId,
1977
+ entryId: entryId
1978
+ });
1926
1979
 
1927
- return loadAsset(id);
1928
- }, [state.assets, loadAsset]);
1929
- var getOrLoadEntry = useCallback(function (id) {
1930
- if (state.entries[id] && state.entries[id] !== 'failed') {
1931
- return Promise.resolve(state.entries[id]);
1932
- }
1980
+ case 3:
1981
+ entry = _context.sent;
1982
+ dispatch({
1983
+ type: 'set_entry',
1984
+ id: entryId,
1985
+ entry: entry
1986
+ });
1987
+ return _context.abrupt("return", entry);
1988
+
1989
+ case 8:
1990
+ _context.prev = 8;
1991
+ _context.t0 = _context["catch"](0);
1992
+ dispatch({
1993
+ type: 'set_entry_failed',
1994
+ id: entryId
1995
+ });
1996
+ return _context.abrupt("return");
1997
+
1998
+ case 12:
1999
+ case "end":
2000
+ return _context.stop();
2001
+ }
2002
+ }
2003
+ }, _callee, null, [[0, 8]]);
2004
+ }));
2005
+
2006
+ return function (_x) {
2007
+ return _ref2.apply(this, arguments);
2008
+ };
2009
+ }(), [cmaClient, spaceId, environmentId]);
2010
+ var getEntry = useCallback( /*#__PURE__*/function () {
2011
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(entryId) {
2012
+ var cachedEntry;
2013
+ return runtime_1.wrap(function _callee2$(_context2) {
2014
+ while (1) {
2015
+ switch (_context2.prev = _context2.next) {
2016
+ case 0:
2017
+ cachedEntry = state.entries[entryId];
2018
+
2019
+ if (!isNotNil(cachedEntry)) {
2020
+ _context2.next = 3;
2021
+ break;
2022
+ }
2023
+
2024
+ return _context2.abrupt("return", cachedEntry);
2025
+
2026
+ case 3:
2027
+ return _context2.abrupt("return", loadEntry(entryId));
2028
+
2029
+ case 4:
2030
+ case "end":
2031
+ return _context2.stop();
2032
+ }
2033
+ }
2034
+ }, _callee2);
2035
+ }));
2036
+
2037
+ return function (_x2) {
2038
+ return _ref3.apply(this, arguments);
2039
+ };
2040
+ }(), [loadEntry, state.entries]);
2041
+ var loadAsset = useCallback( /*#__PURE__*/function () {
2042
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(assetId) {
2043
+ var asset;
2044
+ return runtime_1.wrap(function _callee3$(_context3) {
2045
+ while (1) {
2046
+ switch (_context3.prev = _context3.next) {
2047
+ case 0:
2048
+ _context3.prev = 0;
2049
+ _context3.next = 3;
2050
+ return cmaClient.asset.get({
2051
+ spaceId: spaceId,
2052
+ environmentId: environmentId,
2053
+ assetId: assetId
2054
+ });
2055
+
2056
+ case 3:
2057
+ asset = _context3.sent;
2058
+ dispatch({
2059
+ type: 'set_asset',
2060
+ id: assetId,
2061
+ asset: asset
2062
+ });
2063
+ return _context3.abrupt("return", asset);
2064
+
2065
+ case 8:
2066
+ _context3.prev = 8;
2067
+ _context3.t0 = _context3["catch"](0);
2068
+ dispatch({
2069
+ type: 'set_asset_failed',
2070
+ id: assetId
2071
+ });
2072
+ return _context3.abrupt("return");
1933
2073
 
1934
- return loadEntry(id);
1935
- }, [state.entries, loadEntry]);
2074
+ case 12:
2075
+ case "end":
2076
+ return _context3.stop();
2077
+ }
2078
+ }
2079
+ }, _callee3, null, [[0, 8]]);
2080
+ }));
2081
+
2082
+ return function (_x3) {
2083
+ return _ref4.apply(this, arguments);
2084
+ };
2085
+ }(), [cmaClient, spaceId, environmentId]);
2086
+ var getAsset = useCallback( /*#__PURE__*/function () {
2087
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(assetId) {
2088
+ var cachedAsset;
2089
+ return runtime_1.wrap(function _callee4$(_context4) {
2090
+ while (1) {
2091
+ switch (_context4.prev = _context4.next) {
2092
+ case 0:
2093
+ cachedAsset = state.assets[assetId];
2094
+
2095
+ if (!isNotNil(cachedAsset)) {
2096
+ _context4.next = 3;
2097
+ break;
2098
+ }
2099
+
2100
+ return _context4.abrupt("return", cachedAsset);
2101
+
2102
+ case 3:
2103
+ return _context4.abrupt("return", loadAsset(assetId));
2104
+
2105
+ case 4:
2106
+ case "end":
2107
+ return _context4.stop();
2108
+ }
2109
+ }
2110
+ }, _callee4);
2111
+ }));
2112
+
2113
+ return function (_x4) {
2114
+ return _ref5.apply(this, arguments);
2115
+ };
2116
+ }(), [loadAsset, state.assets]);
2117
+ var loadContentfulEntry = useCallback( /*#__PURE__*/function () {
2118
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(urn) {
2119
+ var _locales$items$find;
2120
+
2121
+ var resourceId, _resourceId$split, spaceId, entryId, environmentId, _yield$Promise$all, space, entry, contentTypeId, _yield$Promise$all2, contentType, locales, defaultLocaleCode;
2122
+
2123
+ return runtime_1.wrap(function _callee5$(_context5) {
2124
+ while (1) {
2125
+ switch (_context5.prev = _context5.next) {
2126
+ case 0:
2127
+ resourceId = urn.split(':', 6)[5];
2128
+ _resourceId$split = resourceId.split('/'), spaceId = _resourceId$split[1], entryId = _resourceId$split[3];
2129
+ environmentId = 'master';
2130
+ _context5.t0 = Promise;
2131
+ _context5.next = 6;
2132
+ return cmaClient.space.get({
2133
+ spaceId: spaceId
2134
+ });
2135
+
2136
+ case 6:
2137
+ _context5.t1 = _context5.sent;
2138
+ _context5.next = 9;
2139
+ return cmaClient.entry.get({
2140
+ spaceId: spaceId,
2141
+ environmentId: environmentId,
2142
+ entryId: entryId
2143
+ });
2144
+
2145
+ case 9:
2146
+ _context5.t2 = _context5.sent;
2147
+ _context5.t3 = [_context5.t1, _context5.t2];
2148
+ _context5.next = 13;
2149
+ return _context5.t0.all.call(_context5.t0, _context5.t3);
2150
+
2151
+ case 13:
2152
+ _yield$Promise$all = _context5.sent;
2153
+ space = _yield$Promise$all[0];
2154
+ entry = _yield$Promise$all[1];
2155
+ contentTypeId = entry.sys.contentType.sys.id;
2156
+ _context5.t4 = Promise;
2157
+ _context5.next = 20;
2158
+ return cmaClient.contentType.get({
2159
+ contentTypeId: contentTypeId,
2160
+ spaceId: spaceId,
2161
+ environmentId: environmentId
2162
+ });
2163
+
2164
+ case 20:
2165
+ _context5.t5 = _context5.sent;
2166
+ _context5.next = 23;
2167
+ return cmaClient.locale.getMany({
2168
+ spaceId: spaceId,
2169
+ environmentId: environmentId,
2170
+ query: {
2171
+ limit: 100
2172
+ }
2173
+ });
2174
+
2175
+ case 23:
2176
+ _context5.t6 = _context5.sent;
2177
+ _context5.t7 = [_context5.t5, _context5.t6];
2178
+ _context5.next = 27;
2179
+ return _context5.t4.all.call(_context5.t4, _context5.t7);
2180
+
2181
+ case 27:
2182
+ _yield$Promise$all2 = _context5.sent;
2183
+ contentType = _yield$Promise$all2[0];
2184
+ locales = _yield$Promise$all2[1];
2185
+ defaultLocaleCode = (_locales$items$find = locales.items.find(function (locale) {
2186
+ return locale["default"];
2187
+ })) == null ? void 0 : _locales$items$find.code;
2188
+ return _context5.abrupt("return", {
2189
+ resource: entry,
2190
+ defaultLocaleCode: defaultLocaleCode,
2191
+ space: space,
2192
+ contentType: contentType
2193
+ });
2194
+
2195
+ case 32:
2196
+ case "end":
2197
+ return _context5.stop();
2198
+ }
2199
+ }
2200
+ }, _callee5);
2201
+ }));
2202
+
2203
+ return function (_x5) {
2204
+ return _ref6.apply(this, arguments);
2205
+ };
2206
+ }(), [cmaClient]);
2207
+ var getResource = useCallback( /*#__PURE__*/function () {
2208
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(resourceType, urn) {
2209
+ var cachedResource, resourceInfo;
2210
+ return runtime_1.wrap(function _callee6$(_context6) {
2211
+ while (1) {
2212
+ switch (_context6.prev = _context6.next) {
2213
+ case 0:
2214
+ cachedResource = state.resources[resourceType + "." + urn];
2215
+
2216
+ if (!isNotNil(cachedResource)) {
2217
+ _context6.next = 3;
2218
+ break;
2219
+ }
2220
+
2221
+ return _context6.abrupt("return", cachedResource);
2222
+
2223
+ case 3:
2224
+ _context6.prev = 3;
2225
+
2226
+ if (!(resourceType === 'Contentful:Entry')) {
2227
+ _context6.next = 8;
2228
+ break;
2229
+ }
2230
+
2231
+ _context6.next = 7;
2232
+ return loadContentfulEntry(urn);
2233
+
2234
+ case 7:
2235
+ resourceInfo = _context6.sent;
2236
+
2237
+ case 8:
2238
+ dispatch({
2239
+ type: 'set_resource',
2240
+ resourceType: resourceType,
2241
+ urn: urn,
2242
+ resourceInfo: resourceInfo
2243
+ });
2244
+ return _context6.abrupt("return", resourceInfo);
2245
+
2246
+ case 12:
2247
+ _context6.prev = 12;
2248
+ _context6.t0 = _context6["catch"](3);
2249
+ dispatch({
2250
+ type: 'set_resource_failed',
2251
+ resourceType: resourceType,
2252
+ urn: urn
2253
+ });
2254
+ return _context6.abrupt("return");
2255
+
2256
+ case 16:
2257
+ case "end":
2258
+ return _context6.stop();
2259
+ }
2260
+ }
2261
+ }, _callee6, null, [[3, 12]]);
2262
+ }));
2263
+
2264
+ return function (_x6, _x7) {
2265
+ return _ref7.apply(this, arguments);
2266
+ };
2267
+ }(), [loadContentfulEntry, state.resources]);
1936
2268
  useEffect(function () {
1937
2269
  // @ts-expect-error
1938
2270
  if (typeof props.sdk.space.onEntityChanged !== 'undefined') {
1939
2271
  // @ts-expect-error
1940
2272
  var onEntityChanged = props.sdk.space.onEntityChanged;
1941
2273
  var listeners = [];
1942
- Object.keys(state.entries).forEach(function (id) {
1943
- if (state.entries[id] && state.entries['id'] !== 'failed') {
1944
- listeners.push(onEntityChanged('Entry', id, function (entry) {
1945
- return dispatch({
1946
- type: 'set_entry',
1947
- id: id,
1948
- entry: entry
1949
- });
1950
- }));
1951
- }
1952
- });
1953
- Object.keys(state.assets).forEach(function (id) {
1954
- if (state.assets[id] && state.assets['id'] !== 'failed') {
1955
- listeners.push(onEntityChanged('Asset', id, function (asset) {
1956
- return dispatch({
1957
- type: 'set_asset',
1958
- id: id,
1959
- asset: asset
1960
- });
1961
- }));
1962
- }
1963
- });
2274
+
2275
+ var _loop = function _loop() {
2276
+ var _step$value = _step.value,
2277
+ id = _step$value[0];
2278
+ listeners.push(onEntityChanged('Entry', id, function (entry) {
2279
+ return dispatch({
2280
+ type: 'set_entry',
2281
+ id: id,
2282
+ entry: entry
2283
+ });
2284
+ }));
2285
+ };
2286
+
2287
+ for (var _iterator = _createForOfIteratorHelperLoose(nonNilResources(state.entries)), _step; !(_step = _iterator()).done;) {
2288
+ _loop();
2289
+ }
2290
+
2291
+ var _loop2 = function _loop2() {
2292
+ var _step2$value = _step2.value,
2293
+ id = _step2$value[0];
2294
+ listeners.push(onEntityChanged('Asset', id, function (asset) {
2295
+ return dispatch({
2296
+ type: 'set_asset',
2297
+ id: id,
2298
+ asset: asset
2299
+ });
2300
+ }));
2301
+ };
2302
+
2303
+ for (var _iterator2 = _createForOfIteratorHelperLoose(nonNilResources(state.assets)), _step2; !(_step2 = _iterator2()).done;) {
2304
+ _loop2();
2305
+ }
2306
+
1964
2307
  return function () {
1965
2308
  return listeners.forEach(function (off) {
1966
2309
  return off();
@@ -1968,29 +2311,46 @@ function useEntitiesStore(props) {
1968
2311
  };
1969
2312
  }
1970
2313
 
1971
- return props.sdk.navigator.onSlideInNavigation(function (_ref) {
1972
- var oldSlideLevel = _ref.oldSlideLevel,
1973
- newSlideLevel = _ref.newSlideLevel;
2314
+ return props.sdk.navigator.onSlideInNavigation(function (_ref8) {
2315
+ var oldSlideLevel = _ref8.oldSlideLevel,
2316
+ newSlideLevel = _ref8.newSlideLevel;
1974
2317
 
1975
2318
  if (oldSlideLevel > newSlideLevel) {
1976
- Object.keys(state.entries).map(function (id) {
1977
- if (state.entries[id] && state.entries[id] !== 'failed') {
1978
- loadEntry(id);
1979
- }
1980
- });
1981
- Object.keys(state.assets).map(function (id) {
1982
- if (state.assets[id] && state.assets[id] !== 'failed') {
1983
- loadAsset(id);
1984
- }
1985
- });
2319
+ for (var _iterator3 = _createForOfIteratorHelperLoose(nonNilResources(state.entries)), _step3; !(_step3 = _iterator3()).done;) {
2320
+ var _step3$value = _step3.value,
2321
+ id = _step3$value[0];
2322
+ loadEntry(id);
2323
+ }
2324
+
2325
+ for (var _iterator4 = _createForOfIteratorHelperLoose(nonNilResources(state.assets)), _step4; !(_step4 = _iterator4()).done;) {
2326
+ var _step4$value = _step4.value,
2327
+ _id = _step4$value[0];
2328
+ loadAsset(_id);
2329
+ }
1986
2330
  }
1987
2331
  }); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
1988
2332
  }, [props.sdk, state.assets, state.entries]);
1989
- return _extends({
1990
- getOrLoadEntry: getOrLoadEntry,
1991
- getOrLoadAsset: getOrLoadAsset,
1992
- loadEntityScheduledActions: loadEntityScheduledActions
1993
- }, state);
2333
+ return useMemo(function () {
2334
+ return {
2335
+ /**
2336
+ * @deprecated use `getEntry` instead
2337
+ */
2338
+ getOrLoadEntry: getEntry,
2339
+
2340
+ /**
2341
+ * @deprecated use `getAsset` instead
2342
+ */
2343
+ getOrLoadAsset: getAsset,
2344
+ getResource: getResource,
2345
+ getEntry: getEntry,
2346
+ getAsset: getAsset,
2347
+ loadEntityScheduledActions: loadEntityScheduledActions,
2348
+ entries: state.entries,
2349
+ assets: state.assets,
2350
+ scheduledActions: state.scheduledActions,
2351
+ resources: state.resources
2352
+ };
2353
+ }, [getResource, getEntry, getAsset, loadEntityScheduledActions, state.entries, state.assets, state.scheduledActions, state.resources]);
1994
2354
  }
1995
2355
 
1996
2356
  var _constate = /*#__PURE__*/constate(useEntitiesStore),
@@ -2660,13 +3020,13 @@ function _openEntry() {
2660
3020
 
2661
3021
  function FetchingWrappedEntryCard(props) {
2662
3022
  var _useEntities = useEntities(),
2663
- getOrLoadEntry = _useEntities.getOrLoadEntry,
2664
- getOrLoadAsset = _useEntities.getOrLoadAsset,
3023
+ getEntry = _useEntities.getEntry,
3024
+ getAsset = _useEntities.getAsset,
2665
3025
  loadEntityScheduledActions = _useEntities.loadEntityScheduledActions,
2666
3026
  entries = _useEntities.entries;
2667
3027
 
2668
3028
  useEffect(function () {
2669
- getOrLoadEntry(props.entryId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
3029
+ getEntry(props.entryId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
2670
3030
  }, [props.entryId]);
2671
3031
  var size = props.viewType === 'link' ? 'small' : 'default';
2672
3032
  var entry = entries[props.entryId];
@@ -2781,7 +3141,7 @@ function FetchingWrappedEntryCard(props) {
2781
3141
  hasCardEditActions: hasCardEditActions,
2782
3142
  hasCardMoveActions: hasCardMoveActions,
2783
3143
  hasCardRemoveActions: hasCardRemoveActions,
2784
- getAsset: getOrLoadAsset,
3144
+ getAsset: getAsset,
2785
3145
  getEntityScheduledActions: loadEntityScheduledActions,
2786
3146
  entry: (props == null ? void 0 : props.entity) || sharedCardProps.entity,
2787
3147
  entryUrl: (props == null ? void 0 : props.entityUrl) || sharedCardProps.entityUrl
@@ -2931,7 +3291,7 @@ MultipleReferenceEditor.defaultProps = {
2931
3291
  };
2932
3292
 
2933
3293
  var styles$3 = {
2934
- containter: /*#__PURE__*/css({
3294
+ container: /*#__PURE__*/css({
2935
3295
  position: 'relative'
2936
3296
  }),
2937
3297
  item: /*#__PURE__*/css({
@@ -2954,7 +3314,7 @@ var SortableLink = /*#__PURE__*/SortableElement(function (props) {
2954
3314
  var SortableLinkList = /*#__PURE__*/SortableContainer(function (props) {
2955
3315
  var lastIndex = props.items.length - 1;
2956
3316
  return React__default.createElement("div", {
2957
- className: styles$3.containter
3317
+ className: styles$3.container
2958
3318
  }, props.items.map(function (item, index) {
2959
3319
  return React__default.createElement(SortableLink, {
2960
3320
  disabled: props.isDisabled,
@@ -3226,12 +3586,12 @@ var WrappedAssetLink = function WrappedAssetLink(props) {
3226
3586
 
3227
3587
  function FetchingWrappedAssetCard(props) {
3228
3588
  var _useEntities = useEntities(),
3229
- getOrLoadAsset = _useEntities.getOrLoadAsset,
3589
+ getAsset = _useEntities.getAsset,
3230
3590
  loadEntityScheduledActions = _useEntities.loadEntityScheduledActions,
3231
3591
  assets = _useEntities.assets;
3232
3592
 
3233
3593
  useEffect(function () {
3234
- getOrLoadAsset(props.assetId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
3594
+ getAsset(props.assetId); // eslint-disable-next-line react-hooks/exhaustive-deps -- TODO: Evaluate the dependencies
3235
3595
  }, [props.assetId]);
3236
3596
  var asset = assets[props.assetId];
3237
3597
  var entityKey = asset === 'failed' ? 'failed' : asset === undefined ? 'undefined' : ":" + asset.sys.id + ":" + asset.sys.version;