@contentful/field-editor-rich-text 3.30.0 → 4.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.
@@ -84,7 +84,7 @@ function FetchingWrappedAssetCard(props) {
84
84
  getEntityScheduledActions,
85
85
  props.assetId
86
86
  ]);
87
- const localesStatusMap = (0, _fieldeditorshared.useAsyncLocalePublishStatus)(asset, props.sdk.parameters.instance.privateLocales);
87
+ const localesStatusMap = (0, _fieldeditorshared.useLocalePublishStatus)(asset, props.sdk.locales);
88
88
  _react.useEffect(()=>{
89
89
  if (status === 'success') {
90
90
  onEntityFetchComplete?.();
@@ -90,7 +90,7 @@ const FetchingWrappedEntryCard = (props)=>{
90
90
  getEntityScheduledActions,
91
91
  entryId
92
92
  ]);
93
- const localesStatusMap = (0, _fieldeditorshared.useAsyncLocalePublishStatus)(entry, props.sdk.parameters.instance.privateLocales);
93
+ const localesStatusMap = (0, _fieldeditorshared.useLocalePublishStatus)(entry, props.sdk.locales);
94
94
  _react.useEffect(()=>{
95
95
  if (status === 'success') {
96
96
  onEntityFetchComplete?.();
@@ -62,7 +62,13 @@ let sdk;
62
62
  beforeEach(()=>{
63
63
  sdk = {
64
64
  locales: {
65
- default: 'en-US'
65
+ default: 'en-US',
66
+ available: [
67
+ 'en-US'
68
+ ],
69
+ names: {
70
+ 'en-US': 'English (United States)'
71
+ }
66
72
  },
67
73
  cmaAdapter: (0, _fieldeditortestutils.createFakeCMAAdapter)({
68
74
  Asset: {
@@ -63,7 +63,13 @@ let sdk;
63
63
  beforeEach(()=>{
64
64
  sdk = {
65
65
  locales: {
66
- default: 'en-US'
66
+ default: 'en-US',
67
+ available: [
68
+ 'en-US'
69
+ ],
70
+ names: {
71
+ 'en-US': 'English (United States)'
72
+ }
67
73
  },
68
74
  cmaAdapter: (0, _fieldeditortestutils.createFakeCMAAdapter)({
69
75
  Entry: {
@@ -66,7 +66,13 @@ const unknownEntryUrn = 'crn:contentful:::content:spaces/space-id/entries/unknow
66
66
  beforeEach(()=>{
67
67
  sdk = {
68
68
  locales: {
69
- default: 'en-US'
69
+ default: 'en-US',
70
+ available: [
71
+ 'en-US'
72
+ ],
73
+ names: {
74
+ 'en-US': 'English (United States)'
75
+ }
70
76
  },
71
77
  cmaAdapter: (0, _fieldeditortestutils.createFakeCMAAdapter)({
72
78
  ContentType: {
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { AssetCard } from '@contentful/f36-components';
3
3
  import { useEntity, useEntityLoader, MissingEntityCard, WrappedAssetCard } from '@contentful/field-editor-reference';
4
- import { useAsyncLocalePublishStatus } from '@contentful/field-editor-shared';
4
+ import { useLocalePublishStatus } from '@contentful/field-editor-shared';
5
5
  import areEqual from 'fast-deep-equal';
6
6
  const InternalAssetCard = React.memo((props)=>React.createElement(WrappedAssetCard, {
7
7
  getEntityScheduledActions: props.loadEntityScheduledActions,
@@ -28,7 +28,7 @@ export function FetchingWrappedAssetCard(props) {
28
28
  getEntityScheduledActions,
29
29
  props.assetId
30
30
  ]);
31
- const localesStatusMap = useAsyncLocalePublishStatus(asset, props.sdk.parameters.instance.privateLocales);
31
+ const localesStatusMap = useLocalePublishStatus(asset, props.sdk.locales);
32
32
  React.useEffect(()=>{
33
33
  if (status === 'success') {
34
34
  onEntityFetchComplete?.();
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { EntryCard } from '@contentful/f36-components';
3
3
  import { useEntity, MissingEntityCard, WrappedEntryCard, useEntityLoader } from '@contentful/field-editor-reference';
4
- import { useAsyncLocalePublishStatus } from '@contentful/field-editor-shared';
4
+ import { useLocalePublishStatus } from '@contentful/field-editor-shared';
5
5
  import areEqual from 'fast-deep-equal';
6
6
  const InternalEntryCard = React.memo((props)=>{
7
7
  const { entry, sdk, loadEntityScheduledActions } = props;
@@ -34,7 +34,7 @@ export const FetchingWrappedEntryCard = (props)=>{
34
34
  getEntityScheduledActions,
35
35
  entryId
36
36
  ]);
37
- const localesStatusMap = useAsyncLocalePublishStatus(entry, props.sdk.parameters.instance.privateLocales);
37
+ const localesStatusMap = useLocalePublishStatus(entry, props.sdk.locales);
38
38
  React.useEffect(()=>{
39
39
  if (status === 'success') {
40
40
  onEntityFetchComplete?.();
@@ -12,7 +12,13 @@ let sdk;
12
12
  beforeEach(()=>{
13
13
  sdk = {
14
14
  locales: {
15
- default: 'en-US'
15
+ default: 'en-US',
16
+ available: [
17
+ 'en-US'
18
+ ],
19
+ names: {
20
+ 'en-US': 'English (United States)'
21
+ }
16
22
  },
17
23
  cmaAdapter: createFakeCMAAdapter({
18
24
  Asset: {
@@ -13,7 +13,13 @@ let sdk;
13
13
  beforeEach(()=>{
14
14
  sdk = {
15
15
  locales: {
16
- default: 'en-US'
16
+ default: 'en-US',
17
+ available: [
18
+ 'en-US'
19
+ ],
20
+ names: {
21
+ 'en-US': 'English (United States)'
22
+ }
17
23
  },
18
24
  cmaAdapter: createFakeCMAAdapter({
19
25
  Entry: {
@@ -16,7 +16,13 @@ const unknownEntryUrn = 'crn:contentful:::content:spaces/space-id/entries/unknow
16
16
  beforeEach(()=>{
17
17
  sdk = {
18
18
  locales: {
19
- default: 'en-US'
19
+ default: 'en-US',
20
+ available: [
21
+ 'en-US'
22
+ ],
23
+ names: {
24
+ 'en-US': 'English (United States)'
25
+ }
20
26
  },
21
27
  cmaAdapter: createFakeCMAAdapter({
22
28
  ContentType: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-rich-text",
3
- "version": "3.30.0",
3
+ "version": "4.0.0",
4
4
  "source": "./src/index.tsx",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -44,8 +44,8 @@
44
44
  "@contentful/f36-icons": "^4.29.0",
45
45
  "@contentful/f36-tokens": "^4.0.5",
46
46
  "@contentful/f36-utils": "^4.24.3",
47
- "@contentful/field-editor-reference": "^5.31.2",
48
- "@contentful/field-editor-shared": "^1.8.0",
47
+ "@contentful/field-editor-reference": "^6.0.0",
48
+ "@contentful/field-editor-shared": "^2.0.0",
49
49
  "@contentful/rich-text-plain-text-renderer": "^17.0.0",
50
50
  "@contentful/rich-text-types": "^17.0.0",
51
51
  "@popperjs/core": "^2.11.5",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "registry": "https://npm.pkg.github.com/"
88
88
  },
89
- "gitHead": "617172986bc02e431405a0e994bda361b6c4bf05"
89
+ "gitHead": "a06fd0066556b1f5ab6649ade3a75441e4792fd3"
90
90
  }