@contentful/field-editor-shared 4.1.3-canary.0 → 4.1.3-canary.1
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/dist/cjs/LocalePublishingEntityStatusBadge/LocalePublishingPopover.js +2 -2
- package/dist/cjs/hooks/useLocalePublishStatus.js +3 -44
- package/dist/esm/LocalePublishingEntityStatusBadge/LocalePublishingPopover.js +2 -2
- package/dist/esm/hooks/useLocalePublishStatus.js +3 -3
- package/dist/types/LocalePublishingEntityStatusBadge/LocalePublishingPopover.d.ts +2 -2
- package/dist/types/hooks/useLocalePublishStatus.d.ts +2 -2
- package/package.json +2 -2
|
@@ -13,7 +13,7 @@ const _f36components = require("@contentful/f36-components");
|
|
|
13
13
|
const _f36icons = require("@contentful/f36-icons");
|
|
14
14
|
const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
|
|
15
15
|
const _css = require("@emotion/css");
|
|
16
|
-
const _entityHelpers =
|
|
16
|
+
const _entityHelpers = require("../utils/entityHelpers");
|
|
17
17
|
const _LocalePublishingStatusList = require("./LocalePublishingStatusList");
|
|
18
18
|
const _ScheduledBanner = require("./ScheduledBanner");
|
|
19
19
|
function _interop_require_default(obj) {
|
|
@@ -232,7 +232,7 @@ function LocalePublishingPopover({ entity, jobs, isScheduled, localesStatusMap,
|
|
|
232
232
|
setIsOpen(false);
|
|
233
233
|
}, 300);
|
|
234
234
|
}, []);
|
|
235
|
-
const entityStatus = _entityHelpers.getEntityStatus(entity.sys, activeLocales?.map((locale)=>locale.code));
|
|
235
|
+
const entityStatus = (0, _entityHelpers.getEntityStatus)(entity.sys, activeLocales?.map((locale)=>locale.code));
|
|
236
236
|
if ([
|
|
237
237
|
'archived',
|
|
238
238
|
'deleted'
|
|
@@ -9,51 +9,10 @@ Object.defineProperty(exports, "useLocalePublishStatus", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _react = require("react");
|
|
12
|
-
const _entityHelpers =
|
|
12
|
+
const _entityHelpers = require("../utils/entityHelpers");
|
|
13
13
|
const _sanitizeLocales = require("../utils/sanitizeLocales");
|
|
14
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
15
|
-
if (typeof WeakMap !== "function") return null;
|
|
16
|
-
var cacheBabelInterop = new WeakMap();
|
|
17
|
-
var cacheNodeInterop = new WeakMap();
|
|
18
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
19
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
20
|
-
})(nodeInterop);
|
|
21
|
-
}
|
|
22
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
23
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
24
|
-
return obj;
|
|
25
|
-
}
|
|
26
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
27
|
-
return {
|
|
28
|
-
default: obj
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
32
|
-
if (cache && cache.has(obj)) {
|
|
33
|
-
return cache.get(obj);
|
|
34
|
-
}
|
|
35
|
-
var newObj = {
|
|
36
|
-
__proto__: null
|
|
37
|
-
};
|
|
38
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
39
|
-
for(var key in obj){
|
|
40
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
41
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
42
|
-
if (desc && (desc.get || desc.set)) {
|
|
43
|
-
Object.defineProperty(newObj, key, desc);
|
|
44
|
-
} else {
|
|
45
|
-
newObj[key] = obj[key];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
newObj.default = obj;
|
|
50
|
-
if (cache) {
|
|
51
|
-
cache.set(obj, newObj);
|
|
52
|
-
}
|
|
53
|
-
return newObj;
|
|
54
|
-
}
|
|
55
14
|
function getLocalePublishStatusMap(entity, locales) {
|
|
56
|
-
const entityStatus = _entityHelpers.getEntityStatus(entity.sys);
|
|
15
|
+
const entityStatus = (0, _entityHelpers.getEntityStatus)(entity.sys);
|
|
57
16
|
if ([
|
|
58
17
|
'archived',
|
|
59
18
|
'deleted'
|
|
@@ -63,7 +22,7 @@ function getLocalePublishStatusMap(entity, locales) {
|
|
|
63
22
|
const statusMap = new Map(locales.map((locale)=>[
|
|
64
23
|
locale.code,
|
|
65
24
|
{
|
|
66
|
-
status: _entityHelpers.getEntityStatus(entity.sys, locale.code),
|
|
25
|
+
status: (0, _entityHelpers.getEntityStatus)(entity.sys, locale.code),
|
|
67
26
|
locale
|
|
68
27
|
}
|
|
69
28
|
]));
|
|
@@ -3,7 +3,7 @@ import { EntityStatusBadge, Flex, Popover } from '@contentful/f36-components';
|
|
|
3
3
|
import { CaretDownIcon } from '@contentful/f36-icons';
|
|
4
4
|
import tokens from '@contentful/f36-tokens';
|
|
5
5
|
import { cx, css } from '@emotion/css';
|
|
6
|
-
import
|
|
6
|
+
import { getEntityStatus } from '../utils/entityHelpers';
|
|
7
7
|
import { LocalePublishingStatusList } from './LocalePublishingStatusList';
|
|
8
8
|
import { ScheduledBanner } from './ScheduledBanner';
|
|
9
9
|
const colors = {
|
|
@@ -176,7 +176,7 @@ export function LocalePublishingPopover({ entity, jobs, isScheduled, localesStat
|
|
|
176
176
|
setIsOpen(false);
|
|
177
177
|
}, 300);
|
|
178
178
|
}, []);
|
|
179
|
-
const entityStatus =
|
|
179
|
+
const entityStatus = getEntityStatus(entity.sys, activeLocales?.map((locale)=>locale.code));
|
|
180
180
|
if ([
|
|
181
181
|
'archived',
|
|
182
182
|
'deleted'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { getEntityStatus } from '../utils/entityHelpers';
|
|
3
3
|
import { sanitizeLocales } from '../utils/sanitizeLocales';
|
|
4
4
|
function getLocalePublishStatusMap(entity, locales) {
|
|
5
|
-
const entityStatus =
|
|
5
|
+
const entityStatus = getEntityStatus(entity.sys);
|
|
6
6
|
if ([
|
|
7
7
|
'archived',
|
|
8
8
|
'deleted'
|
|
@@ -12,7 +12,7 @@ function getLocalePublishStatusMap(entity, locales) {
|
|
|
12
12
|
const statusMap = new Map(locales.map((locale)=>[
|
|
13
13
|
locale.code,
|
|
14
14
|
{
|
|
15
|
-
status:
|
|
15
|
+
status: getEntityStatus(entity.sys, locale.code),
|
|
16
16
|
locale
|
|
17
17
|
}
|
|
18
18
|
]));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LocaleProps, ScheduledActionProps } from 'contentful-management';
|
|
3
3
|
import { LocalePublishStatusMap } from '../hooks/useLocalePublishStatus';
|
|
4
|
-
import
|
|
4
|
+
import { type EntitySys } from '../utils/entityHelpers';
|
|
5
5
|
type LocalePublishingPopoverProps = {
|
|
6
6
|
entity: {
|
|
7
|
-
sys:
|
|
7
|
+
sys: EntitySys;
|
|
8
8
|
};
|
|
9
9
|
jobs: ScheduledActionProps[];
|
|
10
10
|
isScheduled: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LocalesAPI } from '@contentful/app-sdk';
|
|
2
2
|
import type { LocaleProps } from 'contentful-management';
|
|
3
|
-
import
|
|
3
|
+
import { type EntitySys } from '../utils/entityHelpers';
|
|
4
4
|
import { type SanitizedLocale } from '../utils/sanitizeLocales';
|
|
5
5
|
export type PublishStatus = 'draft' | 'published' | 'changed';
|
|
6
6
|
export type LocalePublishStatus = {
|
|
@@ -12,5 +12,5 @@ export type LocalePublishStatusMap = Map<string, LocalePublishStatus>;
|
|
|
12
12
|
* Get the publish status for each locale
|
|
13
13
|
*/
|
|
14
14
|
export declare function useLocalePublishStatus(entity?: {
|
|
15
|
-
sys:
|
|
15
|
+
sys: EntitySys;
|
|
16
16
|
}, locales?: Pick<LocalesAPI, 'available' | 'default' | 'names'> | LocaleProps[] | null): LocalePublishStatusMap | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-shared",
|
|
3
|
-
"version": "4.1.3-canary.
|
|
3
|
+
"version": "4.1.3-canary.1+99843a25",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"registry": "https://npm.pkg.github.com/"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "99843a25cc18647a09aafae8c9d2e656dd26883a"
|
|
77
77
|
}
|