@contentful/field-editor-reference 5.1.4 → 5.1.7

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [5.1.7](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.1.6...@contentful/field-editor-reference@5.1.7) (2022-09-09)
7
+
8
+ **Note:** Version bump only for package @contentful/field-editor-reference
9
+
10
+ ## [5.1.6](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.1.5...@contentful/field-editor-reference@5.1.6) (2022-09-07)
11
+
12
+ ### Bug Fixes
13
+
14
+ - **reference-editor:** accept pubsub messages from alias and non-alias environments ([#1227](https://github.com/contentful/field-editors/issues/1227)) ([2d7d93a](https://github.com/contentful/field-editors/commit/2d7d93a2d3aa089f7ecdfec48c53c7839856ba0d))
15
+
16
+ ## [5.1.5](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.1.4...@contentful/field-editor-reference@5.1.5) (2022-09-06)
17
+
18
+ **Note:** Version bump only for package @contentful/field-editor-reference
19
+
6
20
  ## [5.1.4](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@5.1.3...@contentful/field-editor-reference@5.1.4) (2022-08-30)
7
21
 
8
22
  ### Bug Fixes
@@ -1,5 +1,5 @@
1
+ import { FieldExtensionSDK } from '@contentful/app-sdk';
1
2
  import { Emitter } from 'mitt';
2
- import { FieldExtensionSDK } from '../types';
3
3
  export declare type ReferenceEditorSdkProps = {
4
4
  initialValue?: any;
5
5
  validations?: any;
@@ -0,0 +1,6 @@
1
+ import changed from './changed_asset.json';
2
+ import created from './created_asset.json';
3
+ import empty from './empty_asset.json';
4
+ import invalid from './invalid_asset.json';
5
+ import published from './published_asset.json';
6
+ export { changed, empty, published, invalid, created };
@@ -0,0 +1,2 @@
1
+ import published from './published_content_type.json';
2
+ export { published };
@@ -0,0 +1,5 @@
1
+ import changed from './changed_entry.json';
2
+ import empty from './empty_entry.json';
3
+ import invalid from './invalid_entry.json';
4
+ import published from './published_entry.json';
5
+ export { changed, empty, published, invalid };
@@ -0,0 +1,6 @@
1
+ import * as assets from './asset';
2
+ import * as contentTypes from './content-type';
3
+ import * as entries from './entry';
4
+ import * as locales from './locale';
5
+ import * as spaces from './space';
6
+ export { assets, contentTypes, entries, locales, spaces };
@@ -0,0 +1,42 @@
1
+ import englishDefault from './english_default_locale.json';
2
+ import german from './german_locale.json';
3
+ declare const list: {
4
+ sys: {
5
+ type: string;
6
+ };
7
+ total: number;
8
+ skip: number;
9
+ limit: number;
10
+ items: {
11
+ sys: {
12
+ id: string;
13
+ type: string;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ version: number;
17
+ space: {
18
+ sys: {
19
+ type: string;
20
+ linkType: string;
21
+ id: string;
22
+ };
23
+ };
24
+ environment: {
25
+ sys: {
26
+ id: string;
27
+ type: string;
28
+ linkType: string;
29
+ };
30
+ };
31
+ };
32
+ name: string;
33
+ code: string;
34
+ internal_code: string;
35
+ fallbackCode: null;
36
+ contentDeliveryApi: boolean;
37
+ contentManagementApi: boolean;
38
+ default: boolean;
39
+ optional: boolean;
40
+ }[];
41
+ };
42
+ export { englishDefault, german, list };
@@ -0,0 +1,2 @@
1
+ import indifferent from './indifferent_space.json';
2
+ export { indifferent };
@@ -686,7 +686,8 @@ var squareCard = /*#__PURE__*/emotion.css({
686
686
 
687
687
  function MissingEntityCard(props) {
688
688
  return React__default.createElement(f36Components.Card, {
689
- className: card
689
+ className: card,
690
+ testId: "cf-ui-missing-entry-card"
690
691
  }, React__default.createElement(f36Components.Flex, {
691
692
  alignItems: "center",
692
693
  justifyContent: "space-between"
@@ -2058,6 +2059,9 @@ var _constate = /*#__PURE__*/constate(function useInitServices(props) {
2058
2059
 
2059
2060
  var currentSpaceId = props.sdk.ids.space;
2060
2061
  var currentEnvironmentId = (_props$sdk$ids$enviro = props.sdk.ids.environmentAlias) != null ? _props$sdk$ids$enviro : props.sdk.ids.environment;
2062
+ var environmentIds = React.useMemo(function () {
2063
+ return [props.sdk.ids.environmentAlias, props.sdk.ids.environment];
2064
+ }, [props.sdk.ids.environmentAlias, props.sdk.ids.environment]);
2061
2065
  var queryClient = reactQuery.useQueryClient();
2062
2066
  var queryCache = queryClient.getQueryCache();
2063
2067
  var entityChangeUnsubscribers = React.useRef({});
@@ -2212,9 +2216,9 @@ var _constate = /*#__PURE__*/constate(function useInitServices(props) {
2212
2216
  }, [fetch]);
2213
2217
  var isSameSpaceEntityQueryKey = React.useCallback(function (queryKey) {
2214
2218
  var isEntityKey = isEntityQueryKey(queryKey);
2215
- var isSameSpaceEntityKey = isEntityKey && queryKey[2] === currentSpaceId && queryKey[3] === currentEnvironmentId;
2219
+ var isSameSpaceEntityKey = isEntityKey && queryKey[2] === currentSpaceId && environmentIds.includes(queryKey[3]);
2216
2220
  return isSameSpaceEntityKey;
2217
- }, [currentSpaceId, currentEnvironmentId]); // @ts-expect-error ...
2221
+ }, [currentSpaceId, environmentIds]); // @ts-expect-error ...
2218
2222
 
2219
2223
  // @ts-expect-error ...
2220
2224
  var onEntityChanged = props.sdk.space.onEntityChanged;
@@ -2274,11 +2278,11 @@ var _constate = /*#__PURE__*/constate(function useInitServices(props) {
2274
2278
  };
2275
2279
  }, [onEntityChanged, queryCache, isSameSpaceEntityQueryKey, queryClient]);
2276
2280
  return {
2281
+ ids: props.sdk.ids,
2277
2282
  cmaClient: cmaClient,
2278
2283
  fetch: fetch,
2279
2284
  getResource: getResource,
2280
2285
  getEntity: getEntity,
2281
- ids: props.sdk.ids,
2282
2286
  getEntityScheduledActions: getEntityScheduledActions
2283
2287
  };
2284
2288
  }, function (_ref5) {
@@ -2294,8 +2298,13 @@ var _constate = /*#__PURE__*/constate(function useInitServices(props) {
2294
2298
  getEntityScheduledActions: getEntityScheduledActions
2295
2299
  };
2296
2300
  }, function (_ref7) {
2301
+ var _ids$environmentAlias;
2302
+
2297
2303
  var ids = _ref7.ids;
2298
- return ids;
2304
+ return {
2305
+ environment: (_ids$environmentAlias = ids.environmentAlias) != null ? _ids$environmentAlias : ids.environment,
2306
+ space: ids.space
2307
+ };
2299
2308
  }),
2300
2309
  InternalServiceProvider = _constate[0],
2301
2310
  useEntityLoader = _constate[2],