@wordpress/core-data 6.3.2 → 6.4.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +1 -1
  3. package/build/actions.js +6 -6
  4. package/build/actions.js.map +1 -1
  5. package/build/hooks/use-entity-record.js +4 -4
  6. package/build/hooks/use-entity-record.js.map +1 -1
  7. package/build/hooks/use-entity-records.js +4 -4
  8. package/build/hooks/use-entity-records.js.map +1 -1
  9. package/build/hooks/use-resource-permissions.js +2 -2
  10. package/build/hooks/use-resource-permissions.js.map +1 -1
  11. package/build/selectors.js +116 -116
  12. package/build/selectors.js.map +1 -1
  13. package/build-module/actions.js +6 -6
  14. package/build-module/actions.js.map +1 -1
  15. package/build-module/hooks/use-entity-record.js +4 -4
  16. package/build-module/hooks/use-entity-record.js.map +1 -1
  17. package/build-module/hooks/use-entity-records.js +4 -4
  18. package/build-module/hooks/use-entity-records.js.map +1 -1
  19. package/build-module/hooks/use-resource-permissions.js +2 -2
  20. package/build-module/hooks/use-resource-permissions.js.map +1 -1
  21. package/build-module/selectors.js +116 -116
  22. package/build-module/selectors.js.map +1 -1
  23. package/build-types/actions.d.ts +1 -1
  24. package/build-types/actions.d.ts.map +1 -1
  25. package/build-types/hooks/use-entity-record.d.ts +4 -4
  26. package/build-types/hooks/use-entity-records.d.ts +4 -4
  27. package/build-types/hooks/use-resource-permissions.d.ts +2 -2
  28. package/build-types/index.d.ts +1 -1
  29. package/build-types/selectors.d.ts +115 -115
  30. package/package.json +12 -12
  31. package/src/actions.js +6 -6
  32. package/src/hooks/use-entity-record.ts +4 -4
  33. package/src/hooks/use-entity-records.ts +4 -4
  34. package/src/hooks/use-resource-permissions.ts +2 -2
  35. package/src/selectors.ts +116 -116
  36. package/tsconfig.tsbuildinfo +1 -1
@@ -90,8 +90,8 @@ const EMPTY_OBJECT = {};
90
90
  * Returns true if a request is in progress for embed preview data, or false
91
91
  * otherwise.
92
92
  *
93
- * @param state Data state.
94
- * @param url URL the preview would be for.
93
+ * @param state Data state.
94
+ * @param url URL the preview would be for.
95
95
  *
96
96
  * @return Whether a request is in progress for an embed preview.
97
97
  */
@@ -104,9 +104,9 @@ const isRequestingEmbedPreview = (0, _data.createRegistrySelector)(select => (st
104
104
  *
105
105
  * @deprecated since 11.3. Callers should use `select( 'core' ).getUsers({ who: 'authors' })` instead.
106
106
  *
107
- * @param state Data state.
108
- * @param query Optional object of query parameters to
109
- * include with request.
107
+ * @param state Data state.
108
+ * @param query Optional object of query parameters to
109
+ * include with request.
110
110
  * @return Authors list.
111
111
  */
112
112
 
@@ -123,7 +123,7 @@ function getAuthors(state, query) {
123
123
  /**
124
124
  * Returns the current user.
125
125
  *
126
- * @param state Data state.
126
+ * @param state Data state.
127
127
  *
128
128
  * @return Current user object.
129
129
  */
@@ -135,8 +135,8 @@ function getCurrentUser(state) {
135
135
  /**
136
136
  * Returns all the users returned by a query ID.
137
137
  *
138
- * @param state Data state.
139
- * @param queryID Query ID.
138
+ * @param state Data state.
139
+ * @param queryID Query ID.
140
140
  *
141
141
  * @return Users list.
142
142
  */
@@ -152,8 +152,8 @@ const getUserQueryResults = (0, _rememo.default)((state, queryID) => {
152
152
  * Returns the loaded entities for the given kind.
153
153
  *
154
154
  * @deprecated since WordPress 6.0. Use getEntitiesConfig instead
155
- * @param state Data state.
156
- * @param kind Entity kind.
155
+ * @param state Data state.
156
+ * @param kind Entity kind.
157
157
  *
158
158
  * @return Array of entities with config matching kind.
159
159
  */
@@ -170,8 +170,8 @@ function getEntitiesByKind(state, kind) {
170
170
  /**
171
171
  * Returns the loaded entities for the given kind.
172
172
  *
173
- * @param state Data state.
174
- * @param kind Entity kind.
173
+ * @param state Data state.
174
+ * @param kind Entity kind.
175
175
  *
176
176
  * @return Array of entities with config matching kind.
177
177
  */
@@ -184,9 +184,9 @@ function getEntitiesConfig(state, kind) {
184
184
  * Returns the entity config given its kind and name.
185
185
  *
186
186
  * @deprecated since WordPress 6.0. Use getEntityConfig instead
187
- * @param state Data state.
188
- * @param kind Entity kind.
189
- * @param name Entity name.
187
+ * @param state Data state.
188
+ * @param kind Entity kind.
189
+ * @param name Entity name.
190
190
  *
191
191
  * @return Entity config
192
192
  */
@@ -202,9 +202,9 @@ function getEntity(state, kind, name) {
202
202
  /**
203
203
  * Returns the entity config given its kind and name.
204
204
  *
205
- * @param state Data state.
206
- * @param kind Entity kind.
207
- * @param name Entity name.
205
+ * @param state Data state.
206
+ * @param kind Entity kind.
207
+ * @param name Entity name.
208
208
  *
209
209
  * @return Entity config
210
210
  */
@@ -246,12 +246,12 @@ function getEntityConfig(state, kind, name) {
246
246
  * yet received, undefined if the value entity is known to not exist, or the
247
247
  * entity object if it exists and is received.
248
248
  *
249
- * @param state State tree
250
- * @param kind Entity kind.
251
- * @param name Entity name.
252
- * @param key Record's key
253
- * @param query Optional query. If requesting specific
254
- * fields, fields must always include the ID.
249
+ * @param state State tree
250
+ * @param kind Entity kind.
251
+ * @param name Entity name.
252
+ * @param key Record's key
253
+ * @param query Optional query. If requesting specific
254
+ * fields, fields must always include the ID.
255
255
  *
256
256
  * @return Record.
257
257
  */
@@ -304,10 +304,10 @@ const getEntityRecord = (0, _rememo.default)((state, kind, name, key, query) =>
304
304
  /**
305
305
  * 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.
306
306
  *
307
- * @param state State tree
308
- * @param kind Entity kind.
309
- * @param name Entity name.
310
- * @param key Record's key
307
+ * @param state State tree
308
+ * @param kind Entity kind.
309
+ * @param name Entity name.
310
+ * @param key Record's key
311
311
  *
312
312
  * @return Record.
313
313
  */
@@ -321,10 +321,10 @@ function __experimentalGetEntityRecordNoResolver(state, kind, name, key) {
321
321
  * Returns the entity's record object by key,
322
322
  * with its attributes mapped to their raw values.
323
323
  *
324
- * @param state State tree.
325
- * @param kind Entity kind.
326
- * @param name Entity name.
327
- * @param key Record's key.
324
+ * @param state State tree.
325
+ * @param kind Entity kind.
326
+ * @param name Entity name.
327
+ * @param key Record's key.
328
328
  *
329
329
  * @return Object with the entity's raw attributes.
330
330
  */
@@ -354,10 +354,10 @@ const getRawEntityRecord = (0, _rememo.default)((state, kind, name, key) => {
354
354
  * Returns true if records have been received for the given set of parameters,
355
355
  * or false otherwise.
356
356
  *
357
- * @param state State tree
358
- * @param kind Entity kind.
359
- * @param name Entity name.
360
- * @param query Optional terms query.
357
+ * @param state State tree
358
+ * @param kind Entity kind.
359
+ * @param name Entity name.
360
+ * @param query Optional terms query.
361
361
  *
362
362
  * @return Whether entity records have been received.
363
363
  */
@@ -380,11 +380,11 @@ function hasEntityRecords(state, kind, name, query) {
380
380
  /**
381
381
  * Returns the Entity's records.
382
382
  *
383
- * @param state State tree
384
- * @param kind Entity kind.
385
- * @param name Entity name.
386
- * @param query Optional terms query. If requesting specific
387
- * fields, fields must always include the ID.
383
+ * @param state State tree
384
+ * @param kind Entity kind.
385
+ * @param name Entity name.
386
+ * @param query Optional terms query. If requesting specific
387
+ * fields, fields must always include the ID.
388
388
  *
389
389
  * @return Records.
390
390
  */
@@ -405,7 +405,7 @@ exports.getEntityRecords = getEntityRecords;
405
405
  /**
406
406
  * Returns the list of dirty entity records.
407
407
  *
408
- * @param state State tree.
408
+ * @param state State tree.
409
409
  *
410
410
  * @return The list of updated records
411
411
  */
@@ -445,7 +445,7 @@ const __experimentalGetDirtyEntityRecords = (0, _rememo.default)(state => {
445
445
  /**
446
446
  * Returns the list of entities currently being saved.
447
447
  *
448
- * @param state State tree.
448
+ * @param state State tree.
449
449
  *
450
450
  * @return The list of records being saved.
451
451
  */
@@ -487,10 +487,10 @@ const __experimentalGetEntitiesBeingSaved = (0, _rememo.default)(state => {
487
487
  /**
488
488
  * Returns the specified entity record's edits.
489
489
  *
490
- * @param state State tree.
491
- * @param kind Entity kind.
492
- * @param name Entity name.
493
- * @param recordId Record ID.
490
+ * @param state State tree.
491
+ * @param kind Entity kind.
492
+ * @param name Entity name.
493
+ * @param recordId Record ID.
494
494
  *
495
495
  * @return The entity record's edits.
496
496
  */
@@ -508,10 +508,10 @@ function getEntityRecordEdits(state, kind, name, recordId) {
508
508
  * are not considered for change detection.
509
509
  * They are defined in the entity's config.
510
510
  *
511
- * @param state State tree.
512
- * @param kind Entity kind.
513
- * @param name Entity name.
514
- * @param recordId Record ID.
511
+ * @param state State tree.
512
+ * @param kind Entity kind.
513
+ * @param name Entity name.
514
+ * @param recordId Record ID.
515
515
  *
516
516
  * @return The entity record's non transient edits.
517
517
  */
@@ -539,10 +539,10 @@ const getEntityRecordNonTransientEdits = (0, _rememo.default)((state, kind, name
539
539
  * Returns true if the specified entity record has edits,
540
540
  * and false otherwise.
541
541
  *
542
- * @param state State tree.
543
- * @param kind Entity kind.
544
- * @param name Entity name.
545
- * @param recordId Record ID.
542
+ * @param state State tree.
543
+ * @param kind Entity kind.
544
+ * @param name Entity name.
545
+ * @param recordId Record ID.
546
546
  *
547
547
  * @return Whether the entity record has edits or not.
548
548
  */
@@ -555,10 +555,10 @@ function hasEditsForEntityRecord(state, kind, name, recordId) {
555
555
  /**
556
556
  * Returns the specified entity record, merged with its edits.
557
557
  *
558
- * @param state State tree.
559
- * @param kind Entity kind.
560
- * @param name Entity name.
561
- * @param recordId Record ID.
558
+ * @param state State tree.
559
+ * @param kind Entity kind.
560
+ * @param name Entity name.
561
+ * @param recordId Record ID.
562
562
  *
563
563
  * @return The entity record, merged with its edits.
564
564
  */
@@ -575,10 +575,10 @@ const getEditedEntityRecord = (0, _rememo.default)((state, kind, name, recordId)
575
575
  /**
576
576
  * Returns true if the specified entity record is autosaving, and false otherwise.
577
577
  *
578
- * @param state State tree.
579
- * @param kind Entity kind.
580
- * @param name Entity name.
581
- * @param recordId Record ID.
578
+ * @param state State tree.
579
+ * @param kind Entity kind.
580
+ * @param name Entity name.
581
+ * @param recordId Record ID.
582
582
  *
583
583
  * @return Whether the entity record is autosaving or not.
584
584
  */
@@ -595,10 +595,10 @@ function isAutosavingEntityRecord(state, kind, name, recordId) {
595
595
  /**
596
596
  * Returns true if the specified entity record is saving, and false otherwise.
597
597
  *
598
- * @param state State tree.
599
- * @param kind Entity kind.
600
- * @param name Entity name.
601
- * @param recordId Record ID.
598
+ * @param state State tree.
599
+ * @param kind Entity kind.
600
+ * @param name Entity name.
601
+ * @param recordId Record ID.
602
602
  *
603
603
  * @return Whether the entity record is saving or not.
604
604
  */
@@ -610,10 +610,10 @@ function isSavingEntityRecord(state, kind, name, recordId) {
610
610
  /**
611
611
  * Returns true if the specified entity record is deleting, and false otherwise.
612
612
  *
613
- * @param state State tree.
614
- * @param kind Entity kind.
615
- * @param name Entity name.
616
- * @param recordId Record ID.
613
+ * @param state State tree.
614
+ * @param kind Entity kind.
615
+ * @param name Entity name.
616
+ * @param recordId Record ID.
617
617
  *
618
618
  * @return Whether the entity record is deleting or not.
619
619
  */
@@ -625,10 +625,10 @@ function isDeletingEntityRecord(state, kind, name, recordId) {
625
625
  /**
626
626
  * Returns the specified entity record's last save error.
627
627
  *
628
- * @param state State tree.
629
- * @param kind Entity kind.
630
- * @param name Entity name.
631
- * @param recordId Record ID.
628
+ * @param state State tree.
629
+ * @param kind Entity kind.
630
+ * @param name Entity name.
631
+ * @param recordId Record ID.
632
632
  *
633
633
  * @return The entity record's save error.
634
634
  */
@@ -640,10 +640,10 @@ function getLastEntitySaveError(state, kind, name, recordId) {
640
640
  /**
641
641
  * Returns the specified entity record's last delete error.
642
642
  *
643
- * @param state State tree.
644
- * @param kind Entity kind.
645
- * @param name Entity name.
646
- * @param recordId Record ID.
643
+ * @param state State tree.
644
+ * @param kind Entity kind.
645
+ * @param name Entity name.
646
+ * @param recordId Record ID.
647
647
  *
648
648
  * @return The entity record's save error.
649
649
  */
@@ -659,7 +659,7 @@ function getLastEntityDeleteError(state, kind, name, recordId) {
659
659
  * of the history stack we are at. 0 is the
660
660
  * last edit, -1 is the second last, and so on.
661
661
  *
662
- * @param state State tree.
662
+ * @param state State tree.
663
663
  *
664
664
  * @return The current undo offset.
665
665
  */
@@ -672,7 +672,7 @@ function getCurrentUndoOffset(state) {
672
672
  * Returns the previous edit from the current undo offset
673
673
  * for the entity records edits history, if any.
674
674
  *
675
- * @param state State tree.
675
+ * @param state State tree.
676
676
  *
677
677
  * @return The edit.
678
678
  */
@@ -685,7 +685,7 @@ function getUndoEdit(state) {
685
685
  * Returns the next edit from the current undo offset
686
686
  * for the entity records edits history, if any.
687
687
  *
688
- * @param state State tree.
688
+ * @param state State tree.
689
689
  *
690
690
  * @return The edit.
691
691
  */
@@ -698,7 +698,7 @@ function getRedoEdit(state) {
698
698
  * Returns true if there is a previous edit from the current undo offset
699
699
  * for the entity records edits history, and false otherwise.
700
700
  *
701
- * @param state State tree.
701
+ * @param state State tree.
702
702
  *
703
703
  * @return Whether there is a previous edit or not.
704
704
  */
@@ -711,7 +711,7 @@ function hasUndo(state) {
711
711
  * Returns true if there is a next edit from the current undo offset
712
712
  * for the entity records edits history, and false otherwise.
713
713
  *
714
- * @param state State tree.
714
+ * @param state State tree.
715
715
  *
716
716
  * @return Whether there is a next edit or not.
717
717
  */
@@ -723,7 +723,7 @@ function hasRedo(state) {
723
723
  /**
724
724
  * Return the current theme.
725
725
  *
726
- * @param state Data state.
726
+ * @param state Data state.
727
727
  *
728
728
  * @return The current theme.
729
729
  */
@@ -735,7 +735,7 @@ function getCurrentTheme(state) {
735
735
  /**
736
736
  * Return the ID of the current global styles object.
737
737
  *
738
- * @param state Data state.
738
+ * @param state Data state.
739
739
  *
740
740
  * @return The current global styles ID.
741
741
  */
@@ -747,7 +747,7 @@ function __experimentalGetCurrentGlobalStylesId(state) {
747
747
  /**
748
748
  * Return theme supports data in the index.
749
749
  *
750
- * @param state Data state.
750
+ * @param state Data state.
751
751
  *
752
752
  * @return Index data.
753
753
  */
@@ -761,8 +761,8 @@ function getThemeSupports(state) {
761
761
  /**
762
762
  * Returns the embed preview for the given URL.
763
763
  *
764
- * @param state Data state.
765
- * @param url Embedded URL.
764
+ * @param state Data state.
765
+ * @param url Embedded URL.
766
766
  *
767
767
  * @return Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API.
768
768
  */
@@ -778,8 +778,8 @@ function getEmbedPreview(state, url) {
778
778
  * We need to be able to determine if a URL is embeddable or not, based on what we
779
779
  * get back from the oEmbed preview API.
780
780
  *
781
- * @param state Data state.
782
- * @param url Embedded URL.
781
+ * @param state Data state.
782
+ * @param url Embedded URL.
783
783
  *
784
784
  * @return Is the preview for the URL an oEmbed link fallback.
785
785
  */
@@ -804,10 +804,10 @@ function isPreviewEmbedFallback(state, url) {
804
804
  *
805
805
  * https://developer.wordpress.org/rest-api/reference/
806
806
  *
807
- * @param state Data state.
808
- * @param action Action to check. One of: 'create', 'read', 'update', 'delete'.
809
- * @param resource REST resource to check, e.g. 'media' or 'posts'.
810
- * @param id Optional ID of the rest resource to check.
807
+ * @param state Data state.
808
+ * @param action Action to check. One of: 'create', 'read', 'update', 'delete'.
809
+ * @param resource REST resource to check, e.g. 'media' or 'posts'.
810
+ * @param id Optional ID of the rest resource to check.
811
811
  *
812
812
  * @return Whether or not the user can perform the action,
813
813
  * or `undefined` if the OPTIONS request is still being made.
@@ -826,10 +826,10 @@ function canUser(state, action, resource, id) {
826
826
  *
827
827
  * https://developer.wordpress.org/rest-api/reference/
828
828
  *
829
- * @param state Data state.
830
- * @param kind Entity kind.
831
- * @param name Entity name.
832
- * @param recordId Record's id.
829
+ * @param state Data state.
830
+ * @param kind Entity kind.
831
+ * @param name Entity name.
832
+ * @param recordId Record's id.
833
833
  * @return Whether or not the user can edit,
834
834
  * or `undefined` if the OPTIONS request is still being made.
835
835
  */
@@ -851,9 +851,9 @@ function canUserEditEntityRecord(state, kind, name, recordId) {
851
851
  * May return multiple autosaves since the backend stores one autosave per
852
852
  * author for each post.
853
853
  *
854
- * @param state State tree.
855
- * @param postType The type of the parent post.
856
- * @param postId The id of the parent post.
854
+ * @param state State tree.
855
+ * @param postType The type of the parent post.
856
+ * @param postId The id of the parent post.
857
857
  *
858
858
  * @return An array of autosaves for the post, or undefined if there is none.
859
859
  */
@@ -865,10 +865,10 @@ function getAutosaves(state, postType, postId) {
865
865
  /**
866
866
  * Returns the autosave for the post and author.
867
867
  *
868
- * @param state State tree.
869
- * @param postType The type of the parent post.
870
- * @param postId The id of the parent post.
871
- * @param authorId The id of the author.
868
+ * @param state State tree.
869
+ * @param postType The type of the parent post.
870
+ * @param postId The id of the parent post.
871
+ * @param authorId The id of the author.
872
872
  *
873
873
  * @return The autosave for the post and author.
874
874
  */
@@ -885,9 +885,9 @@ function getAutosave(state, postType, postId, authorId) {
885
885
  /**
886
886
  * Returns true if the REST request for autosaves has completed.
887
887
  *
888
- * @param state State tree.
889
- * @param postType The type of the parent post.
890
- * @param postId The id of the parent post.
888
+ * @param state State tree.
889
+ * @param postType The type of the parent post.
890
+ * @param postId The id of the parent post.
891
891
  *
892
892
  * @return True if the REST request was completed. False otherwise.
893
893
  */
@@ -910,7 +910,7 @@ const hasFetchedAutosaves = (0, _data.createRegistrySelector)(select => (state,
910
910
  * );
911
911
  * ```
912
912
  *
913
- * @param state Editor state.
913
+ * @param state Editor state.
914
914
  *
915
915
  * @return A value whose reference will change only when an edit occurs.
916
916
  */
@@ -921,8 +921,8 @@ state => [], state => [state.undo.length, state.undo.offset, state.undo.flattene
921
921
  /**
922
922
  * Retrieve the frontend template used for a given link.
923
923
  *
924
- * @param state Editor state.
925
- * @param link Link.
924
+ * @param state Editor state.
925
+ * @param link Link.
926
926
  *
927
927
  * @return The template record.
928
928
  */
@@ -943,7 +943,7 @@ function __experimentalGetTemplateForLink(state, link) {
943
943
  /**
944
944
  * Retrieve the current theme's base global styles
945
945
  *
946
- * @param state Editor state.
946
+ * @param state Editor state.
947
947
  *
948
948
  * @return The Global Styles object.
949
949
  */
@@ -961,7 +961,7 @@ function __experimentalGetCurrentThemeBaseGlobalStyles(state) {
961
961
  /**
962
962
  * Return the ID of the current global styles object.
963
963
  *
964
- * @param state Data state.
964
+ * @param state Data state.
965
965
  *
966
966
  * @return The current global styles ID.
967
967
  */
@@ -979,7 +979,7 @@ function __experimentalGetCurrentThemeGlobalStylesVariations(state) {
979
979
  /**
980
980
  * Retrieve the list of registered block patterns.
981
981
  *
982
- * @param state Data state.
982
+ * @param state Data state.
983
983
  *
984
984
  * @return Block pattern list.
985
985
  */
@@ -991,7 +991,7 @@ function getBlockPatterns(state) {
991
991
  /**
992
992
  * Retrieve the list of registered block pattern categories.
993
993
  *
994
- * @param state Data state.
994
+ * @param state Data state.
995
995
  *
996
996
  * @return Block pattern category list.
997
997
  */