@contentful/field-editor-shared 1.8.0 → 2.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.
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- Object.defineProperty(exports, "useAsyncLocalePublishStatus", {
5
+ Object.defineProperty(exports, "useLocalePublishStatus", {
6
6
  enumerable: true,
7
7
  get: function() {
8
- return useAsyncLocalePublishStatus;
8
+ return useLocalePublishStatus;
9
9
  }
10
10
  });
11
11
  const _react = require("react");
@@ -51,7 +51,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
51
51
  }
52
52
  return newObj;
53
53
  }
54
- function getLocalePublishStatusMap(entity, locales) {
54
+ function getLocalePublishStatusMap(entity, localesApi) {
55
55
  const entityStatus = _entityHelpers.getEntityStatus(entity.sys);
56
56
  if ([
57
57
  'archived',
@@ -59,23 +59,39 @@ function getLocalePublishStatusMap(entity, locales) {
59
59
  ].includes(entityStatus)) {
60
60
  return;
61
61
  }
62
- const statusMap = new Map(locales.map((locale)=>[
63
- locale.code,
62
+ const statusMap = new Map(localesApi.available.map((localeCode)=>[
63
+ localeCode,
64
64
  {
65
- status: _entityHelpers.getEntityStatus(entity.sys, locale.code),
66
- locale
65
+ status: _entityHelpers.getEntityStatus(entity.sys, localeCode),
66
+ locale: {
67
+ code: localeCode,
68
+ default: localeCode === localesApi.default,
69
+ name: localesApi.names[localeCode]
70
+ }
67
71
  }
68
72
  ]));
69
73
  return statusMap;
70
74
  }
71
- function useAsyncLocalePublishStatus(entity, privateLocales) {
75
+ function useLocalePublishStatus(entity, locales) {
72
76
  return (0, _react.useMemo)(()=>{
73
- if (entity && privateLocales) {
74
- return getLocalePublishStatusMap(entity, privateLocales);
77
+ if (entity && locales) {
78
+ const localesApi = Array.isArray(locales) ? locales.reduce((api, locale)=>{
79
+ api.available.push(locale.code);
80
+ api.names[locale.code] = locale.name;
81
+ if (locale.default) {
82
+ api.default = locale.code;
83
+ }
84
+ return api;
85
+ }, {
86
+ available: [],
87
+ names: {},
88
+ default: ''
89
+ }) : locales;
90
+ return getLocalePublishStatusMap(entity, localesApi);
75
91
  }
76
92
  return undefined;
77
93
  }, [
78
94
  entity,
79
- privateLocales
95
+ locales
80
96
  ]);
81
97
  }
@@ -3,141 +3,45 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  const _reacthooks = require("@testing-library/react-hooks");
6
- const _useAsyncLocalePublishStatus = require("./useAsyncLocalePublishStatus");
7
- describe('useAsyncLocalePublishStatus', ()=>{
6
+ const _useLocalePublishStatus = require("./useLocalePublishStatus");
7
+ describe('useLocalePublishStatus', ()=>{
8
8
  const enUS = {
9
9
  code: 'en-US',
10
- name: 'en-US',
11
- internal_code: 'en-US',
12
- fallbackCode: null,
13
- default: false,
14
- contentManagementApi: true,
15
- contentDeliveryApi: true,
16
- optional: false,
17
- sys: {
18
- type: 'Locale',
19
- id: 'en-US',
20
- version: 1,
21
- space: {
22
- sys: {
23
- type: 'Link',
24
- linkType: 'Space',
25
- id: 'test-xokbvvklfw'
26
- }
27
- },
28
- environment: {
29
- sys: {
30
- type: 'Link',
31
- linkType: 'Environment',
32
- id: 'test-ak19mszr76'
33
- }
34
- },
35
- createdBy: {
36
- sys: {
37
- type: 'Link',
38
- linkType: 'User',
39
- id: 'test-0olok52c12'
40
- }
41
- },
42
- createdAt: '2017-01-23T10:17:55Z',
43
- updatedBy: {
44
- sys: {
45
- type: 'Link',
46
- linkType: 'User',
47
- id: 'test-0olok52c12'
48
- }
49
- },
50
- updatedAt: '2017-01-23T10:17:55Z'
51
- }
10
+ default: true,
11
+ name: 'English (US)'
52
12
  };
53
13
  const deDE = {
54
14
  code: 'de-DE',
55
- name: 'de-DE',
56
- internal_code: 'de-DE',
57
- fallbackCode: null,
58
15
  default: false,
59
- contentManagementApi: true,
60
- contentDeliveryApi: true,
61
- optional: false,
62
- sys: {
63
- type: 'Locale',
64
- id: 'de-DE',
65
- version: 1,
66
- space: {
67
- sys: {
68
- type: 'Link',
69
- linkType: 'Space',
70
- id: 'test-tnw0g6rujf'
71
- }
72
- },
73
- environment: {
74
- sys: {
75
- type: 'Link',
76
- linkType: 'Environment',
77
- id: 'test-wisyjo6pk4'
78
- }
79
- },
80
- createdBy: {
81
- sys: {
82
- type: 'Link',
83
- linkType: 'User',
84
- id: 'test-j63uqcmqlx'
85
- }
86
- },
87
- createdAt: '2017-01-23T10:17:55Z',
88
- updatedBy: {
89
- sys: {
90
- type: 'Link',
91
- linkType: 'User',
92
- id: 'test-j63uqcmqlx'
93
- }
94
- },
95
- updatedAt: '2017-01-23T10:17:55Z'
96
- }
16
+ name: 'German (Germany)'
97
17
  };
98
18
  const esES = {
99
19
  code: 'es-ES',
100
- name: 'es-ES',
101
- internal_code: 'es-ES',
102
- fallbackCode: null,
103
20
  default: false,
104
- contentManagementApi: true,
105
- contentDeliveryApi: true,
106
- optional: false,
107
- sys: {
108
- type: 'Locale',
109
- id: 'es-ES',
110
- version: 1,
111
- space: {
112
- sys: {
113
- type: 'Link',
114
- linkType: 'Space',
115
- id: 'test-h0e5p83kvo'
116
- }
117
- },
118
- environment: {
119
- sys: {
120
- type: 'Link',
121
- linkType: 'Environment',
122
- id: 'test-extqkvjiub'
123
- }
124
- },
125
- createdBy: {
126
- sys: {
127
- type: 'Link',
128
- linkType: 'User',
129
- id: 'test-1xpsnz99fa'
130
- }
131
- },
132
- createdAt: '2017-01-23T10:17:55Z',
133
- updatedBy: {
134
- sys: {
135
- type: 'Link',
136
- linkType: 'User',
137
- id: 'test-1xpsnz99fa'
138
- }
139
- },
140
- updatedAt: '2017-01-23T10:17:55Z'
21
+ name: 'Spanish (Spain)'
22
+ };
23
+ const localesAPI = {
24
+ available: [
25
+ enUS.code,
26
+ deDE.code,
27
+ esES.code
28
+ ],
29
+ default: enUS.code,
30
+ names: {
31
+ [enUS.code]: enUS.name,
32
+ [deDE.code]: deDE.name,
33
+ [esES.code]: esES.name
34
+ },
35
+ fallbacks: {},
36
+ optional: {
37
+ [enUS.code]: false,
38
+ [deDE.code]: true,
39
+ [esES.code]: true
40
+ },
41
+ direction: {
42
+ [enUS.code]: 'ltr',
43
+ [deDE.code]: 'ltr',
44
+ [esES.code]: 'ltr'
141
45
  }
142
46
  };
143
47
  describe('status from entity', ()=>{
@@ -199,11 +103,7 @@ describe('useAsyncLocalePublishStatus', ()=>{
199
103
  },
200
104
  fields: {}
201
105
  };
202
- const { result } = (0, _reacthooks.renderHook)(()=>(0, _useAsyncLocalePublishStatus.useAsyncLocalePublishStatus)(entity, [
203
- enUS,
204
- deDE,
205
- esES
206
- ]));
106
+ const { result } = (0, _reacthooks.renderHook)(()=>(0, _useLocalePublishStatus.useLocalePublishStatus)(entity, localesAPI));
207
107
  expect(result.current).toEqual(new Map([
208
108
  [
209
109
  'en-US',
@@ -294,11 +194,7 @@ describe('useAsyncLocalePublishStatus', ()=>{
294
194
  }
295
195
  }
296
196
  };
297
- const { result } = (0, _reacthooks.renderHook)(()=>(0, _useAsyncLocalePublishStatus.useAsyncLocalePublishStatus)(entity, [
298
- enUS,
299
- deDE,
300
- esES
301
- ]));
197
+ const { result } = (0, _reacthooks.renderHook)(()=>(0, _useLocalePublishStatus.useLocalePublishStatus)(entity, localesAPI));
302
198
  expect(result.current).toEqual(new Map([
303
199
  [
304
200
  'en-US',
@@ -375,11 +271,7 @@ describe('useAsyncLocalePublishStatus', ()=>{
375
271
  },
376
272
  fields: {}
377
273
  };
378
- const { result } = (0, _reacthooks.renderHook)(()=>(0, _useAsyncLocalePublishStatus.useAsyncLocalePublishStatus)(entity, [
379
- enUS,
380
- deDE,
381
- esES
382
- ]));
274
+ const { result } = (0, _reacthooks.renderHook)(()=>(0, _useLocalePublishStatus.useLocalePublishStatus)(entity, localesAPI));
383
275
  expect(result.current).toEqual(new Map([
384
276
  [
385
277
  'en-US',
@@ -405,11 +297,7 @@ describe('useAsyncLocalePublishStatus', ()=>{
405
297
  ]));
406
298
  });
407
299
  it('returns undefined as publishStatus if there is no entity provided', ()=>{
408
- const { result } = (0, _reacthooks.renderHook)(()=>(0, _useAsyncLocalePublishStatus.useAsyncLocalePublishStatus)(undefined, [
409
- enUS,
410
- deDE,
411
- esES
412
- ]));
300
+ const { result } = (0, _reacthooks.renderHook)(()=>(0, _useLocalePublishStatus.useLocalePublishStatus)(undefined, localesAPI));
413
301
  expect(result.current).toBeUndefined();
414
302
  });
415
303
  });
package/dist/cjs/index.js CHANGED
@@ -111,7 +111,7 @@ const _PredefinedValuesError = require("./PredefinedValuesError");
111
111
  const _typesEntity = require("./typesEntity");
112
112
  const _isValidImage = require("./utils/isValidImage");
113
113
  const _shortenStorageUnit = require("./utils/shortenStorageUnit");
114
- _export_star(require("./hooks/useAsyncLocalePublishStatus"), exports);
114
+ _export_star(require("./hooks/useLocalePublishStatus"), exports);
115
115
  _export_star(require("./LocalePublishingEntityStatusBadge"), exports);
116
116
  const _ModalDialogLauncher = _interop_require_wildcard(require("./ModalDialogLauncher"));
117
117
  const _constraints = _interop_require_wildcard(require("./utils/constraints"));
@@ -0,0 +1,46 @@
1
+ import { useMemo } from 'react';
2
+ import * as entityHelpers from '../utils/entityHelpers';
3
+ function getLocalePublishStatusMap(entity, localesApi) {
4
+ const entityStatus = entityHelpers.getEntityStatus(entity.sys);
5
+ if ([
6
+ 'archived',
7
+ 'deleted'
8
+ ].includes(entityStatus)) {
9
+ return;
10
+ }
11
+ const statusMap = new Map(localesApi.available.map((localeCode)=>[
12
+ localeCode,
13
+ {
14
+ status: entityHelpers.getEntityStatus(entity.sys, localeCode),
15
+ locale: {
16
+ code: localeCode,
17
+ default: localeCode === localesApi.default,
18
+ name: localesApi.names[localeCode]
19
+ }
20
+ }
21
+ ]));
22
+ return statusMap;
23
+ }
24
+ export function useLocalePublishStatus(entity, locales) {
25
+ return useMemo(()=>{
26
+ if (entity && locales) {
27
+ const localesApi = Array.isArray(locales) ? locales.reduce((api, locale)=>{
28
+ api.available.push(locale.code);
29
+ api.names[locale.code] = locale.name;
30
+ if (locale.default) {
31
+ api.default = locale.code;
32
+ }
33
+ return api;
34
+ }, {
35
+ available: [],
36
+ names: {},
37
+ default: ''
38
+ }) : locales;
39
+ return getLocalePublishStatusMap(entity, localesApi);
40
+ }
41
+ return undefined;
42
+ }, [
43
+ entity,
44
+ locales
45
+ ]);
46
+ }
@@ -1,139 +1,43 @@
1
1
  import { renderHook } from '@testing-library/react-hooks';
2
- import { useAsyncLocalePublishStatus } from './useAsyncLocalePublishStatus';
3
- describe('useAsyncLocalePublishStatus', ()=>{
2
+ import { useLocalePublishStatus } from './useLocalePublishStatus';
3
+ describe('useLocalePublishStatus', ()=>{
4
4
  const enUS = {
5
5
  code: 'en-US',
6
- name: 'en-US',
7
- internal_code: 'en-US',
8
- fallbackCode: null,
9
- default: false,
10
- contentManagementApi: true,
11
- contentDeliveryApi: true,
12
- optional: false,
13
- sys: {
14
- type: 'Locale',
15
- id: 'en-US',
16
- version: 1,
17
- space: {
18
- sys: {
19
- type: 'Link',
20
- linkType: 'Space',
21
- id: 'test-xokbvvklfw'
22
- }
23
- },
24
- environment: {
25
- sys: {
26
- type: 'Link',
27
- linkType: 'Environment',
28
- id: 'test-ak19mszr76'
29
- }
30
- },
31
- createdBy: {
32
- sys: {
33
- type: 'Link',
34
- linkType: 'User',
35
- id: 'test-0olok52c12'
36
- }
37
- },
38
- createdAt: '2017-01-23T10:17:55Z',
39
- updatedBy: {
40
- sys: {
41
- type: 'Link',
42
- linkType: 'User',
43
- id: 'test-0olok52c12'
44
- }
45
- },
46
- updatedAt: '2017-01-23T10:17:55Z'
47
- }
6
+ default: true,
7
+ name: 'English (US)'
48
8
  };
49
9
  const deDE = {
50
10
  code: 'de-DE',
51
- name: 'de-DE',
52
- internal_code: 'de-DE',
53
- fallbackCode: null,
54
11
  default: false,
55
- contentManagementApi: true,
56
- contentDeliveryApi: true,
57
- optional: false,
58
- sys: {
59
- type: 'Locale',
60
- id: 'de-DE',
61
- version: 1,
62
- space: {
63
- sys: {
64
- type: 'Link',
65
- linkType: 'Space',
66
- id: 'test-tnw0g6rujf'
67
- }
68
- },
69
- environment: {
70
- sys: {
71
- type: 'Link',
72
- linkType: 'Environment',
73
- id: 'test-wisyjo6pk4'
74
- }
75
- },
76
- createdBy: {
77
- sys: {
78
- type: 'Link',
79
- linkType: 'User',
80
- id: 'test-j63uqcmqlx'
81
- }
82
- },
83
- createdAt: '2017-01-23T10:17:55Z',
84
- updatedBy: {
85
- sys: {
86
- type: 'Link',
87
- linkType: 'User',
88
- id: 'test-j63uqcmqlx'
89
- }
90
- },
91
- updatedAt: '2017-01-23T10:17:55Z'
92
- }
12
+ name: 'German (Germany)'
93
13
  };
94
14
  const esES = {
95
15
  code: 'es-ES',
96
- name: 'es-ES',
97
- internal_code: 'es-ES',
98
- fallbackCode: null,
99
16
  default: false,
100
- contentManagementApi: true,
101
- contentDeliveryApi: true,
102
- optional: false,
103
- sys: {
104
- type: 'Locale',
105
- id: 'es-ES',
106
- version: 1,
107
- space: {
108
- sys: {
109
- type: 'Link',
110
- linkType: 'Space',
111
- id: 'test-h0e5p83kvo'
112
- }
113
- },
114
- environment: {
115
- sys: {
116
- type: 'Link',
117
- linkType: 'Environment',
118
- id: 'test-extqkvjiub'
119
- }
120
- },
121
- createdBy: {
122
- sys: {
123
- type: 'Link',
124
- linkType: 'User',
125
- id: 'test-1xpsnz99fa'
126
- }
127
- },
128
- createdAt: '2017-01-23T10:17:55Z',
129
- updatedBy: {
130
- sys: {
131
- type: 'Link',
132
- linkType: 'User',
133
- id: 'test-1xpsnz99fa'
134
- }
135
- },
136
- updatedAt: '2017-01-23T10:17:55Z'
17
+ name: 'Spanish (Spain)'
18
+ };
19
+ const localesAPI = {
20
+ available: [
21
+ enUS.code,
22
+ deDE.code,
23
+ esES.code
24
+ ],
25
+ default: enUS.code,
26
+ names: {
27
+ [enUS.code]: enUS.name,
28
+ [deDE.code]: deDE.name,
29
+ [esES.code]: esES.name
30
+ },
31
+ fallbacks: {},
32
+ optional: {
33
+ [enUS.code]: false,
34
+ [deDE.code]: true,
35
+ [esES.code]: true
36
+ },
37
+ direction: {
38
+ [enUS.code]: 'ltr',
39
+ [deDE.code]: 'ltr',
40
+ [esES.code]: 'ltr'
137
41
  }
138
42
  };
139
43
  describe('status from entity', ()=>{
@@ -195,11 +99,7 @@ describe('useAsyncLocalePublishStatus', ()=>{
195
99
  },
196
100
  fields: {}
197
101
  };
198
- const { result } = renderHook(()=>useAsyncLocalePublishStatus(entity, [
199
- enUS,
200
- deDE,
201
- esES
202
- ]));
102
+ const { result } = renderHook(()=>useLocalePublishStatus(entity, localesAPI));
203
103
  expect(result.current).toEqual(new Map([
204
104
  [
205
105
  'en-US',
@@ -290,11 +190,7 @@ describe('useAsyncLocalePublishStatus', ()=>{
290
190
  }
291
191
  }
292
192
  };
293
- const { result } = renderHook(()=>useAsyncLocalePublishStatus(entity, [
294
- enUS,
295
- deDE,
296
- esES
297
- ]));
193
+ const { result } = renderHook(()=>useLocalePublishStatus(entity, localesAPI));
298
194
  expect(result.current).toEqual(new Map([
299
195
  [
300
196
  'en-US',
@@ -371,11 +267,7 @@ describe('useAsyncLocalePublishStatus', ()=>{
371
267
  },
372
268
  fields: {}
373
269
  };
374
- const { result } = renderHook(()=>useAsyncLocalePublishStatus(entity, [
375
- enUS,
376
- deDE,
377
- esES
378
- ]));
270
+ const { result } = renderHook(()=>useLocalePublishStatus(entity, localesAPI));
379
271
  expect(result.current).toEqual(new Map([
380
272
  [
381
273
  'en-US',
@@ -401,11 +293,7 @@ describe('useAsyncLocalePublishStatus', ()=>{
401
293
  ]));
402
294
  });
403
295
  it('returns undefined as publishStatus if there is no entity provided', ()=>{
404
- const { result } = renderHook(()=>useAsyncLocalePublishStatus(undefined, [
405
- enUS,
406
- deDE,
407
- esES
408
- ]));
296
+ const { result } = renderHook(()=>useLocalePublishStatus(undefined, localesAPI));
409
297
  expect(result.current).toBeUndefined();
410
298
  });
411
299
  });
package/dist/esm/index.js CHANGED
@@ -6,7 +6,7 @@ export { PredefinedValuesError } from './PredefinedValuesError';
6
6
  export { Asset, Entry, File } from './typesEntity';
7
7
  export { isValidImage } from './utils/isValidImage';
8
8
  export { shortenStorageUnit, toLocaleString } from './utils/shortenStorageUnit';
9
- export * from './hooks/useAsyncLocalePublishStatus';
9
+ export * from './hooks/useLocalePublishStatus';
10
10
  export { ModalDialogLauncher };
11
11
  export { entityHelpers };
12
12
  export { ConstraintsUtils };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { LocaleProps, EntryProps, AssetProps, ScheduledActionProps } from 'contentful-management';
3
- import { LocalePublishStatusMap } from '../hooks/useAsyncLocalePublishStatus';
3
+ import { LocalePublishStatusMap } from '../hooks/useLocalePublishStatus';
4
4
  type LocalePublishingPopoverProps = {
5
5
  entity: EntryProps | AssetProps;
6
6
  jobs: ScheduledActionProps[];
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { LocaleProps } from 'contentful-management';
3
3
  type LocalePublishingStatusProps = {
4
- locale: LocaleProps;
4
+ locale: Pick<LocaleProps, 'code' | 'default' | 'name'>;
5
5
  status: 'draft' | 'published' | 'changed';
6
6
  isScheduled: boolean;
7
7
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { LocaleProps } from 'contentful-management';
3
- import type { LocalePublishStatusMap } from '../hooks/useAsyncLocalePublishStatus';
3
+ import type { LocalePublishStatusMap } from '../hooks/useLocalePublishStatus';
4
4
  type LocalePublishingStatusListProps = {
5
5
  isScheduled: boolean;
6
6
  statusMap: LocalePublishStatusMap;
@@ -0,0 +1,11 @@
1
+ import type { LocalesAPI } from '@contentful/app-sdk';
2
+ import type { AssetProps, EntryProps, LocaleProps } from 'contentful-management/types';
3
+ export type LocalePublishStatus = {
4
+ status: 'draft' | 'published' | 'changed';
5
+ locale: Pick<LocaleProps, 'code' | 'default' | 'name'>;
6
+ };
7
+ export type LocalePublishStatusMap = Map<string, LocalePublishStatus>;
8
+ /**
9
+ * Get the publish status for each locale
10
+ */
11
+ export declare function useLocalePublishStatus(entity?: AssetProps | EntryProps, locales?: Pick<LocalesAPI, 'available' | 'default' | 'names'> | LocaleProps[] | null): LocalePublishStatusMap | undefined;
@@ -7,7 +7,7 @@ export { PredefinedValuesError } from './PredefinedValuesError';
7
7
  export { Asset, Entry, File } from './typesEntity';
8
8
  export { isValidImage } from './utils/isValidImage';
9
9
  export { shortenStorageUnit, toLocaleString } from './utils/shortenStorageUnit';
10
- export * from './hooks/useAsyncLocalePublishStatus';
10
+ export * from './hooks/useLocalePublishStatus';
11
11
  export { ModalDialogLauncher };
12
12
  export { entityHelpers };
13
13
  export { ConstraintsUtils };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-shared",
3
- "version": "1.8.0",
3
+ "version": "2.0.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "registry": "https://npm.pkg.github.com/"
57
57
  },
58
- "gitHead": "afd5e2f336925d0b1eefbf19b716d66abc37f672"
58
+ "gitHead": "a06fd0066556b1f5ab6649ade3a75441e4792fd3"
59
59
  }
@@ -1,30 +0,0 @@
1
- import { useMemo } from 'react';
2
- import * as entityHelpers from '../utils/entityHelpers';
3
- function getLocalePublishStatusMap(entity, locales) {
4
- const entityStatus = entityHelpers.getEntityStatus(entity.sys);
5
- if ([
6
- 'archived',
7
- 'deleted'
8
- ].includes(entityStatus)) {
9
- return;
10
- }
11
- const statusMap = new Map(locales.map((locale)=>[
12
- locale.code,
13
- {
14
- status: entityHelpers.getEntityStatus(entity.sys, locale.code),
15
- locale
16
- }
17
- ]));
18
- return statusMap;
19
- }
20
- export function useAsyncLocalePublishStatus(entity, privateLocales) {
21
- return useMemo(()=>{
22
- if (entity && privateLocales) {
23
- return getLocalePublishStatusMap(entity, privateLocales);
24
- }
25
- return undefined;
26
- }, [
27
- entity,
28
- privateLocales
29
- ]);
30
- }
@@ -1,10 +0,0 @@
1
- import type { AssetProps, EntryProps, LocaleProps } from 'contentful-management/types';
2
- export type LocalePublishStatus = {
3
- status: 'draft' | 'published' | 'changed';
4
- locale: LocaleProps;
5
- };
6
- export type LocalePublishStatusMap = Map<string, LocalePublishStatus>;
7
- /**
8
- * Get the publish status for each locale
9
- */
10
- export declare function useAsyncLocalePublishStatus(entity?: AssetProps | EntryProps, privateLocales?: LocaleProps[] | null): LocalePublishStatusMap | undefined;