@wordpress/core-data 7.27.0 → 7.28.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.
- package/CHANGELOG.md +2 -0
- package/README.md +2 -2
- package/build/actions.js +7 -0
- package/build/actions.js.map +1 -1
- package/build/entities.js +15 -2
- package/build/entities.js.map +1 -1
- package/build/hooks/use-resource-permissions.js +1 -1
- package/build/hooks/use-resource-permissions.js.map +1 -1
- package/build/index.js +50 -8
- package/build/index.js.map +1 -1
- package/build/private-actions.js +99 -0
- package/build/private-actions.js.map +1 -1
- package/build/private-selectors.js +3 -0
- package/build/private-selectors.js.map +1 -1
- package/build/resolvers.js +1 -1
- package/build/resolvers.js.map +1 -1
- package/build/selectors.js +26 -1
- package/build/selectors.js.map +1 -1
- package/build/utils/log-entity-deprecation.js +63 -0
- package/build/utils/log-entity-deprecation.js.map +1 -0
- package/build-module/actions.js +7 -0
- package/build-module/actions.js.map +1 -1
- package/build-module/entities.js +14 -1
- package/build-module/entities.js.map +1 -1
- package/build-module/hooks/use-resource-permissions.js +1 -1
- package/build-module/hooks/use-resource-permissions.js.map +1 -1
- package/build-module/index.js +50 -8
- package/build-module/index.js.map +1 -1
- package/build-module/private-actions.js +96 -0
- package/build-module/private-actions.js.map +1 -1
- package/build-module/private-selectors.js +2 -0
- package/build-module/private-selectors.js.map +1 -1
- package/build-module/resolvers.js +1 -1
- package/build-module/resolvers.js.map +1 -1
- package/build-module/selectors.js +26 -1
- package/build-module/selectors.js.map +1 -1
- package/build-module/utils/log-entity-deprecation.js +55 -0
- package/build-module/utils/log-entity-deprecation.js.map +1 -0
- package/build-types/actions.d.ts.map +1 -1
- package/build-types/entities.d.ts +29 -18
- package/build-types/entities.d.ts.map +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/private-actions.d.ts +24 -0
- package/build-types/private-actions.d.ts.map +1 -1
- package/build-types/private-selectors.d.ts +1 -1
- package/build-types/private-selectors.d.ts.map +1 -1
- package/build-types/reducer.d.ts +3 -3
- package/build-types/reducer.d.ts.map +1 -1
- package/build-types/selectors.d.ts +1 -1
- package/build-types/selectors.d.ts.map +1 -1
- package/build-types/utils/log-entity-deprecation.d.ts +15 -0
- package/build-types/utils/log-entity-deprecation.d.ts.map +1 -0
- package/package.json +18 -18
- package/src/actions.js +11 -0
- package/src/entities.js +14 -0
- package/src/hooks/test/use-resource-permissions.js +3 -3
- package/src/hooks/use-resource-permissions.ts +1 -1
- package/src/index.js +54 -14
- package/src/private-actions.js +118 -0
- package/src/private-selectors.ts +2 -0
- package/src/resolvers.js +1 -1
- package/src/selectors.ts +29 -1
- package/src/test/deprecated-entity-logging.js +291 -0
- package/src/test/private-actions.js +213 -0
- package/src/test/resolvers.js +7 -7
- package/src/test/selectors.js +18 -7
- package/src/utils/log-entity-deprecation.ts +67 -0
- package/src/utils/test/log-entity-deprecation.js +130 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const DEFAULT_ENTITY_KEY: "id";
|
|
2
2
|
export const rootEntitiesConfig: ({
|
|
3
|
-
label: import("@wordpress/i18n
|
|
3
|
+
label: import("@wordpress/i18n").TranslatableText<"Base">;
|
|
4
4
|
kind: string;
|
|
5
5
|
name: string;
|
|
6
6
|
baseURL: string;
|
|
@@ -23,7 +23,7 @@ export const rootEntitiesConfig: ({
|
|
|
23
23
|
getTitle?: undefined;
|
|
24
24
|
getRevisionsUrl?: undefined;
|
|
25
25
|
} | {
|
|
26
|
-
label: import("@wordpress/i18n
|
|
26
|
+
label: import("@wordpress/i18n").TranslatableText<"Post Type">;
|
|
27
27
|
name: string;
|
|
28
28
|
kind: string;
|
|
29
29
|
key: string;
|
|
@@ -54,7 +54,7 @@ export const rootEntitiesConfig: ({
|
|
|
54
54
|
_fields?: undefined;
|
|
55
55
|
};
|
|
56
56
|
plural: string;
|
|
57
|
-
label: import("@wordpress/i18n
|
|
57
|
+
label: import("@wordpress/i18n").TranslatableText<"Media">;
|
|
58
58
|
rawAttributes: string[];
|
|
59
59
|
supportsPagination: boolean;
|
|
60
60
|
syncConfig?: undefined;
|
|
@@ -74,7 +74,7 @@ export const rootEntitiesConfig: ({
|
|
|
74
74
|
_fields?: undefined;
|
|
75
75
|
};
|
|
76
76
|
plural: string;
|
|
77
|
-
label: import("@wordpress/i18n
|
|
77
|
+
label: import("@wordpress/i18n").TranslatableText<"Taxonomy">;
|
|
78
78
|
syncConfig?: undefined;
|
|
79
79
|
syncObjectType?: undefined;
|
|
80
80
|
getSyncObjectId?: undefined;
|
|
@@ -95,7 +95,7 @@ export const rootEntitiesConfig: ({
|
|
|
95
95
|
transientEdits: {
|
|
96
96
|
blocks: boolean;
|
|
97
97
|
};
|
|
98
|
-
label: import("@wordpress/i18n
|
|
98
|
+
label: import("@wordpress/i18n").TranslatableText<"Widget areas">;
|
|
99
99
|
syncConfig?: undefined;
|
|
100
100
|
syncObjectType?: undefined;
|
|
101
101
|
getSyncObjectId?: undefined;
|
|
@@ -116,7 +116,7 @@ export const rootEntitiesConfig: ({
|
|
|
116
116
|
transientEdits: {
|
|
117
117
|
blocks: boolean;
|
|
118
118
|
};
|
|
119
|
-
label: import("@wordpress/i18n
|
|
119
|
+
label: import("@wordpress/i18n").TranslatableText<"Widgets">;
|
|
120
120
|
syncConfig?: undefined;
|
|
121
121
|
syncObjectType?: undefined;
|
|
122
122
|
getSyncObjectId?: undefined;
|
|
@@ -134,7 +134,7 @@ export const rootEntitiesConfig: ({
|
|
|
134
134
|
_fields?: undefined;
|
|
135
135
|
};
|
|
136
136
|
plural: string;
|
|
137
|
-
label: import("@wordpress/i18n
|
|
137
|
+
label: import("@wordpress/i18n").TranslatableText<"Widget types">;
|
|
138
138
|
syncConfig?: undefined;
|
|
139
139
|
syncObjectType?: undefined;
|
|
140
140
|
getSyncObjectId?: undefined;
|
|
@@ -145,10 +145,11 @@ export const rootEntitiesConfig: ({
|
|
|
145
145
|
getTitle?: undefined;
|
|
146
146
|
getRevisionsUrl?: undefined;
|
|
147
147
|
} | {
|
|
148
|
-
label: import("@wordpress/i18n
|
|
148
|
+
label: import("@wordpress/i18n").TranslatableText<"User">;
|
|
149
149
|
name: string;
|
|
150
150
|
kind: string;
|
|
151
151
|
baseURL: string;
|
|
152
|
+
getTitle: (record: any) => any;
|
|
152
153
|
baseURLParams: {
|
|
153
154
|
context: string;
|
|
154
155
|
_fields?: undefined;
|
|
@@ -161,7 +162,6 @@ export const rootEntitiesConfig: ({
|
|
|
161
162
|
rawAttributes?: undefined;
|
|
162
163
|
supportsPagination?: undefined;
|
|
163
164
|
transientEdits?: undefined;
|
|
164
|
-
getTitle?: undefined;
|
|
165
165
|
getRevisionsUrl?: undefined;
|
|
166
166
|
} | {
|
|
167
167
|
name: string;
|
|
@@ -172,7 +172,7 @@ export const rootEntitiesConfig: ({
|
|
|
172
172
|
_fields?: undefined;
|
|
173
173
|
};
|
|
174
174
|
plural: string;
|
|
175
|
-
label: import("@wordpress/i18n
|
|
175
|
+
label: import("@wordpress/i18n").TranslatableText<"Comment">;
|
|
176
176
|
syncConfig?: undefined;
|
|
177
177
|
syncObjectType?: undefined;
|
|
178
178
|
getSyncObjectId?: undefined;
|
|
@@ -191,7 +191,7 @@ export const rootEntitiesConfig: ({
|
|
|
191
191
|
_fields?: undefined;
|
|
192
192
|
};
|
|
193
193
|
plural: string;
|
|
194
|
-
label: import("@wordpress/i18n
|
|
194
|
+
label: import("@wordpress/i18n").TranslatableText<"Menu">;
|
|
195
195
|
syncConfig?: undefined;
|
|
196
196
|
syncObjectType?: undefined;
|
|
197
197
|
getSyncObjectId?: undefined;
|
|
@@ -210,7 +210,7 @@ export const rootEntitiesConfig: ({
|
|
|
210
210
|
_fields?: undefined;
|
|
211
211
|
};
|
|
212
212
|
plural: string;
|
|
213
|
-
label: import("@wordpress/i18n
|
|
213
|
+
label: import("@wordpress/i18n").TranslatableText<"Menu Item">;
|
|
214
214
|
rawAttributes: string[];
|
|
215
215
|
syncConfig?: undefined;
|
|
216
216
|
syncObjectType?: undefined;
|
|
@@ -229,7 +229,7 @@ export const rootEntitiesConfig: ({
|
|
|
229
229
|
_fields?: undefined;
|
|
230
230
|
};
|
|
231
231
|
plural: string;
|
|
232
|
-
label: import("@wordpress/i18n
|
|
232
|
+
label: import("@wordpress/i18n").TranslatableText<"Menu Location">;
|
|
233
233
|
key: string;
|
|
234
234
|
syncConfig?: undefined;
|
|
235
235
|
syncObjectType?: undefined;
|
|
@@ -240,7 +240,7 @@ export const rootEntitiesConfig: ({
|
|
|
240
240
|
getTitle?: undefined;
|
|
241
241
|
getRevisionsUrl?: undefined;
|
|
242
242
|
} | {
|
|
243
|
-
label: import("@wordpress/i18n
|
|
243
|
+
label: import("@wordpress/i18n").TranslatableText<"Global Styles">;
|
|
244
244
|
name: string;
|
|
245
245
|
kind: string;
|
|
246
246
|
baseURL: string;
|
|
@@ -249,7 +249,7 @@ export const rootEntitiesConfig: ({
|
|
|
249
249
|
_fields?: undefined;
|
|
250
250
|
};
|
|
251
251
|
plural: string;
|
|
252
|
-
getTitle: () => import("@wordpress/i18n
|
|
252
|
+
getTitle: () => import("@wordpress/i18n").TranslatableText<"Custom Styles">;
|
|
253
253
|
getRevisionsUrl: (parentId: any, revisionId: any) => string;
|
|
254
254
|
supportsPagination: boolean;
|
|
255
255
|
syncConfig?: undefined;
|
|
@@ -259,7 +259,7 @@ export const rootEntitiesConfig: ({
|
|
|
259
259
|
rawAttributes?: undefined;
|
|
260
260
|
transientEdits?: undefined;
|
|
261
261
|
} | {
|
|
262
|
-
label: import("@wordpress/i18n
|
|
262
|
+
label: import("@wordpress/i18n").TranslatableText<"Themes">;
|
|
263
263
|
name: string;
|
|
264
264
|
kind: string;
|
|
265
265
|
baseURL: string;
|
|
@@ -278,7 +278,7 @@ export const rootEntitiesConfig: ({
|
|
|
278
278
|
getTitle?: undefined;
|
|
279
279
|
getRevisionsUrl?: undefined;
|
|
280
280
|
} | {
|
|
281
|
-
label: import("@wordpress/i18n
|
|
281
|
+
label: import("@wordpress/i18n").TranslatableText<"Plugins">;
|
|
282
282
|
name: string;
|
|
283
283
|
kind: string;
|
|
284
284
|
baseURL: string;
|
|
@@ -297,7 +297,7 @@ export const rootEntitiesConfig: ({
|
|
|
297
297
|
getTitle?: undefined;
|
|
298
298
|
getRevisionsUrl?: undefined;
|
|
299
299
|
} | {
|
|
300
|
-
label: import("@wordpress/i18n
|
|
300
|
+
label: import("@wordpress/i18n").TranslatableText<"Status">;
|
|
301
301
|
name: string;
|
|
302
302
|
kind: string;
|
|
303
303
|
baseURL: string;
|
|
@@ -316,6 +316,17 @@ export const rootEntitiesConfig: ({
|
|
|
316
316
|
getTitle?: undefined;
|
|
317
317
|
getRevisionsUrl?: undefined;
|
|
318
318
|
})[];
|
|
319
|
+
export namespace deprecatedEntities {
|
|
320
|
+
namespace root {
|
|
321
|
+
namespace media {
|
|
322
|
+
let since: string;
|
|
323
|
+
namespace alternative {
|
|
324
|
+
let kind: string;
|
|
325
|
+
let name: string;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
319
330
|
export const additionalEntityConfigLoaders: ({
|
|
320
331
|
kind: string;
|
|
321
332
|
loadEntities: typeof loadPostTypeEntities;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../src/entities.js"],"names":[],"mappings":"AAYA,iCAAkC,IAAI,CAAC;AAGvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../src/entities.js"],"names":[],"mappings":"AAYA,iCAAkC,IAAI,CAAC;AAGvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4ME;;;;;;;;;;;;AAcF;;;;;;;;;;KASE;AASK,0EAqBN;AAmMM,oCANI,MAAM,QACN,MAAM,WACN,MAAM,GAEL,MAAM,CAMjB;AA9KD;;;;GAIG;AACH,sDAyEC;AAwBD;;;;GAIG;AACH,gDA2CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AA6HA;;;;GAIG;AACH;;;;;;;;;;;;;;;;;;;;;;4CAWs5oB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAX11oB;;;;;;;2BAzHxC,aAAa"}
|
|
@@ -8,4 +8,28 @@
|
|
|
8
8
|
* @return {Object} Action object.
|
|
9
9
|
*/
|
|
10
10
|
export function receiveRegisteredPostMeta(postType: string, registeredPostMeta: any): any;
|
|
11
|
+
export function editMediaEntity(recordId: string, edits?: Edits, { __unstableFetch, throwOnError }?: {
|
|
12
|
+
__unstableFetch: Function;
|
|
13
|
+
throwOnError: boolean;
|
|
14
|
+
}): Promise<any>;
|
|
15
|
+
export type Modifier = {
|
|
16
|
+
/**
|
|
17
|
+
* - The type of modifier.
|
|
18
|
+
*/
|
|
19
|
+
type?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* - The arguments of the modifier.
|
|
22
|
+
*/
|
|
23
|
+
args?: any;
|
|
24
|
+
};
|
|
25
|
+
export type Edits = {
|
|
26
|
+
/**
|
|
27
|
+
* - The URL of the media item.
|
|
28
|
+
*/
|
|
29
|
+
src?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* - The modifiers to apply to the media item.
|
|
32
|
+
*/
|
|
33
|
+
modifiers?: Modifier[] | undefined;
|
|
34
|
+
};
|
|
11
35
|
//# sourceMappingURL=private-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../src/private-actions.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../src/private-actions.js"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,oDALW,MAAM,gCAWhB;AAyBM,0CARI,MAAM,UACN,KAAK,sCAEb;IAA0B,eAAe;IACf,YAAY,EAA9B,OAAO;CAEf,gBAqFD"}
|
|
@@ -11,7 +11,7 @@ type EntityRecordKey = string | number;
|
|
|
11
11
|
*
|
|
12
12
|
* @return The undo manager.
|
|
13
13
|
*/
|
|
14
|
-
export declare function getUndoManager(state: State): import("@wordpress/undo-manager
|
|
14
|
+
export declare function getUndoManager(state: State): import("@wordpress/undo-manager").UndoManager;
|
|
15
15
|
/**
|
|
16
16
|
* Retrieve the fallback Navigation.
|
|
17
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-selectors.d.ts","sourceRoot":"","sources":["../src/private-selectors.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAyC,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"private-selectors.d.ts","sourceRoot":"","sources":["../src/private-selectors.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAAyC,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAKhF,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvC;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAE,KAAK,EAAE,KAAK,iDAE3C;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACtC,KAAK,EAAE,KAAK,GACV,eAAe,GAAG,SAAS,CAE7B;AAED,eAAO,MAAM,2BAA2B;;;;CAcvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;CAwBvC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM;;;EAIV;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,UAEpE;AAqBD,eAAO,MAAM,WAAW;;;;;;;CAoCvB,CAAC;AAEF,eAAO,MAAM,cAAc;;;;CAQxB,CAAC;AAEJ,eAAO,MAAM,aAAa;;;;CAmFzB,CAAC"}
|
package/build-types/reducer.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export function entitiesConfig(state: any, action: any): any;
|
|
|
86
86
|
/**
|
|
87
87
|
* @type {UndoManager}
|
|
88
88
|
*/
|
|
89
|
-
export function undoManager(state?: import("@wordpress/undo-manager
|
|
89
|
+
export function undoManager(state?: import("@wordpress/undo-manager").UndoManager<unknown>): import("@wordpress/undo-manager").UndoManager<unknown>;
|
|
90
90
|
export function editsReference(state: {} | undefined, action: any): {};
|
|
91
91
|
/**
|
|
92
92
|
* Reducer managing embed preview data.
|
|
@@ -160,7 +160,7 @@ declare const _default: import("redux").Reducer<{
|
|
|
160
160
|
taxonomies: any;
|
|
161
161
|
entities: any;
|
|
162
162
|
editsReference: {};
|
|
163
|
-
undoManager: import("@wordpress/undo-manager
|
|
163
|
+
undoManager: import("@wordpress/undo-manager").UndoManager<unknown>;
|
|
164
164
|
embedPreviews: any;
|
|
165
165
|
userPermissions: any;
|
|
166
166
|
autosaves: any;
|
|
@@ -182,7 +182,7 @@ declare const _default: import("redux").Reducer<{
|
|
|
182
182
|
taxonomies: any;
|
|
183
183
|
entities: any;
|
|
184
184
|
editsReference: {} | undefined;
|
|
185
|
-
undoManager: import("@wordpress/undo-manager
|
|
185
|
+
undoManager: import("@wordpress/undo-manager").UndoManager<unknown> | undefined;
|
|
186
186
|
embedPreviews: any;
|
|
187
187
|
userPermissions: any;
|
|
188
188
|
autosaves: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../src/reducer.js"],"names":[],"mappings":"AAmBA,2DAA2D;AAE3D;;;;;;;;;;GAUG;AACH,oDAUC;AAED;;;;;;;GAOG;AACH,oDAuBC;AAED;;;;;;;GAOG;AACH,0DAOC;AAED;;;;;;;GAOG;AACH,yDAOC;AAED;;;;;;;GAOG;AACH,oCALW,MAAM,GAAC,SAAS,gBAGf,MAAM,GAAC,SAAS,CAS3B;AAED;;;;;;;GAOG;AACH,6CALW,MAAM,GAAC,SAAS,gBAGf,MAAM,GAAC,SAAS,CAS3B;AA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GAOG;AACH,wCALW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,4BAGrB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAYjC;AAED;;;;;;;GAOG;AACH,iEASC;AAtOM,uDAmDN;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAjca,OAAO,SAAS,EAAE,WAAW"}
|
|
@@ -518,7 +518,7 @@ export declare function isPreviewEmbedFallback(state: State, url: string): boole
|
|
|
518
518
|
*
|
|
519
519
|
* @param state Data state.
|
|
520
520
|
* @param action Action to check. One of: 'create', 'read', 'update', 'delete'.
|
|
521
|
-
* @param resource Entity resource to check. Accepts entity object `{ kind: '
|
|
521
|
+
* @param resource Entity resource to check. Accepts entity object `{ kind: 'postType', name: 'attachment', id: 1 }`
|
|
522
522
|
* or REST base as a string - `media`.
|
|
523
523
|
* @param id Optional ID of the rest resource to check.
|
|
524
524
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAO3D,MAAM,WAAW,KAAK;IACrB,SAAS,EAAE,MAAM,CAAE,MAAM,GAAG,MAAM,EAAE,KAAK,CAAE,OAAO,CAAE,CAAE,CAAC;IACvD,aAAa,EAAE,KAAK,CAAE,OAAO,CAAE,CAAC;IAChC,sBAAsB,EAAE,KAAK,CAAE,OAAO,CAAE,CAAC;IACzC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,YAAY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AAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logs a deprecation warning for an entity, if it's deprecated.
|
|
3
|
+
*
|
|
4
|
+
* @param kind The kind of the entity.
|
|
5
|
+
* @param name The name of the entity.
|
|
6
|
+
* @param functionName The name of the function that was called with a deprecated entity.
|
|
7
|
+
* @param options The options for the deprecation warning.
|
|
8
|
+
* @param options.alternativeFunctionName The name of the alternative function that should be used instead.
|
|
9
|
+
* @param options.isShorthandSelector Whether the function is a shorthand selector.
|
|
10
|
+
*/
|
|
11
|
+
export default function logEntityDeprecation(kind: string, name: string, functionName: string, { alternativeFunctionName, isShorthandSelector, }?: {
|
|
12
|
+
alternativeFunctionName?: string;
|
|
13
|
+
isShorthandSelector?: boolean;
|
|
14
|
+
}): void;
|
|
15
|
+
//# sourceMappingURL=log-entity-deprecation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-entity-deprecation.d.ts","sourceRoot":"","sources":["../../src/utils/log-entity-deprecation.ts"],"names":[],"mappings":"AAYA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC3C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,EACC,uBAAuB,EACvB,mBAA2B,GAC3B,GAAE;IACF,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACzB,QAkCN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/core-data",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.28.0",
|
|
4
4
|
"description": "Access to and manipulation of core WordPress entities.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,22 +33,22 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/runtime": "7.25.7",
|
|
36
|
-
"@wordpress/api-fetch": "^7.
|
|
37
|
-
"@wordpress/block-editor": "^15.
|
|
38
|
-
"@wordpress/blocks": "^15.
|
|
39
|
-
"@wordpress/compose": "^7.
|
|
40
|
-
"@wordpress/data": "^10.
|
|
41
|
-
"@wordpress/deprecated": "^4.
|
|
42
|
-
"@wordpress/element": "^6.
|
|
43
|
-
"@wordpress/html-entities": "^4.
|
|
44
|
-
"@wordpress/i18n": "^6.
|
|
45
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
46
|
-
"@wordpress/private-apis": "^1.
|
|
47
|
-
"@wordpress/rich-text": "^7.
|
|
48
|
-
"@wordpress/sync": "^1.
|
|
49
|
-
"@wordpress/undo-manager": "^1.
|
|
50
|
-
"@wordpress/url": "^4.
|
|
51
|
-
"@wordpress/warning": "^3.
|
|
36
|
+
"@wordpress/api-fetch": "^7.28.0",
|
|
37
|
+
"@wordpress/block-editor": "^15.1.0",
|
|
38
|
+
"@wordpress/blocks": "^15.1.0",
|
|
39
|
+
"@wordpress/compose": "^7.28.0",
|
|
40
|
+
"@wordpress/data": "^10.28.0",
|
|
41
|
+
"@wordpress/deprecated": "^4.28.0",
|
|
42
|
+
"@wordpress/element": "^6.28.0",
|
|
43
|
+
"@wordpress/html-entities": "^4.28.0",
|
|
44
|
+
"@wordpress/i18n": "^6.1.0",
|
|
45
|
+
"@wordpress/is-shallow-equal": "^5.28.0",
|
|
46
|
+
"@wordpress/private-apis": "^1.28.0",
|
|
47
|
+
"@wordpress/rich-text": "^7.28.0",
|
|
48
|
+
"@wordpress/sync": "^1.28.0",
|
|
49
|
+
"@wordpress/undo-manager": "^1.28.0",
|
|
50
|
+
"@wordpress/url": "^4.28.0",
|
|
51
|
+
"@wordpress/warning": "^3.28.0",
|
|
52
52
|
"change-case": "^4.1.2",
|
|
53
53
|
"equivalent-key-map": "^0.2.2",
|
|
54
54
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "28cc2098f5ee28f89096b638533796538f495f72"
|
|
66
66
|
}
|
package/src/actions.js
CHANGED
|
@@ -20,6 +20,7 @@ import { DEFAULT_ENTITY_KEY } from './entities';
|
|
|
20
20
|
import { createBatch } from './batch';
|
|
21
21
|
import { STORE_NAME } from './name';
|
|
22
22
|
import { getSyncProvider } from './sync';
|
|
23
|
+
import logEntityDeprecation from './utils/log-entity-deprecation';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Returns an action object used in signalling that authors have been received.
|
|
@@ -286,6 +287,7 @@ export const deleteEntityRecord =
|
|
|
286
287
|
{ __unstableFetch = apiFetch, throwOnError = false } = {}
|
|
287
288
|
) =>
|
|
288
289
|
async ( { dispatch, resolveSelect } ) => {
|
|
290
|
+
logEntityDeprecation( kind, name, 'deleteEntityRecord' );
|
|
289
291
|
const configs = await resolveSelect.getEntitiesConfig( kind );
|
|
290
292
|
const entityConfig = configs.find(
|
|
291
293
|
( config ) => config.kind === kind && config.name === name
|
|
@@ -363,6 +365,7 @@ export const deleteEntityRecord =
|
|
|
363
365
|
export const editEntityRecord =
|
|
364
366
|
( kind, name, recordId, edits, options = {} ) =>
|
|
365
367
|
( { select, dispatch } ) => {
|
|
368
|
+
logEntityDeprecation( kind, name, 'editEntityRecord' );
|
|
366
369
|
const entityConfig = select.getEntityConfig( kind, name );
|
|
367
370
|
if ( ! entityConfig ) {
|
|
368
371
|
throw new Error(
|
|
@@ -503,6 +506,7 @@ export const saveEntityRecord =
|
|
|
503
506
|
} = {}
|
|
504
507
|
) =>
|
|
505
508
|
async ( { select, resolveSelect, dispatch } ) => {
|
|
509
|
+
logEntityDeprecation( kind, name, 'saveEntityRecord' );
|
|
506
510
|
const configs = await resolveSelect.getEntitiesConfig( kind );
|
|
507
511
|
const entityConfig = configs.find(
|
|
508
512
|
( config ) => config.kind === kind && config.name === name
|
|
@@ -781,6 +785,7 @@ export const __experimentalBatch =
|
|
|
781
785
|
export const saveEditedEntityRecord =
|
|
782
786
|
( kind, name, recordId, options ) =>
|
|
783
787
|
async ( { select, dispatch, resolveSelect } ) => {
|
|
788
|
+
logEntityDeprecation( kind, name, 'saveEditedEntityRecord' );
|
|
784
789
|
if ( ! select.hasEditsForEntityRecord( kind, name, recordId ) ) {
|
|
785
790
|
return;
|
|
786
791
|
}
|
|
@@ -814,6 +819,11 @@ export const saveEditedEntityRecord =
|
|
|
814
819
|
export const __experimentalSaveSpecifiedEntityEdits =
|
|
815
820
|
( kind, name, recordId, itemsToSave, options ) =>
|
|
816
821
|
async ( { select, dispatch, resolveSelect } ) => {
|
|
822
|
+
logEntityDeprecation(
|
|
823
|
+
kind,
|
|
824
|
+
name,
|
|
825
|
+
'__experimentalSaveSpecifiedEntityEdits'
|
|
826
|
+
);
|
|
817
827
|
if ( ! select.hasEditsForEntityRecord( kind, name, recordId ) ) {
|
|
818
828
|
return;
|
|
819
829
|
}
|
|
@@ -974,6 +984,7 @@ export function receiveDefaultTemplateId( query, templateId ) {
|
|
|
974
984
|
export const receiveRevisions =
|
|
975
985
|
( kind, name, recordKey, records, query, invalidateCache = false, meta ) =>
|
|
976
986
|
async ( { dispatch, resolveSelect } ) => {
|
|
987
|
+
logEntityDeprecation( kind, name, 'receiveRevisions' );
|
|
977
988
|
const configs = await resolveSelect.getEntitiesConfig( kind );
|
|
978
989
|
const entityConfig = configs.find(
|
|
979
990
|
( config ) => config.kind === kind && config.name === name
|
package/src/entities.js
CHANGED
|
@@ -138,6 +138,7 @@ export const rootEntitiesConfig = [
|
|
|
138
138
|
name: 'user',
|
|
139
139
|
kind: 'root',
|
|
140
140
|
baseURL: '/wp/v2/users',
|
|
141
|
+
getTitle: ( record ) => record?.name || record?.slug,
|
|
141
142
|
baseURLParams: { context: 'edit' },
|
|
142
143
|
plural: 'users',
|
|
143
144
|
},
|
|
@@ -218,6 +219,18 @@ export const rootEntitiesConfig = [
|
|
|
218
219
|
},
|
|
219
220
|
];
|
|
220
221
|
|
|
222
|
+
export const deprecatedEntities = {
|
|
223
|
+
root: {
|
|
224
|
+
media: {
|
|
225
|
+
since: '6.9',
|
|
226
|
+
alternative: {
|
|
227
|
+
kind: 'postType',
|
|
228
|
+
name: 'attachment',
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
};
|
|
233
|
+
|
|
221
234
|
export const additionalEntityConfigLoaders = [
|
|
222
235
|
{ kind: 'postType', loadEntities: loadPostTypeEntities },
|
|
223
236
|
{ kind: 'taxonomy', loadEntities: loadTaxonomyEntities },
|
|
@@ -379,6 +392,7 @@ async function loadTaxonomyEntities() {
|
|
|
379
392
|
baseURLParams: { context: 'edit' },
|
|
380
393
|
name,
|
|
381
394
|
label: taxonomy.name,
|
|
395
|
+
getTitle: ( record ) => record?.name,
|
|
382
396
|
};
|
|
383
397
|
} );
|
|
384
398
|
}
|
|
@@ -99,7 +99,7 @@ describe( 'useResourcePermissions', () => {
|
|
|
99
99
|
const TestComponent = () => {
|
|
100
100
|
data = useResourcePermissions( {
|
|
101
101
|
kind: 'root',
|
|
102
|
-
name: '
|
|
102
|
+
name: 'user',
|
|
103
103
|
} );
|
|
104
104
|
return <div />;
|
|
105
105
|
};
|
|
@@ -132,7 +132,7 @@ describe( 'useResourcePermissions', () => {
|
|
|
132
132
|
const TestComponent = () => {
|
|
133
133
|
data = useResourcePermissions( {
|
|
134
134
|
kind: 'root',
|
|
135
|
-
name: '
|
|
135
|
+
name: 'user',
|
|
136
136
|
id: 1,
|
|
137
137
|
} );
|
|
138
138
|
return <div />;
|
|
@@ -170,7 +170,7 @@ describe( 'useResourcePermissions', () => {
|
|
|
170
170
|
useResourcePermissions(
|
|
171
171
|
{
|
|
172
172
|
kind: 'root',
|
|
173
|
-
name: '
|
|
173
|
+
name: 'user',
|
|
174
174
|
},
|
|
175
175
|
1
|
|
176
176
|
);
|
|
@@ -59,7 +59,7 @@ function useResourcePermissions< IdType = void >(
|
|
|
59
59
|
*
|
|
60
60
|
* @since 6.1.0 Introduced in WordPress core.
|
|
61
61
|
*
|
|
62
|
-
* @param resource Entity resource to check. Accepts entity object `{ kind: '
|
|
62
|
+
* @param resource Entity resource to check. Accepts entity object `{ kind: 'postType', name: 'attachment', id: 1 }`
|
|
63
63
|
* or REST base as a string - `media`.
|
|
64
64
|
* @param id Optional ID of the resource to check, e.g. 10. Note: This argument is discouraged
|
|
65
65
|
* when using an entity object as a resource to check permissions and will be ignored.
|
package/src/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
import { STORE_NAME } from './name';
|
|
22
22
|
import { unlock } from './lock-unlock';
|
|
23
23
|
import { dynamicActions, dynamicSelectors } from './dynamic-entities';
|
|
24
|
+
import logEntityDeprecation from './utils/log-entity-deprecation';
|
|
24
25
|
|
|
25
26
|
// The entity selectors/resolvers and actions are shortcuts to their generic equivalents
|
|
26
27
|
// (getEntityRecord, getEntityRecords, updateEntityRecord, updateEntityRecords)
|
|
@@ -33,26 +34,50 @@ const entitiesConfig = [
|
|
|
33
34
|
|
|
34
35
|
const entitySelectors = entitiesConfig.reduce( ( result, entity ) => {
|
|
35
36
|
const { kind, name, plural } = entity;
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
|
|
38
|
+
const getEntityRecordMethodName = getMethodName( kind, name );
|
|
39
|
+
result[ getEntityRecordMethodName ] = ( state, key, query ) => {
|
|
40
|
+
logEntityDeprecation( kind, name, getEntityRecordMethodName, {
|
|
41
|
+
isShorthandSelector: true,
|
|
42
|
+
alternativeFunctionName: 'getEntityRecord',
|
|
43
|
+
} );
|
|
44
|
+
return selectors.getEntityRecord( state, kind, name, key, query );
|
|
45
|
+
};
|
|
38
46
|
|
|
39
47
|
if ( plural ) {
|
|
40
|
-
|
|
41
|
-
|
|
48
|
+
const getEntityRecordsMethodName = getMethodName( kind, plural, 'get' );
|
|
49
|
+
result[ getEntityRecordsMethodName ] = ( state, query ) => {
|
|
50
|
+
logEntityDeprecation( kind, name, getEntityRecordsMethodName, {
|
|
51
|
+
isShorthandSelector: true,
|
|
52
|
+
alternativeFunctionName: 'getEntityRecords',
|
|
53
|
+
} );
|
|
54
|
+
return selectors.getEntityRecords( state, kind, name, query );
|
|
55
|
+
};
|
|
42
56
|
}
|
|
43
57
|
return result;
|
|
44
58
|
}, {} );
|
|
45
59
|
|
|
46
60
|
const entityResolvers = entitiesConfig.reduce( ( result, entity ) => {
|
|
47
61
|
const { kind, name, plural } = entity;
|
|
48
|
-
|
|
49
|
-
|
|
62
|
+
const getEntityRecordMethodName = getMethodName( kind, name );
|
|
63
|
+
result[ getEntityRecordMethodName ] = ( key, query ) => {
|
|
64
|
+
logEntityDeprecation( kind, name, getEntityRecordMethodName, {
|
|
65
|
+
isShorthandSelector: true,
|
|
66
|
+
alternativeFunctionName: 'getEntityRecord',
|
|
67
|
+
} );
|
|
68
|
+
return resolvers.getEntityRecord( kind, name, key, query );
|
|
69
|
+
};
|
|
50
70
|
|
|
51
71
|
if ( plural ) {
|
|
52
|
-
const
|
|
53
|
-
result[
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
const getEntityRecordsMethodName = getMethodName( kind, plural, 'get' );
|
|
73
|
+
result[ getEntityRecordsMethodName ] = ( ...args ) => {
|
|
74
|
+
logEntityDeprecation( kind, plural, getEntityRecordsMethodName, {
|
|
75
|
+
isShorthandSelector: true,
|
|
76
|
+
alternativeFunctionName: 'getEntityRecords',
|
|
77
|
+
} );
|
|
78
|
+
return resolvers.getEntityRecords( kind, name, ...args );
|
|
79
|
+
};
|
|
80
|
+
result[ getEntityRecordsMethodName ].shouldInvalidate = ( action ) =>
|
|
56
81
|
resolvers.getEntityRecords.shouldInvalidate( action, kind, name );
|
|
57
82
|
}
|
|
58
83
|
return result;
|
|
@@ -60,10 +85,25 @@ const entityResolvers = entitiesConfig.reduce( ( result, entity ) => {
|
|
|
60
85
|
|
|
61
86
|
const entityActions = entitiesConfig.reduce( ( result, entity ) => {
|
|
62
87
|
const { kind, name } = entity;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
result[
|
|
66
|
-
|
|
88
|
+
|
|
89
|
+
const saveEntityRecordMethodName = getMethodName( kind, name, 'save' );
|
|
90
|
+
result[ saveEntityRecordMethodName ] = ( record, options ) => {
|
|
91
|
+
logEntityDeprecation( kind, name, saveEntityRecordMethodName, {
|
|
92
|
+
isShorthandSelector: true,
|
|
93
|
+
alternativeFunctionName: 'saveEntityRecord',
|
|
94
|
+
} );
|
|
95
|
+
return actions.saveEntityRecord( kind, name, record, options );
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const deleteEntityRecordMethodName = getMethodName( kind, name, 'delete' );
|
|
99
|
+
result[ deleteEntityRecordMethodName ] = ( key, query, options ) => {
|
|
100
|
+
logEntityDeprecation( kind, name, deleteEntityRecordMethodName, {
|
|
101
|
+
isShorthandSelector: true,
|
|
102
|
+
alternativeFunctionName: 'deleteEntityRecord',
|
|
103
|
+
} );
|
|
104
|
+
return actions.deleteEntityRecord( kind, name, key, query, options );
|
|
105
|
+
};
|
|
106
|
+
|
|
67
107
|
return result;
|
|
68
108
|
}, {} );
|
|
69
109
|
|