@contentful/field-editor-shared 4.1.2 → 4.1.3-canary.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.
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { LocaleProps,
|
|
2
|
+
import type { LocaleProps, ScheduledActionProps } from 'contentful-management';
|
|
3
3
|
import { LocalePublishStatusMap } from '../hooks/useLocalePublishStatus';
|
|
4
|
+
import * as entityHelpers from '../utils/entityHelpers';
|
|
4
5
|
type LocalePublishingPopoverProps = {
|
|
5
|
-
entity:
|
|
6
|
+
entity: {
|
|
7
|
+
sys: entityHelpers.EntitySys;
|
|
8
|
+
};
|
|
6
9
|
jobs: ScheduledActionProps[];
|
|
7
10
|
isScheduled: boolean;
|
|
8
11
|
activeLocales?: Pick<LocaleProps, 'code'>[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LocalesAPI } from '@contentful/app-sdk';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LocaleProps } from 'contentful-management';
|
|
3
|
+
import * as entityHelpers from '../utils/entityHelpers';
|
|
3
4
|
import { type SanitizedLocale } from '../utils/sanitizeLocales';
|
|
4
5
|
export type PublishStatus = 'draft' | 'published' | 'changed';
|
|
5
6
|
export type LocalePublishStatus = {
|
|
@@ -10,4 +11,6 @@ export type LocalePublishStatusMap = Map<string, LocalePublishStatus>;
|
|
|
10
11
|
/**
|
|
11
12
|
* Get the publish status for each locale
|
|
12
13
|
*/
|
|
13
|
-
export declare function useLocalePublishStatus(entity?:
|
|
14
|
+
export declare function useLocalePublishStatus(entity?: {
|
|
15
|
+
sys: entityHelpers.EntitySys;
|
|
16
|
+
}, locales?: Pick<LocalesAPI, 'available' | 'default' | 'names'> | LocaleProps[] | null): LocalePublishStatusMap | undefined;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { LocalesAPI } from '@contentful/app-sdk';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LocaleProps, ReleaseProps } from 'contentful-management';
|
|
3
3
|
import type { ReleaseEntityStatus, ReleaseStatusMap, ReleaseV2Props } from '../types';
|
|
4
|
+
import { type EntitySys } from '../utils/entityHelpers';
|
|
4
5
|
type UseActiveReleaseLocalesStatuses = {
|
|
5
|
-
entity?:
|
|
6
|
+
entity?: {
|
|
7
|
+
sys: EntitySys;
|
|
8
|
+
};
|
|
6
9
|
locales: LocaleProps[] | LocalesAPI;
|
|
7
10
|
release?: ReleaseProps | ReleaseV2Props;
|
|
8
|
-
previousEntityOnTimeline?:
|
|
11
|
+
previousEntityOnTimeline?: {
|
|
12
|
+
sys: EntitySys;
|
|
13
|
+
};
|
|
9
14
|
isReference?: boolean;
|
|
10
15
|
};
|
|
11
16
|
type UseRelaseStatus = {
|
|
@@ -56,8 +56,17 @@ export declare function getEntryTitle({ entry, contentType, localeCode, defaultL
|
|
|
56
56
|
defaultLocaleCode: string;
|
|
57
57
|
defaultTitle: string;
|
|
58
58
|
}): string;
|
|
59
|
-
export type EntitySys = Entry['sys'] | Asset['sys'];
|
|
60
59
|
type FieldStatus = 'draft' | 'published' | 'changed';
|
|
60
|
+
export type EntitySys = {
|
|
61
|
+
type: string;
|
|
62
|
+
id: string;
|
|
63
|
+
version: number;
|
|
64
|
+
publishedVersion?: number;
|
|
65
|
+
archivedVersion?: number;
|
|
66
|
+
deletedVersion?: number;
|
|
67
|
+
localeStatus?: Record<string, FieldStatus>;
|
|
68
|
+
fieldStatus?: Record<string, Record<string, FieldStatus>>;
|
|
69
|
+
};
|
|
61
70
|
/**
|
|
62
71
|
* Returns the status of the entry/asset
|
|
63
72
|
* If a locale code(s) is provided it will pick up the most advanced state for these locale(s)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-shared",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3-canary.0+94c361d0",
|
|
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": "94c361d0822d43a7e9162bf17074be8f1b86644d"
|
|
77
77
|
}
|