@wordpress/core-data 6.3.3 → 6.5.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 +4 -0
- package/README.md +1 -1
- package/build/actions.js +6 -6
- package/build/actions.js.map +1 -1
- package/build/entities.js +7 -7
- package/build/entities.js.map +1 -1
- package/build/hooks/use-entity-record.js +4 -4
- package/build/hooks/use-entity-record.js.map +1 -1
- package/build/hooks/use-entity-records.js +4 -4
- package/build/hooks/use-entity-records.js.map +1 -1
- package/build/hooks/use-resource-permissions.js +2 -2
- package/build/hooks/use-resource-permissions.js.map +1 -1
- package/build/queried-data/selectors.js +4 -1
- package/build/queried-data/selectors.js.map +1 -1
- package/build/reducer.js +3 -1
- package/build/reducer.js.map +1 -1
- package/build/selectors.js +158 -135
- package/build/selectors.js.map +1 -1
- package/build-module/actions.js +6 -6
- package/build-module/actions.js.map +1 -1
- package/build-module/entities.js +7 -6
- package/build-module/entities.js.map +1 -1
- package/build-module/hooks/use-entity-record.js +4 -4
- package/build-module/hooks/use-entity-record.js.map +1 -1
- package/build-module/hooks/use-entity-records.js +4 -4
- package/build-module/hooks/use-entity-records.js.map +1 -1
- package/build-module/hooks/use-resource-permissions.js +2 -2
- package/build-module/hooks/use-resource-permissions.js.map +1 -1
- package/build-module/queried-data/selectors.js +5 -2
- package/build-module/queried-data/selectors.js.map +1 -1
- package/build-module/reducer.js +4 -2
- package/build-module/reducer.js.map +1 -1
- package/build-module/selectors.js +159 -136
- package/build-module/selectors.js.map +1 -1
- package/build-types/actions.d.ts +1 -1
- package/build-types/actions.d.ts.map +1 -1
- package/build-types/entities.d.ts.map +1 -1
- package/build-types/hooks/use-entity-record.d.ts +4 -4
- package/build-types/hooks/use-entity-records.d.ts +4 -4
- package/build-types/hooks/use-resource-permissions.d.ts +2 -2
- package/build-types/index.d.ts +1 -1
- package/build-types/queried-data/selectors.d.ts.map +1 -1
- package/build-types/reducer.d.ts.map +1 -1
- package/build-types/selectors.d.ts +130 -117
- package/build-types/selectors.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/actions.js +6 -6
- package/src/entities.js +1 -2
- package/src/hooks/use-entity-record.ts +4 -4
- package/src/hooks/use-entity-records.ts +4 -4
- package/src/hooks/use-resource-permissions.ts +2 -2
- package/src/queried-data/selectors.js +5 -2
- package/src/reducer.js +2 -6
- package/src/selectors.ts +174 -218
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -14,6 +14,7 @@ export interface State {
|
|
|
14
14
|
themeBaseGlobalStyles: Record<string, Object>;
|
|
15
15
|
themeGlobalStyleVariations: Record<string, string>;
|
|
16
16
|
undo: UndoState;
|
|
17
|
+
userPermissions: Record<string, boolean>;
|
|
17
18
|
users: UserState;
|
|
18
19
|
}
|
|
19
20
|
declare type EntityRecordKey = string | number;
|
|
@@ -21,11 +22,23 @@ interface EntitiesState {
|
|
|
21
22
|
config: EntityConfig[];
|
|
22
23
|
records: Record<string, Record<string, EntityState<ET.EntityRecord>>>;
|
|
23
24
|
}
|
|
25
|
+
interface QueriedData {
|
|
26
|
+
items: Record<ET.Context, Record<number, ET.EntityRecord>>;
|
|
27
|
+
itemIsComplete: Record<ET.Context, Record<number, boolean>>;
|
|
28
|
+
queries: Record<ET.Context, Record<string, Array<number>>>;
|
|
29
|
+
}
|
|
24
30
|
interface EntityState<EntityRecord extends ET.EntityRecord> {
|
|
25
31
|
edits: Record<string, Partial<EntityRecord>>;
|
|
26
|
-
saving: Record<string, {
|
|
32
|
+
saving: Record<string, Partial<{
|
|
27
33
|
pending: boolean;
|
|
28
|
-
|
|
34
|
+
isAutosave: boolean;
|
|
35
|
+
error: Error;
|
|
36
|
+
}>>;
|
|
37
|
+
deleting: Record<string, Partial<{
|
|
38
|
+
pending: boolean;
|
|
39
|
+
error: Error;
|
|
40
|
+
}>>;
|
|
41
|
+
queriedData: QueriedData;
|
|
29
42
|
}
|
|
30
43
|
interface EntityConfig {
|
|
31
44
|
name: string;
|
|
@@ -48,8 +61,8 @@ declare type GetRecordsHttpQuery = Record<string, any>;
|
|
|
48
61
|
* Returns true if a request is in progress for embed preview data, or false
|
|
49
62
|
* otherwise.
|
|
50
63
|
*
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
64
|
+
* @param state Data state.
|
|
65
|
+
* @param url URL the preview would be for.
|
|
53
66
|
*
|
|
54
67
|
* @return Whether a request is in progress for an embed preview.
|
|
55
68
|
*/
|
|
@@ -59,16 +72,16 @@ export declare const isRequestingEmbedPreview: Function;
|
|
|
59
72
|
*
|
|
60
73
|
* @deprecated since 11.3. Callers should use `select( 'core' ).getUsers({ who: 'authors' })` instead.
|
|
61
74
|
*
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
*
|
|
75
|
+
* @param state Data state.
|
|
76
|
+
* @param query Optional object of query parameters to
|
|
77
|
+
* include with request.
|
|
65
78
|
* @return Authors list.
|
|
66
79
|
*/
|
|
67
80
|
export declare function getAuthors(state: State, query?: GetRecordsHttpQuery): ET.User[];
|
|
68
81
|
/**
|
|
69
82
|
* Returns the current user.
|
|
70
83
|
*
|
|
71
|
-
* @param
|
|
84
|
+
* @param state Data state.
|
|
72
85
|
*
|
|
73
86
|
* @return Current user object.
|
|
74
87
|
*/
|
|
@@ -76,8 +89,8 @@ export declare function getCurrentUser(state: State): ET.User<'edit'>;
|
|
|
76
89
|
/**
|
|
77
90
|
* Returns all the users returned by a query ID.
|
|
78
91
|
*
|
|
79
|
-
* @param
|
|
80
|
-
* @param
|
|
92
|
+
* @param state Data state.
|
|
93
|
+
* @param queryID Query ID.
|
|
81
94
|
*
|
|
82
95
|
* @return Users list.
|
|
83
96
|
*/
|
|
@@ -86,8 +99,8 @@ export declare const getUserQueryResults: ((state: State, queryID: string) => ET
|
|
|
86
99
|
* Returns the loaded entities for the given kind.
|
|
87
100
|
*
|
|
88
101
|
* @deprecated since WordPress 6.0. Use getEntitiesConfig instead
|
|
89
|
-
* @param
|
|
90
|
-
* @param
|
|
102
|
+
* @param state Data state.
|
|
103
|
+
* @param kind Entity kind.
|
|
91
104
|
*
|
|
92
105
|
* @return Array of entities with config matching kind.
|
|
93
106
|
*/
|
|
@@ -95,8 +108,8 @@ export declare function getEntitiesByKind(state: State, kind: string): Array<any
|
|
|
95
108
|
/**
|
|
96
109
|
* Returns the loaded entities for the given kind.
|
|
97
110
|
*
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
111
|
+
* @param state Data state.
|
|
112
|
+
* @param kind Entity kind.
|
|
100
113
|
*
|
|
101
114
|
* @return Array of entities with config matching kind.
|
|
102
115
|
*/
|
|
@@ -105,9 +118,9 @@ export declare function getEntitiesConfig(state: State, kind: string): Array<any
|
|
|
105
118
|
* Returns the entity config given its kind and name.
|
|
106
119
|
*
|
|
107
120
|
* @deprecated since WordPress 6.0. Use getEntityConfig instead
|
|
108
|
-
* @param
|
|
109
|
-
* @param
|
|
110
|
-
* @param
|
|
121
|
+
* @param state Data state.
|
|
122
|
+
* @param kind Entity kind.
|
|
123
|
+
* @param name Entity name.
|
|
111
124
|
*
|
|
112
125
|
* @return Entity config
|
|
113
126
|
*/
|
|
@@ -115,9 +128,9 @@ export declare function getEntity(state: State, kind: string, name: string): any
|
|
|
115
128
|
/**
|
|
116
129
|
* Returns the entity config given its kind and name.
|
|
117
130
|
*
|
|
118
|
-
* @param
|
|
119
|
-
* @param
|
|
120
|
-
* @param
|
|
131
|
+
* @param state Data state.
|
|
132
|
+
* @param kind Entity kind.
|
|
133
|
+
* @param name Entity name.
|
|
121
134
|
*
|
|
122
135
|
* @return Entity config
|
|
123
136
|
*/
|
|
@@ -155,12 +168,12 @@ export interface GetEntityRecord {
|
|
|
155
168
|
* yet received, undefined if the value entity is known to not exist, or the
|
|
156
169
|
* entity object if it exists and is received.
|
|
157
170
|
*
|
|
158
|
-
* @param
|
|
159
|
-
* @param
|
|
160
|
-
* @param
|
|
161
|
-
* @param
|
|
162
|
-
* @param
|
|
163
|
-
*
|
|
171
|
+
* @param state State tree
|
|
172
|
+
* @param kind Entity kind.
|
|
173
|
+
* @param name Entity name.
|
|
174
|
+
* @param key Record's key
|
|
175
|
+
* @param query Optional query. If requesting specific
|
|
176
|
+
* fields, fields must always include the ID.
|
|
164
177
|
*
|
|
165
178
|
* @return Record.
|
|
166
179
|
*/
|
|
@@ -168,10 +181,10 @@ export declare const getEntityRecord: GetEntityRecord;
|
|
|
168
181
|
/**
|
|
169
182
|
* Returns the Entity's record object by key. Doesn't trigger a resolver nor requests the entity records from the API if the entity record isn't available in the local state.
|
|
170
183
|
*
|
|
171
|
-
* @param
|
|
172
|
-
* @param
|
|
173
|
-
* @param
|
|
174
|
-
* @param
|
|
184
|
+
* @param state State tree
|
|
185
|
+
* @param kind Entity kind.
|
|
186
|
+
* @param name Entity name.
|
|
187
|
+
* @param key Record's key
|
|
175
188
|
*
|
|
176
189
|
* @return Record.
|
|
177
190
|
*/
|
|
@@ -180,10 +193,10 @@ export declare function __experimentalGetEntityRecordNoResolver<EntityRecord ext
|
|
|
180
193
|
* Returns the entity's record object by key,
|
|
181
194
|
* with its attributes mapped to their raw values.
|
|
182
195
|
*
|
|
183
|
-
* @param
|
|
184
|
-
* @param
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
196
|
+
* @param state State tree.
|
|
197
|
+
* @param kind Entity kind.
|
|
198
|
+
* @param name Entity name.
|
|
199
|
+
* @param key Record's key.
|
|
187
200
|
*
|
|
188
201
|
* @return Object with the entity's raw attributes.
|
|
189
202
|
*/
|
|
@@ -192,10 +205,10 @@ export declare const getRawEntityRecord: (<EntityRecord extends ET.Attachment<an
|
|
|
192
205
|
* Returns true if records have been received for the given set of parameters,
|
|
193
206
|
* or false otherwise.
|
|
194
207
|
*
|
|
195
|
-
* @param
|
|
196
|
-
* @param
|
|
197
|
-
* @param
|
|
198
|
-
* @param
|
|
208
|
+
* @param state State tree
|
|
209
|
+
* @param kind Entity kind.
|
|
210
|
+
* @param name Entity name.
|
|
211
|
+
* @param query Optional terms query.
|
|
199
212
|
*
|
|
200
213
|
* @return Whether entity records have been received.
|
|
201
214
|
*/
|
|
@@ -215,11 +228,11 @@ export interface GetEntityRecords {
|
|
|
215
228
|
/**
|
|
216
229
|
* Returns the Entity's records.
|
|
217
230
|
*
|
|
218
|
-
* @param
|
|
219
|
-
* @param
|
|
220
|
-
* @param
|
|
221
|
-
* @param
|
|
222
|
-
*
|
|
231
|
+
* @param state State tree
|
|
232
|
+
* @param kind Entity kind.
|
|
233
|
+
* @param name Entity name.
|
|
234
|
+
* @param query Optional terms query. If requesting specific
|
|
235
|
+
* fields, fields must always include the ID.
|
|
223
236
|
*
|
|
224
237
|
* @return Records.
|
|
225
238
|
*/
|
|
@@ -233,7 +246,7 @@ declare type DirtyEntityRecord = {
|
|
|
233
246
|
/**
|
|
234
247
|
* Returns the list of dirty entity records.
|
|
235
248
|
*
|
|
236
|
-
* @param
|
|
249
|
+
* @param state State tree.
|
|
237
250
|
*
|
|
238
251
|
* @return The list of updated records
|
|
239
252
|
*/
|
|
@@ -241,7 +254,7 @@ export declare const __experimentalGetDirtyEntityRecords: ((state: State) => Arr
|
|
|
241
254
|
/**
|
|
242
255
|
* Returns the list of entities currently being saved.
|
|
243
256
|
*
|
|
244
|
-
* @param
|
|
257
|
+
* @param state State tree.
|
|
245
258
|
*
|
|
246
259
|
* @return The list of records being saved.
|
|
247
260
|
*/
|
|
@@ -249,10 +262,10 @@ export declare const __experimentalGetEntitiesBeingSaved: ((state: State) => Arr
|
|
|
249
262
|
/**
|
|
250
263
|
* Returns the specified entity record's edits.
|
|
251
264
|
*
|
|
252
|
-
* @param
|
|
253
|
-
* @param
|
|
254
|
-
* @param
|
|
255
|
-
* @param
|
|
265
|
+
* @param state State tree.
|
|
266
|
+
* @param kind Entity kind.
|
|
267
|
+
* @param name Entity name.
|
|
268
|
+
* @param recordId Record ID.
|
|
256
269
|
*
|
|
257
270
|
* @return The entity record's edits.
|
|
258
271
|
*/
|
|
@@ -264,10 +277,10 @@ export declare function getEntityRecordEdits(state: State, kind: string, name: s
|
|
|
264
277
|
* are not considered for change detection.
|
|
265
278
|
* They are defined in the entity's config.
|
|
266
279
|
*
|
|
267
|
-
* @param
|
|
268
|
-
* @param
|
|
269
|
-
* @param
|
|
270
|
-
* @param
|
|
280
|
+
* @param state State tree.
|
|
281
|
+
* @param kind Entity kind.
|
|
282
|
+
* @param name Entity name.
|
|
283
|
+
* @param recordId Record ID.
|
|
271
284
|
*
|
|
272
285
|
* @return The entity record's non transient edits.
|
|
273
286
|
*/
|
|
@@ -276,10 +289,10 @@ export declare const getEntityRecordNonTransientEdits: ((state: State, kind: str
|
|
|
276
289
|
* Returns true if the specified entity record has edits,
|
|
277
290
|
* and false otherwise.
|
|
278
291
|
*
|
|
279
|
-
* @param
|
|
280
|
-
* @param
|
|
281
|
-
* @param
|
|
282
|
-
* @param
|
|
292
|
+
* @param state State tree.
|
|
293
|
+
* @param kind Entity kind.
|
|
294
|
+
* @param name Entity name.
|
|
295
|
+
* @param recordId Record ID.
|
|
283
296
|
*
|
|
284
297
|
* @return Whether the entity record has edits or not.
|
|
285
298
|
*/
|
|
@@ -287,10 +300,10 @@ export declare function hasEditsForEntityRecord(state: State, kind: string, name
|
|
|
287
300
|
/**
|
|
288
301
|
* Returns the specified entity record, merged with its edits.
|
|
289
302
|
*
|
|
290
|
-
* @param
|
|
291
|
-
* @param
|
|
292
|
-
* @param
|
|
293
|
-
* @param
|
|
303
|
+
* @param state State tree.
|
|
304
|
+
* @param kind Entity kind.
|
|
305
|
+
* @param name Entity name.
|
|
306
|
+
* @param recordId Record ID.
|
|
294
307
|
*
|
|
295
308
|
* @return The entity record, merged with its edits.
|
|
296
309
|
*/
|
|
@@ -298,10 +311,10 @@ export declare const getEditedEntityRecord: (<EntityRecord extends ET.Attachment
|
|
|
298
311
|
/**
|
|
299
312
|
* Returns true if the specified entity record is autosaving, and false otherwise.
|
|
300
313
|
*
|
|
301
|
-
* @param
|
|
302
|
-
* @param
|
|
303
|
-
* @param
|
|
304
|
-
* @param
|
|
314
|
+
* @param state State tree.
|
|
315
|
+
* @param kind Entity kind.
|
|
316
|
+
* @param name Entity name.
|
|
317
|
+
* @param recordId Record ID.
|
|
305
318
|
*
|
|
306
319
|
* @return Whether the entity record is autosaving or not.
|
|
307
320
|
*/
|
|
@@ -309,10 +322,10 @@ export declare function isAutosavingEntityRecord(state: State, kind: string, nam
|
|
|
309
322
|
/**
|
|
310
323
|
* Returns true if the specified entity record is saving, and false otherwise.
|
|
311
324
|
*
|
|
312
|
-
* @param
|
|
313
|
-
* @param
|
|
314
|
-
* @param
|
|
315
|
-
* @param
|
|
325
|
+
* @param state State tree.
|
|
326
|
+
* @param kind Entity kind.
|
|
327
|
+
* @param name Entity name.
|
|
328
|
+
* @param recordId Record ID.
|
|
316
329
|
*
|
|
317
330
|
* @return Whether the entity record is saving or not.
|
|
318
331
|
*/
|
|
@@ -320,10 +333,10 @@ export declare function isSavingEntityRecord(state: State, kind: string, name: s
|
|
|
320
333
|
/**
|
|
321
334
|
* Returns true if the specified entity record is deleting, and false otherwise.
|
|
322
335
|
*
|
|
323
|
-
* @param
|
|
324
|
-
* @param
|
|
325
|
-
* @param
|
|
326
|
-
* @param
|
|
336
|
+
* @param state State tree.
|
|
337
|
+
* @param kind Entity kind.
|
|
338
|
+
* @param name Entity name.
|
|
339
|
+
* @param recordId Record ID.
|
|
327
340
|
*
|
|
328
341
|
* @return Whether the entity record is deleting or not.
|
|
329
342
|
*/
|
|
@@ -331,10 +344,10 @@ export declare function isDeletingEntityRecord(state: State, kind: string, name:
|
|
|
331
344
|
/**
|
|
332
345
|
* Returns the specified entity record's last save error.
|
|
333
346
|
*
|
|
334
|
-
* @param
|
|
335
|
-
* @param
|
|
336
|
-
* @param
|
|
337
|
-
* @param
|
|
347
|
+
* @param state State tree.
|
|
348
|
+
* @param kind Entity kind.
|
|
349
|
+
* @param name Entity name.
|
|
350
|
+
* @param recordId Record ID.
|
|
338
351
|
*
|
|
339
352
|
* @return The entity record's save error.
|
|
340
353
|
*/
|
|
@@ -342,10 +355,10 @@ export declare function getLastEntitySaveError(state: State, kind: string, name:
|
|
|
342
355
|
/**
|
|
343
356
|
* Returns the specified entity record's last delete error.
|
|
344
357
|
*
|
|
345
|
-
* @param
|
|
346
|
-
* @param
|
|
347
|
-
* @param
|
|
348
|
-
* @param
|
|
358
|
+
* @param state State tree.
|
|
359
|
+
* @param kind Entity kind.
|
|
360
|
+
* @param name Entity name.
|
|
361
|
+
* @param recordId Record ID.
|
|
349
362
|
*
|
|
350
363
|
* @return The entity record's save error.
|
|
351
364
|
*/
|
|
@@ -354,7 +367,7 @@ export declare function getLastEntityDeleteError(state: State, kind: string, nam
|
|
|
354
367
|
* Returns the previous edit from the current undo offset
|
|
355
368
|
* for the entity records edits history, if any.
|
|
356
369
|
*
|
|
357
|
-
* @param
|
|
370
|
+
* @param state State tree.
|
|
358
371
|
*
|
|
359
372
|
* @return The edit.
|
|
360
373
|
*/
|
|
@@ -363,7 +376,7 @@ export declare function getUndoEdit(state: State): Optional<any>;
|
|
|
363
376
|
* Returns the next edit from the current undo offset
|
|
364
377
|
* for the entity records edits history, if any.
|
|
365
378
|
*
|
|
366
|
-
* @param
|
|
379
|
+
* @param state State tree.
|
|
367
380
|
*
|
|
368
381
|
* @return The edit.
|
|
369
382
|
*/
|
|
@@ -372,7 +385,7 @@ export declare function getRedoEdit(state: State): Optional<any>;
|
|
|
372
385
|
* Returns true if there is a previous edit from the current undo offset
|
|
373
386
|
* for the entity records edits history, and false otherwise.
|
|
374
387
|
*
|
|
375
|
-
* @param
|
|
388
|
+
* @param state State tree.
|
|
376
389
|
*
|
|
377
390
|
* @return Whether there is a previous edit or not.
|
|
378
391
|
*/
|
|
@@ -381,7 +394,7 @@ export declare function hasUndo(state: State): boolean;
|
|
|
381
394
|
* Returns true if there is a next edit from the current undo offset
|
|
382
395
|
* for the entity records edits history, and false otherwise.
|
|
383
396
|
*
|
|
384
|
-
* @param
|
|
397
|
+
* @param state State tree.
|
|
385
398
|
*
|
|
386
399
|
* @return Whether there is a next edit or not.
|
|
387
400
|
*/
|
|
@@ -389,7 +402,7 @@ export declare function hasRedo(state: State): boolean;
|
|
|
389
402
|
/**
|
|
390
403
|
* Return the current theme.
|
|
391
404
|
*
|
|
392
|
-
* @param
|
|
405
|
+
* @param state Data state.
|
|
393
406
|
*
|
|
394
407
|
* @return The current theme.
|
|
395
408
|
*/
|
|
@@ -397,7 +410,7 @@ export declare function getCurrentTheme(state: State): any;
|
|
|
397
410
|
/**
|
|
398
411
|
* Return the ID of the current global styles object.
|
|
399
412
|
*
|
|
400
|
-
* @param
|
|
413
|
+
* @param state Data state.
|
|
401
414
|
*
|
|
402
415
|
* @return The current global styles ID.
|
|
403
416
|
*/
|
|
@@ -405,7 +418,7 @@ export declare function __experimentalGetCurrentGlobalStylesId(state: State): st
|
|
|
405
418
|
/**
|
|
406
419
|
* Return theme supports data in the index.
|
|
407
420
|
*
|
|
408
|
-
* @param
|
|
421
|
+
* @param state Data state.
|
|
409
422
|
*
|
|
410
423
|
* @return Index data.
|
|
411
424
|
*/
|
|
@@ -413,8 +426,8 @@ export declare function getThemeSupports(state: State): any;
|
|
|
413
426
|
/**
|
|
414
427
|
* Returns the embed preview for the given URL.
|
|
415
428
|
*
|
|
416
|
-
* @param
|
|
417
|
-
* @param
|
|
429
|
+
* @param state Data state.
|
|
430
|
+
* @param url Embedded URL.
|
|
418
431
|
*
|
|
419
432
|
* @return Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API.
|
|
420
433
|
*/
|
|
@@ -426,8 +439,8 @@ export declare function getEmbedPreview(state: State, url: string): any;
|
|
|
426
439
|
* We need to be able to determine if a URL is embeddable or not, based on what we
|
|
427
440
|
* get back from the oEmbed preview API.
|
|
428
441
|
*
|
|
429
|
-
* @param
|
|
430
|
-
* @param
|
|
442
|
+
* @param state Data state.
|
|
443
|
+
* @param url Embedded URL.
|
|
431
444
|
*
|
|
432
445
|
* @return Is the preview for the URL an oEmbed link fallback.
|
|
433
446
|
*/
|
|
@@ -441,10 +454,10 @@ export declare function isPreviewEmbedFallback(state: State, url: string): boole
|
|
|
441
454
|
*
|
|
442
455
|
* https://developer.wordpress.org/rest-api/reference/
|
|
443
456
|
*
|
|
444
|
-
* @param
|
|
445
|
-
* @param
|
|
446
|
-
* @param
|
|
447
|
-
* @param
|
|
457
|
+
* @param state Data state.
|
|
458
|
+
* @param action Action to check. One of: 'create', 'read', 'update', 'delete'.
|
|
459
|
+
* @param resource REST resource to check, e.g. 'media' or 'posts'.
|
|
460
|
+
* @param id Optional ID of the rest resource to check.
|
|
448
461
|
*
|
|
449
462
|
* @return Whether or not the user can perform the action,
|
|
450
463
|
* or `undefined` if the OPTIONS request is still being made.
|
|
@@ -458,10 +471,10 @@ export declare function canUser(state: State, action: string, resource: string,
|
|
|
458
471
|
*
|
|
459
472
|
* https://developer.wordpress.org/rest-api/reference/
|
|
460
473
|
*
|
|
461
|
-
* @param
|
|
462
|
-
* @param
|
|
463
|
-
* @param
|
|
464
|
-
* @param
|
|
474
|
+
* @param state Data state.
|
|
475
|
+
* @param kind Entity kind.
|
|
476
|
+
* @param name Entity name.
|
|
477
|
+
* @param recordId Record's id.
|
|
465
478
|
* @return Whether or not the user can edit,
|
|
466
479
|
* or `undefined` if the OPTIONS request is still being made.
|
|
467
480
|
*/
|
|
@@ -472,9 +485,9 @@ export declare function canUserEditEntityRecord(state: State, kind: string, name
|
|
|
472
485
|
* May return multiple autosaves since the backend stores one autosave per
|
|
473
486
|
* author for each post.
|
|
474
487
|
*
|
|
475
|
-
* @param
|
|
476
|
-
* @param
|
|
477
|
-
* @param
|
|
488
|
+
* @param state State tree.
|
|
489
|
+
* @param postType The type of the parent post.
|
|
490
|
+
* @param postId The id of the parent post.
|
|
478
491
|
*
|
|
479
492
|
* @return An array of autosaves for the post, or undefined if there is none.
|
|
480
493
|
*/
|
|
@@ -482,10 +495,10 @@ export declare function getAutosaves(state: State, postType: string, postId: Ent
|
|
|
482
495
|
/**
|
|
483
496
|
* Returns the autosave for the post and author.
|
|
484
497
|
*
|
|
485
|
-
* @param
|
|
486
|
-
* @param
|
|
487
|
-
* @param
|
|
488
|
-
* @param
|
|
498
|
+
* @param state State tree.
|
|
499
|
+
* @param postType The type of the parent post.
|
|
500
|
+
* @param postId The id of the parent post.
|
|
501
|
+
* @param authorId The id of the author.
|
|
489
502
|
*
|
|
490
503
|
* @return The autosave for the post and author.
|
|
491
504
|
*/
|
|
@@ -493,9 +506,9 @@ export declare function getAutosave<EntityRecord extends ET.EntityRecord<any>>(s
|
|
|
493
506
|
/**
|
|
494
507
|
* Returns true if the REST request for autosaves has completed.
|
|
495
508
|
*
|
|
496
|
-
* @param
|
|
497
|
-
* @param
|
|
498
|
-
* @param
|
|
509
|
+
* @param state State tree.
|
|
510
|
+
* @param postType The type of the parent post.
|
|
511
|
+
* @param postId The id of the parent post.
|
|
499
512
|
*
|
|
500
513
|
* @return True if the REST request was completed. False otherwise.
|
|
501
514
|
*/
|
|
@@ -514,7 +527,7 @@ export declare const hasFetchedAutosaves: Function;
|
|
|
514
527
|
* );
|
|
515
528
|
* ```
|
|
516
529
|
*
|
|
517
|
-
* @param
|
|
530
|
+
* @param state Editor state.
|
|
518
531
|
*
|
|
519
532
|
* @return A value whose reference will change only when an edit occurs.
|
|
520
533
|
*/
|
|
@@ -522,8 +535,8 @@ export declare const getReferenceByDistinctEdits: ((state: State) => never[]) &
|
|
|
522
535
|
/**
|
|
523
536
|
* Retrieve the frontend template used for a given link.
|
|
524
537
|
*
|
|
525
|
-
* @param
|
|
526
|
-
* @param
|
|
538
|
+
* @param state Editor state.
|
|
539
|
+
* @param link Link.
|
|
527
540
|
*
|
|
528
541
|
* @return The template record.
|
|
529
542
|
*/
|
|
@@ -531,7 +544,7 @@ export declare function __experimentalGetTemplateForLink(state: State, link: str
|
|
|
531
544
|
/**
|
|
532
545
|
* Retrieve the current theme's base global styles
|
|
533
546
|
*
|
|
534
|
-
* @param
|
|
547
|
+
* @param state Editor state.
|
|
535
548
|
*
|
|
536
549
|
* @return The Global Styles object.
|
|
537
550
|
*/
|
|
@@ -539,7 +552,7 @@ export declare function __experimentalGetCurrentThemeBaseGlobalStyles(state: Sta
|
|
|
539
552
|
/**
|
|
540
553
|
* Return the ID of the current global styles object.
|
|
541
554
|
*
|
|
542
|
-
* @param
|
|
555
|
+
* @param state Data state.
|
|
543
556
|
*
|
|
544
557
|
* @return The current global styles ID.
|
|
545
558
|
*/
|
|
@@ -547,7 +560,7 @@ export declare function __experimentalGetCurrentThemeGlobalStylesVariations(stat
|
|
|
547
560
|
/**
|
|
548
561
|
* Retrieve the list of registered block patterns.
|
|
549
562
|
*
|
|
550
|
-
* @param
|
|
563
|
+
* @param state Data state.
|
|
551
564
|
*
|
|
552
565
|
* @return Block pattern list.
|
|
553
566
|
*/
|
|
@@ -555,7 +568,7 @@ export declare function getBlockPatterns(state: State): Array<any>;
|
|
|
555
568
|
/**
|
|
556
569
|
* Retrieve the list of registered block pattern categories.
|
|
557
570
|
*
|
|
558
|
-
* @param
|
|
571
|
+
* @param state Data state.
|
|
559
572
|
*
|
|
560
573
|
* @return Block pattern category list.
|
|
561
574
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../src/selectors.ts"],"names":[],"mappings":";AAoBA,OAAO,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAM1C,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,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,EAAE,CAAC,IAAI,CAAE,MAAM,CAAE,CAAC;IAC/B,aAAa,EAAE,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G,CAAE,CAEtE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/core-data",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.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",
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/api-fetch": "^6.
|
|
35
|
-
"@wordpress/blocks": "^12.
|
|
36
|
-
"@wordpress/compose": "^6.
|
|
37
|
-
"@wordpress/data": "^8.
|
|
38
|
-
"@wordpress/deprecated": "^3.
|
|
39
|
-
"@wordpress/element": "^5.
|
|
40
|
-
"@wordpress/html-entities": "^3.
|
|
41
|
-
"@wordpress/i18n": "^4.
|
|
42
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
43
|
-
"@wordpress/url": "^3.
|
|
34
|
+
"@wordpress/api-fetch": "^6.25.0",
|
|
35
|
+
"@wordpress/blocks": "^12.5.0",
|
|
36
|
+
"@wordpress/compose": "^6.5.0",
|
|
37
|
+
"@wordpress/data": "^8.5.0",
|
|
38
|
+
"@wordpress/deprecated": "^3.28.0",
|
|
39
|
+
"@wordpress/element": "^5.5.0",
|
|
40
|
+
"@wordpress/html-entities": "^3.28.0",
|
|
41
|
+
"@wordpress/i18n": "^4.28.0",
|
|
42
|
+
"@wordpress/is-shallow-equal": "^4.28.0",
|
|
43
|
+
"@wordpress/url": "^3.29.0",
|
|
44
44
|
"change-case": "^4.1.2",
|
|
45
45
|
"equivalent-key-map": "^0.2.2",
|
|
46
46
|
"fast-deep-equal": "^3.1.3",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "d5e03a74b79e3ca84afda24375474a103a063ee4"
|
|
59
59
|
}
|
package/src/actions.js
CHANGED
|
@@ -319,12 +319,12 @@ export const deleteEntityRecord =
|
|
|
319
319
|
* Returns an action object that triggers an
|
|
320
320
|
* edit to an entity record.
|
|
321
321
|
*
|
|
322
|
-
* @param {string}
|
|
323
|
-
* @param {string}
|
|
324
|
-
* @param {number}
|
|
325
|
-
* @param {Object}
|
|
326
|
-
* @param {Object}
|
|
327
|
-
* @param {boolean}
|
|
322
|
+
* @param {string} kind Kind of the edited entity record.
|
|
323
|
+
* @param {string} name Name of the edited entity record.
|
|
324
|
+
* @param {number|string} recordId Record ID of the edited entity record.
|
|
325
|
+
* @param {Object} edits The edits.
|
|
326
|
+
* @param {Object} options Options for the edit.
|
|
327
|
+
* @param {boolean} [options.undoIgnore] Whether to ignore the edit in undo history or not.
|
|
328
328
|
*
|
|
329
329
|
* @return {Object} Action object.
|
|
330
330
|
*/
|
package/src/entities.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { capitalCase, pascalCase } from 'change-case';
|
|
5
|
-
import { get } from 'lodash';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -45,7 +44,7 @@ export const rootEntitiesConfig = [
|
|
|
45
44
|
kind: 'root',
|
|
46
45
|
baseURL: '/wp/v2/settings',
|
|
47
46
|
getTitle: ( record ) => {
|
|
48
|
-
return
|
|
47
|
+
return record?.title ?? __( 'Site Title' );
|
|
49
48
|
},
|
|
50
49
|
},
|
|
51
50
|
{
|