@contentful/field-editor-reference 4.3.11 → 4.5.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/CHANGELOG.md +18 -0
- package/dist/__fixtures__/FakeSdk.d.ts +20 -151
- package/dist/assets/WrappedAssetCard/FetchingWrappedAssetCard.d.ts +1 -1
- package/dist/common/EntityStore.d.ts +7 -1
- package/dist/common/SortableLinkList.d.ts +19 -0
- package/dist/components/SpaceName/SpaceName.d.ts +6 -0
- package/dist/entries/WrappedEntryCard/FetchingWrappedEntryCard.d.ts +2 -2
- package/dist/entries/WrappedEntryCard/WrappedEntryCard.d.ts +1 -0
- package/dist/field-editor-reference.cjs.development.js +553 -175
- package/dist/field-editor-reference.cjs.development.js.map +1 -1
- package/dist/field-editor-reference.cjs.production.min.js +1 -1
- package/dist/field-editor-reference.cjs.production.min.js.map +1 -1
- package/dist/field-editor-reference.esm.js +556 -179
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/types.d.ts +29 -1
- package/package.json +4 -3
- package/dist/assets/SortableElements.d.ts +0 -8
- package/dist/entries/SortableElements.d.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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
|
+
## [4.5.1](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.5.0...@contentful/field-editor-reference@4.5.1) (2022-07-12)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- generalise SortableLinkList into one component ([#1183](https://github.com/contentful/field-editors/issues/1183)) ([83117b0](https://github.com/contentful/field-editors/commit/83117b005ec93ef5481eb137a87733ae96c45d54))
|
|
11
|
+
|
|
12
|
+
# [4.5.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.4.0...@contentful/field-editor-reference@4.5.0) (2022-07-11)
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add simple fetching for resources ([#1179](https://github.com/contentful/field-editors/issues/1179)) ([b29daac](https://github.com/contentful/field-editors/commit/b29daac6460f93a4350bf45f90ae938f65de96ee))
|
|
17
|
+
|
|
18
|
+
# [4.4.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.11...@contentful/field-editor-reference@4.4.0) (2022-07-06)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- add optional space name to entry card ([#1176](https://github.com/contentful/field-editors/issues/1176)) ([62fae44](https://github.com/contentful/field-editors/commit/62fae44a63ad29597acf6ae0ba7f15373b1045c0))
|
|
23
|
+
|
|
6
24
|
## [4.3.11](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.10...@contentful/field-editor-reference@4.3.11) (2022-06-30)
|
|
7
25
|
|
|
8
26
|
### Bug Fixes
|
|
@@ -2,145 +2,8 @@ import { FieldAPI, Link } from '@contentful/app-sdk';
|
|
|
2
2
|
export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
|
|
3
3
|
field: FieldAPI;
|
|
4
4
|
locales: import("@contentful/app-sdk").LocalesAPI;
|
|
5
|
+
cmaAdapter: import("contentful-management").Adapter;
|
|
5
6
|
space: {
|
|
6
|
-
getAsset: (id: string) => Promise<{
|
|
7
|
-
sys: {
|
|
8
|
-
space: {
|
|
9
|
-
sys: {
|
|
10
|
-
type: string;
|
|
11
|
-
linkType: string;
|
|
12
|
-
id: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
id: string;
|
|
16
|
-
type: string;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
updatedAt: string;
|
|
19
|
-
environment: {
|
|
20
|
-
sys: {
|
|
21
|
-
id: string;
|
|
22
|
-
type: string;
|
|
23
|
-
linkType: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
createdBy: {
|
|
27
|
-
sys: {
|
|
28
|
-
type: string;
|
|
29
|
-
linkType: string;
|
|
30
|
-
id: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
updatedBy: {
|
|
34
|
-
sys: {
|
|
35
|
-
type: string;
|
|
36
|
-
linkType: string;
|
|
37
|
-
id: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
publishedCounter: number;
|
|
41
|
-
version: number;
|
|
42
|
-
};
|
|
43
|
-
fields: {};
|
|
44
|
-
}>;
|
|
45
|
-
getEntry: (id: string) => Promise<{
|
|
46
|
-
sys: {
|
|
47
|
-
space: {
|
|
48
|
-
sys: {
|
|
49
|
-
type: string;
|
|
50
|
-
linkType: string;
|
|
51
|
-
id: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
id: string;
|
|
55
|
-
type: string;
|
|
56
|
-
createdAt: string;
|
|
57
|
-
updatedAt: string;
|
|
58
|
-
environment: {
|
|
59
|
-
sys: {
|
|
60
|
-
id: string;
|
|
61
|
-
type: string;
|
|
62
|
-
linkType: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
createdBy: {
|
|
66
|
-
sys: {
|
|
67
|
-
type: string;
|
|
68
|
-
linkType: string;
|
|
69
|
-
id: string;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
updatedBy: {
|
|
73
|
-
sys: {
|
|
74
|
-
type: string;
|
|
75
|
-
linkType: string;
|
|
76
|
-
id: string;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
publishedCounter: number;
|
|
80
|
-
version: number;
|
|
81
|
-
contentType: {
|
|
82
|
-
sys: {
|
|
83
|
-
type: string;
|
|
84
|
-
linkType: string;
|
|
85
|
-
id: string;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
fields: {};
|
|
90
|
-
} | {
|
|
91
|
-
sys: {
|
|
92
|
-
space: {
|
|
93
|
-
sys: {
|
|
94
|
-
type: string;
|
|
95
|
-
linkType: string;
|
|
96
|
-
id: string;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
id: string;
|
|
100
|
-
type: string;
|
|
101
|
-
createdAt: string;
|
|
102
|
-
updatedAt: string;
|
|
103
|
-
environment: {
|
|
104
|
-
sys: {
|
|
105
|
-
id: string;
|
|
106
|
-
type: string;
|
|
107
|
-
linkType: string;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
firstPublishedAt: string;
|
|
111
|
-
createdBy: {
|
|
112
|
-
sys: {
|
|
113
|
-
type: string;
|
|
114
|
-
linkType: string;
|
|
115
|
-
id: string;
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
updatedBy: {
|
|
119
|
-
sys: {
|
|
120
|
-
type: string;
|
|
121
|
-
linkType: string;
|
|
122
|
-
id: string;
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
publishedVersion: number;
|
|
126
|
-
version: number;
|
|
127
|
-
contentType: {
|
|
128
|
-
sys: {
|
|
129
|
-
type: string;
|
|
130
|
-
linkType: string;
|
|
131
|
-
id: string;
|
|
132
|
-
};
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
fields: {
|
|
136
|
-
exField: {
|
|
137
|
-
en: string;
|
|
138
|
-
};
|
|
139
|
-
exDesc: {
|
|
140
|
-
en: string;
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
}>;
|
|
144
7
|
getEntityScheduledActions(): Promise<never[]>;
|
|
145
8
|
getCachedContentTypes: () => import("@contentful/app-sdk").ContentType[];
|
|
146
9
|
getContentType: (id: string) => Promise<import("@contentful/app-sdk").ContentType>;
|
|
@@ -148,7 +11,8 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
|
|
|
148
11
|
createContentType: (data: import("@contentful/app-sdk").WithOptionalId<import("@contentful/app-sdk").ContentType>) => Promise<import("@contentful/app-sdk").ContentType>;
|
|
149
12
|
updateContentType: (data: import("@contentful/app-sdk").ContentType) => Promise<import("@contentful/app-sdk").ContentType>;
|
|
150
13
|
deleteContentType: (contentTypeId: string) => Promise<void>;
|
|
151
|
-
|
|
14
|
+
getEntry: <Fields extends Record<string, any> = Record<string, any>>(id: string) => Promise<import("@contentful/app-sdk").Entry<Fields>>;
|
|
15
|
+
getEntrySnapshots: <Fields_1 extends Record<string, any> = Record<string, any>>(id: string) => Promise<import("@contentful/app-sdk").CollectionResponse<{
|
|
152
16
|
sys: {
|
|
153
17
|
space?: Link<string, string> | undefined;
|
|
154
18
|
status?: Link<string, string> | undefined;
|
|
@@ -162,17 +26,18 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
|
|
|
162
26
|
snapshotType: string;
|
|
163
27
|
snapshotEntityType: string;
|
|
164
28
|
};
|
|
165
|
-
snapshot: import("@contentful/app-sdk").Entry<
|
|
29
|
+
snapshot: import("@contentful/app-sdk").Entry<Fields_1>;
|
|
166
30
|
}>>;
|
|
167
|
-
getEntries: <
|
|
168
|
-
createEntry: <
|
|
169
|
-
updateEntry: <
|
|
170
|
-
publishEntry: <
|
|
171
|
-
unpublishEntry: <
|
|
172
|
-
archiveEntry: <
|
|
173
|
-
unarchiveEntry: <
|
|
174
|
-
deleteEntry: <
|
|
175
|
-
getPublishedEntries: <
|
|
31
|
+
getEntries: <Fields_2, Query_1 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_1 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Entry<Fields_2>>>;
|
|
32
|
+
createEntry: <Fields_3>(contentTypeId: string, data: import("@contentful/app-sdk").WithOptionalId<import("@contentful/app-sdk").Entry<Fields_3>>) => Promise<import("@contentful/app-sdk").Entry<Fields_3>>;
|
|
33
|
+
updateEntry: <Fields_4 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_4>) => Promise<import("@contentful/app-sdk").Entry<Fields_4>>;
|
|
34
|
+
publishEntry: <Fields_5 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_5>) => Promise<import("@contentful/app-sdk").Entry<Fields_5>>;
|
|
35
|
+
unpublishEntry: <Fields_6 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_6>) => Promise<import("@contentful/app-sdk").Entry<Fields_6>>;
|
|
36
|
+
archiveEntry: <Fields_7 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_7>) => Promise<import("@contentful/app-sdk").Entry<Fields_7>>;
|
|
37
|
+
unarchiveEntry: <Fields_8 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_8>) => Promise<import("@contentful/app-sdk").Entry<Fields_8>>;
|
|
38
|
+
deleteEntry: <Fields_9 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_9>) => Promise<void>;
|
|
39
|
+
getPublishedEntries: <Fields_10, Query_2 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_2 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Entry<Fields_10>>>;
|
|
40
|
+
getAsset: (id: string) => Promise<import("@contentful/app-sdk").Asset>;
|
|
176
41
|
getAssets: <Query_3 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_3 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Asset>>;
|
|
177
42
|
createAsset: (data: import("@contentful/app-sdk").WithOptionalId<import("@contentful/app-sdk").Asset>) => Promise<import("@contentful/app-sdk").Asset>;
|
|
178
43
|
updateAsset: (data: import("@contentful/app-sdk").Asset) => Promise<import("@contentful/app-sdk").Asset>;
|
|
@@ -183,7 +48,7 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
|
|
|
183
48
|
processAsset: (data: import("@contentful/app-sdk").Asset, locale: string) => Promise<import("@contentful/app-sdk").Asset>;
|
|
184
49
|
unarchiveAsset: (data: import("@contentful/app-sdk").Asset) => Promise<import("@contentful/app-sdk").Asset>;
|
|
185
50
|
getPublishedAssets: <Query_4 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_4 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Asset>>;
|
|
186
|
-
createUpload: (base64data: string) => Promise<import("contentful-management
|
|
51
|
+
createUpload: (base64data: string) => Promise<import("contentful-management").UploadProps>;
|
|
187
52
|
waitUntilAssetProcessed: (assetId: string, locale: string) => Promise<import("@contentful/app-sdk").Asset>;
|
|
188
53
|
getUsers: () => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").User>>;
|
|
189
54
|
getEditorInterface: (contentTypeId: string) => Promise<import("@contentful/app-sdk").EditorInterface>;
|
|
@@ -194,7 +59,7 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
|
|
|
194
59
|
readTags: (skip: number, limit: number) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Tag>>;
|
|
195
60
|
updateTag: (id: string, name: string, version: number) => Promise<import("@contentful/app-sdk").Tag>;
|
|
196
61
|
deleteTag: (id: string, version: number) => Promise<boolean>;
|
|
197
|
-
getTeams: (query: import("contentful-management
|
|
62
|
+
getTeams: (query: import("contentful-management").QueryOptions) => Promise<import("@contentful/app-sdk").CollectionResponse<import("contentful-management").TeamProps>>;
|
|
198
63
|
};
|
|
199
64
|
dialogs: {
|
|
200
65
|
selectSingleAsset: () => Promise<Link<string, string>>;
|
|
@@ -216,4 +81,8 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
|
|
|
216
81
|
access: {
|
|
217
82
|
can: () => Promise<boolean>;
|
|
218
83
|
};
|
|
84
|
+
ids: {
|
|
85
|
+
space: string;
|
|
86
|
+
environment: string;
|
|
87
|
+
};
|
|
219
88
|
})[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { Action, FieldExtensionSDK, ViewType, RenderDragFn } from '../../types';
|
|
3
2
|
import { CustomCardRenderer, RenderCustomMissingEntityCard } from '../../common/customCardTypes';
|
|
3
|
+
import { Action, FieldExtensionSDK, ViewType, RenderDragFn } from '../../types';
|
|
4
4
|
declare type FetchingWrappedAssetCardProps = {
|
|
5
5
|
assetId: string;
|
|
6
6
|
isDisabled: boolean;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { BaseExtensionSDK } from '../types';
|
|
2
|
+
import { BaseExtensionSDK, ContentType, Resource, Space } from '../types';
|
|
3
|
+
export declare type ResourceInfo<R extends Resource = Resource> = {
|
|
4
|
+
resource: R;
|
|
5
|
+
defaultLocaleCode: string;
|
|
6
|
+
contentType: ContentType;
|
|
7
|
+
space: Space;
|
|
8
|
+
};
|
|
3
9
|
declare const EntityProvider: React.FC<{
|
|
4
10
|
sdk: BaseExtensionSDK;
|
|
5
11
|
}>, useEntities: any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SortableContainerProps } from 'react-sortable-hoc';
|
|
3
|
+
import { ReferenceEditorProps } from './ReferenceEditor';
|
|
4
|
+
declare type SortableContainerChildProps<IType> = SortableLinkListProps<IType> & {
|
|
5
|
+
item: IType;
|
|
6
|
+
index: number;
|
|
7
|
+
DragHandle?: typeof DragHandle;
|
|
8
|
+
};
|
|
9
|
+
declare type SortableLinkListProps<T> = ReferenceEditorProps & {
|
|
10
|
+
items: T[];
|
|
11
|
+
isDisabled: boolean;
|
|
12
|
+
children: (props: SortableContainerChildProps<T>) => React.ReactElement;
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const DragHandle: (props: {
|
|
16
|
+
drag: React.ReactElement;
|
|
17
|
+
}) => JSX.Element;
|
|
18
|
+
export declare function SortableLinkList<T>(props: SortableLinkListProps<T> & SortableContainerProps): JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ContentType, RenderDragFn } from '../../types';
|
|
3
|
-
import { ReferenceEditorProps } from '../../common/ReferenceEditor';
|
|
4
2
|
import { RenderCustomMissingEntityCard } from '../../common/customCardTypes';
|
|
3
|
+
import { ReferenceEditorProps } from '../../common/ReferenceEditor';
|
|
4
|
+
import { ContentType, RenderDragFn } from '../../types';
|
|
5
5
|
export declare type EntryCardReferenceEditorProps = ReferenceEditorProps & {
|
|
6
6
|
entryId: string;
|
|
7
7
|
index?: number;
|