@wordpress/core-data 4.13.0 → 5.0.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 (202) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +148 -65
  3. package/build/entities.js +38 -51
  4. package/build/entities.js.map +1 -1
  5. package/build/hooks/index.js +14 -0
  6. package/build/hooks/index.js.map +1 -1
  7. package/build/hooks/use-entity-record.js +10 -6
  8. package/build/hooks/use-entity-record.js.map +1 -1
  9. package/build/hooks/use-entity-records.js +2 -0
  10. package/build/hooks/use-entity-records.js.map +1 -1
  11. package/build/hooks/use-query-select.js +5 -2
  12. package/build/hooks/use-query-select.js.map +1 -1
  13. package/build/hooks/use-resource-permissions.js +74 -11
  14. package/build/hooks/use-resource-permissions.js.map +1 -1
  15. package/build/index.js +1 -30
  16. package/build/index.js.map +1 -1
  17. package/build/resolvers.js +59 -39
  18. package/build/resolvers.js.map +1 -1
  19. package/build/selectors.js +9 -46
  20. package/build/selectors.js.map +1 -1
  21. package/build-module/entities.js +38 -52
  22. package/build-module/entities.js.map +1 -1
  23. package/build-module/hooks/index.js +1 -0
  24. package/build-module/hooks/index.js.map +1 -1
  25. package/build-module/hooks/use-entity-record.js +10 -6
  26. package/build-module/hooks/use-entity-record.js.map +1 -1
  27. package/build-module/hooks/use-entity-records.js +2 -0
  28. package/build-module/hooks/use-entity-records.js.map +1 -1
  29. package/build-module/hooks/use-query-select.js +4 -1
  30. package/build-module/hooks/use-query-select.js.map +1 -1
  31. package/build-module/hooks/use-resource-permissions.js +70 -10
  32. package/build-module/hooks/use-resource-permissions.js.map +1 -1
  33. package/build-module/index.js +0 -5
  34. package/build-module/index.js.map +1 -1
  35. package/build-module/resolvers.js +59 -39
  36. package/build-module/resolvers.js.map +1 -1
  37. package/build-module/selectors.js +7 -44
  38. package/build-module/selectors.js.map +1 -1
  39. package/build-types/actions.d.ts +188 -0
  40. package/build-types/actions.d.ts.map +1 -0
  41. package/build-types/batch/create-batch.d.ts +71 -0
  42. package/build-types/batch/create-batch.d.ts.map +1 -0
  43. package/build-types/batch/default-processor.d.ts +11 -0
  44. package/build-types/batch/default-processor.d.ts.map +1 -0
  45. package/build-types/batch/index.d.ts +3 -0
  46. package/build-types/batch/index.d.ts.map +1 -0
  47. package/build-types/entities.d.ts +128 -0
  48. package/build-types/entities.d.ts.map +1 -0
  49. package/build-types/entity-provider.d.ts +68 -0
  50. package/build-types/entity-provider.d.ts.map +1 -0
  51. package/build-types/entity-types/attachment.d.ts +121 -0
  52. package/build-types/entity-types/attachment.d.ts.map +1 -0
  53. package/build-types/entity-types/base-entity-records.d.ts +37 -0
  54. package/build-types/entity-types/base-entity-records.d.ts.map +1 -0
  55. package/build-types/entity-types/comment.d.ts +82 -0
  56. package/build-types/entity-types/comment.d.ts.map +1 -0
  57. package/build-types/entity-types/helpers.d.ts +123 -0
  58. package/build-types/entity-types/helpers.d.ts.map +1 -0
  59. package/build-types/entity-types/index.d.ts +64 -0
  60. package/build-types/entity-types/index.d.ts.map +1 -0
  61. package/build-types/entity-types/menu-location.d.ts +25 -0
  62. package/build-types/entity-types/menu-location.d.ts.map +1 -0
  63. package/build-types/entity-types/nav-menu-item.d.ts +88 -0
  64. package/build-types/entity-types/nav-menu-item.d.ts.map +1 -0
  65. package/build-types/entity-types/nav-menu.d.ts +45 -0
  66. package/build-types/entity-types/nav-menu.d.ts.map +1 -0
  67. package/build-types/entity-types/page.d.ts +120 -0
  68. package/build-types/entity-types/page.d.ts.map +1 -0
  69. package/build-types/entity-types/plugin.d.ts +62 -0
  70. package/build-types/entity-types/plugin.d.ts.map +1 -0
  71. package/build-types/entity-types/post.d.ts +128 -0
  72. package/build-types/entity-types/post.d.ts.map +1 -0
  73. package/build-types/entity-types/settings.d.ts +89 -0
  74. package/build-types/entity-types/settings.d.ts.map +1 -0
  75. package/build-types/entity-types/sidebar.d.ts +55 -0
  76. package/build-types/entity-types/sidebar.d.ts.map +1 -0
  77. package/build-types/entity-types/taxonomy.d.ts +83 -0
  78. package/build-types/entity-types/taxonomy.d.ts.map +1 -0
  79. package/build-types/entity-types/theme.d.ts +206 -0
  80. package/build-types/entity-types/theme.d.ts.map +1 -0
  81. package/build-types/entity-types/type.d.ts +71 -0
  82. package/build-types/entity-types/type.d.ts.map +1 -0
  83. package/build-types/entity-types/user.d.ts +93 -0
  84. package/build-types/entity-types/user.d.ts.map +1 -0
  85. package/build-types/entity-types/widget-type.d.ts +33 -0
  86. package/build-types/entity-types/widget-type.d.ts.map +1 -0
  87. package/build-types/entity-types/widget.d.ts +59 -0
  88. package/build-types/entity-types/widget.d.ts.map +1 -0
  89. package/build-types/entity-types/wp-template-part.d.ts +80 -0
  90. package/build-types/entity-types/wp-template-part.d.ts.map +1 -0
  91. package/build-types/entity-types/wp-template.d.ts +80 -0
  92. package/build-types/entity-types/wp-template.d.ts.map +1 -0
  93. package/build-types/fetch/__experimental-fetch-link-suggestions.d.ts +139 -0
  94. package/build-types/fetch/__experimental-fetch-link-suggestions.d.ts.map +1 -0
  95. package/build-types/fetch/__experimental-fetch-url-data.d.ts +35 -0
  96. package/build-types/fetch/__experimental-fetch-url-data.d.ts.map +1 -0
  97. package/build-types/fetch/index.d.ts +3 -0
  98. package/build-types/fetch/index.d.ts.map +1 -0
  99. package/build-types/hooks/constants.d.ts +7 -0
  100. package/build-types/hooks/constants.d.ts.map +1 -0
  101. package/build-types/hooks/index.d.ts +4 -0
  102. package/build-types/hooks/index.d.ts.map +1 -0
  103. package/build-types/hooks/memoize.d.ts +3 -0
  104. package/build-types/hooks/memoize.d.ts.map +1 -0
  105. package/build-types/hooks/use-entity-record.d.ts +124 -0
  106. package/build-types/hooks/use-entity-record.d.ts.map +1 -0
  107. package/build-types/hooks/use-entity-records.d.ts +49 -0
  108. package/build-types/hooks/use-entity-records.d.ts.map +1 -0
  109. package/build-types/hooks/use-query-select.d.ts +46 -0
  110. package/build-types/hooks/use-query-select.d.ts.map +1 -0
  111. package/build-types/hooks/use-resource-permissions.d.ts +99 -0
  112. package/build-types/hooks/use-resource-permissions.d.ts.map +1 -0
  113. package/build-types/index.d.ts +131 -0
  114. package/build-types/index.d.ts.map +1 -0
  115. package/build-types/locks/actions.d.ts +7 -0
  116. package/build-types/locks/actions.d.ts.map +1 -0
  117. package/build-types/locks/engine.d.ts +5 -0
  118. package/build-types/locks/engine.d.ts.map +1 -0
  119. package/build-types/locks/reducer.d.ts +10 -0
  120. package/build-types/locks/reducer.d.ts.map +1 -0
  121. package/build-types/locks/selectors.d.ts +5 -0
  122. package/build-types/locks/selectors.d.ts.map +1 -0
  123. package/build-types/locks/utils.d.ts +8 -0
  124. package/build-types/locks/utils.d.ts.map +1 -0
  125. package/build-types/name.d.ts +8 -0
  126. package/build-types/name.d.ts.map +1 -0
  127. package/build-types/queried-data/actions.d.ts +32 -0
  128. package/build-types/queried-data/actions.d.ts.map +1 -0
  129. package/build-types/queried-data/get-query-parts.d.ts +60 -0
  130. package/build-types/queried-data/get-query-parts.d.ts.map +1 -0
  131. package/build-types/queried-data/index.d.ts +4 -0
  132. package/build-types/queried-data/index.d.ts.map +1 -0
  133. package/build-types/queried-data/reducer.d.ts +54 -0
  134. package/build-types/queried-data/reducer.d.ts.map +1 -0
  135. package/build-types/queried-data/selectors.d.ts +16 -0
  136. package/build-types/queried-data/selectors.d.ts.map +1 -0
  137. package/build-types/reducer.d.ts +156 -0
  138. package/build-types/reducer.d.ts.map +1 -0
  139. package/build-types/resolvers.d.ts +75 -0
  140. package/build-types/resolvers.d.ts.map +1 -0
  141. package/build-types/selectors.d.ts +524 -0
  142. package/build-types/selectors.d.ts.map +1 -0
  143. package/build-types/types.d.ts +4 -0
  144. package/build-types/types.d.ts.map +1 -0
  145. package/build-types/utils/conservative-map-item.d.ts +12 -0
  146. package/build-types/utils/conservative-map-item.d.ts.map +1 -0
  147. package/build-types/utils/forward-resolver.d.ts +10 -0
  148. package/build-types/utils/forward-resolver.d.ts.map +1 -0
  149. package/build-types/utils/get-normalized-comma-separable.d.ts +12 -0
  150. package/build-types/utils/get-normalized-comma-separable.d.ts.map +1 -0
  151. package/build-types/utils/if-matching-action.d.ts +14 -0
  152. package/build-types/utils/if-matching-action.d.ts.map +1 -0
  153. package/build-types/utils/index.d.ts +9 -0
  154. package/build-types/utils/index.d.ts.map +1 -0
  155. package/build-types/utils/is-raw-attribute.d.ts +10 -0
  156. package/build-types/utils/is-raw-attribute.d.ts.map +1 -0
  157. package/build-types/utils/on-sub-key.d.ts +4 -0
  158. package/build-types/utils/on-sub-key.d.ts.map +1 -0
  159. package/build-types/utils/replace-action.d.ts +13 -0
  160. package/build-types/utils/replace-action.d.ts.map +1 -0
  161. package/build-types/utils/with-weak-map-cache.d.ts +12 -0
  162. package/build-types/utils/with-weak-map-cache.d.ts.map +1 -0
  163. package/package.json +13 -11
  164. package/src/entities.js +325 -0
  165. package/src/entity-types/attachment.ts +3 -4
  166. package/src/entity-types/comment.ts +3 -4
  167. package/src/entity-types/index.ts +31 -88
  168. package/src/entity-types/menu-location.ts +3 -4
  169. package/src/entity-types/nav-menu-item.ts +3 -4
  170. package/src/entity-types/nav-menu.ts +3 -3
  171. package/src/entity-types/page.ts +3 -3
  172. package/src/entity-types/plugin.ts +3 -3
  173. package/src/entity-types/post.ts +3 -3
  174. package/src/entity-types/settings.ts +3 -3
  175. package/src/entity-types/sidebar.ts +3 -4
  176. package/src/entity-types/taxonomy.ts +3 -4
  177. package/src/entity-types/theme.ts +7 -3
  178. package/src/entity-types/type.ts +3 -3
  179. package/src/entity-types/user.ts +3 -3
  180. package/src/entity-types/widget-type.ts +3 -4
  181. package/src/entity-types/widget.ts +3 -3
  182. package/src/entity-types/wp-template-part.ts +3 -4
  183. package/src/entity-types/wp-template.ts +3 -4
  184. package/src/hooks/index.ts +4 -0
  185. package/src/hooks/test/use-entity-record.js +41 -1
  186. package/src/hooks/test/use-resource-permissions.js +32 -36
  187. package/src/hooks/use-entity-record.ts +18 -6
  188. package/src/hooks/use-entity-records.ts +2 -0
  189. package/src/hooks/use-query-select.ts +4 -1
  190. package/src/hooks/use-resource-permissions.ts +84 -20
  191. package/src/index.js +0 -5
  192. package/src/resolvers.js +80 -45
  193. package/src/selectors.ts +202 -341
  194. package/src/test/resolvers.js +118 -4
  195. package/tsconfig.json +21 -0
  196. package/tsconfig.tsbuildinfo +1 -0
  197. package/build/entity-types/entities.js +0 -6
  198. package/build/entity-types/entities.js.map +0 -1
  199. package/build-module/entity-types/entities.js +0 -2
  200. package/build-module/entity-types/entities.js.map +0 -1
  201. package/src/entities.ts +0 -548
  202. package/src/entity-types/entities.ts +0 -130
@@ -0,0 +1,524 @@
1
+ /// <reference types="rememo" />
2
+ import type * as ET from './entity-types';
3
+ export interface State {
4
+ autosaves: Record<string | number, Array<unknown>>;
5
+ blockPatterns: Array<unknown>;
6
+ blockPatternCategories: Array<unknown>;
7
+ currentGlobalStylesId: string;
8
+ currentTheme: string;
9
+ currentUser: ET.User<'edit'>;
10
+ embedPreviews: Record<string, {
11
+ html: string;
12
+ }>;
13
+ entities: EntitiesState;
14
+ themeBaseGlobalStyles: Record<string, Object>;
15
+ themeGlobalStyleVariations: Record<string, string>;
16
+ undo: UndoState;
17
+ users: UserState;
18
+ }
19
+ declare type EntityRecordKey = string | number;
20
+ interface EntitiesState {
21
+ config: EntityConfig[];
22
+ records: Record<string, Record<string, EntityState<ET.EntityRecord>>>;
23
+ }
24
+ interface EntityState<EntityRecord extends ET.EntityRecord> {
25
+ edits: Record<string, Partial<EntityRecord>>;
26
+ saving: Record<string, {
27
+ pending: boolean;
28
+ }>;
29
+ }
30
+ interface EntityConfig {
31
+ name: string;
32
+ kind: string;
33
+ }
34
+ interface UndoState extends Array<Object> {
35
+ flattenedUndo: unknown;
36
+ offset: number;
37
+ }
38
+ interface UserState {
39
+ queries: Record<string, EntityRecordKey[]>;
40
+ byId: Record<EntityRecordKey, ET.User<'edit'>>;
41
+ }
42
+ declare type Optional<T> = T | undefined;
43
+ /**
44
+ * HTTP Query parameters sent with the API request to fetch the entity records.
45
+ */
46
+ declare type GetRecordsHttpQuery = Record<string, any>;
47
+ /**
48
+ * Returns true if a request is in progress for embed preview data, or false
49
+ * otherwise.
50
+ *
51
+ * @param state Data state.
52
+ * @param url URL the preview would be for.
53
+ *
54
+ * @return Whether a request is in progress for an embed preview.
55
+ */
56
+ export declare const isRequestingEmbedPreview: Function;
57
+ /**
58
+ * Returns all available authors.
59
+ *
60
+ * @deprecated since 11.3. Callers should use `select( 'core' ).getUsers({ who: 'authors' })` instead.
61
+ *
62
+ * @param state Data state.
63
+ * @param query Optional object of query parameters to
64
+ * include with request.
65
+ * @return Authors list.
66
+ */
67
+ export declare function getAuthors(state: State, query?: GetRecordsHttpQuery): ET.User[];
68
+ /**
69
+ * Returns the current user.
70
+ *
71
+ * @param state Data state.
72
+ *
73
+ * @return Current user object.
74
+ */
75
+ export declare function getCurrentUser(state: State): ET.User<'edit'>;
76
+ /**
77
+ * Returns all the users returned by a query ID.
78
+ *
79
+ * @param state Data state.
80
+ * @param queryID Query ID.
81
+ *
82
+ * @return Users list.
83
+ */
84
+ export declare const getUserQueryResults: ((state: State, queryID: string) => ET.User<'edit'>[]) & import("rememo").EnhancedSelector;
85
+ /**
86
+ * Returns the loaded entities for the given kind.
87
+ *
88
+ * @deprecated since WordPress 6.0. Use getEntitiesConfig instead
89
+ * @param state Data state.
90
+ * @param kind Entity kind.
91
+ *
92
+ * @return Array of entities with config matching kind.
93
+ */
94
+ export declare function getEntitiesByKind(state: State, kind: string): Array<any>;
95
+ /**
96
+ * Returns the loaded entities for the given kind.
97
+ *
98
+ * @param state Data state.
99
+ * @param kind Entity kind.
100
+ *
101
+ * @return Array of entities with config matching kind.
102
+ */
103
+ export declare function getEntitiesConfig(state: State, kind: string): Array<any>;
104
+ /**
105
+ * Returns the entity config given its kind and name.
106
+ *
107
+ * @deprecated since WordPress 6.0. Use getEntityConfig instead
108
+ * @param state Data state.
109
+ * @param kind Entity kind.
110
+ * @param name Entity name.
111
+ *
112
+ * @return Entity config
113
+ */
114
+ export declare function getEntity(state: State, kind: string, name: string): any;
115
+ /**
116
+ * Returns the entity config given its kind and name.
117
+ *
118
+ * @param state Data state.
119
+ * @param kind Entity kind.
120
+ * @param name Entity name.
121
+ *
122
+ * @return Entity config
123
+ */
124
+ export declare function getEntityConfig(state: State, kind: string, name: string): any;
125
+ /**
126
+ * Returns the Entity's record object by key. Returns `null` if the value is not
127
+ * yet received, undefined if the value entity is known to not exist, or the
128
+ * entity object if it exists and is received.
129
+ *
130
+ * @param state State tree
131
+ * @param kind Entity kind.
132
+ * @param name Entity name.
133
+ * @param key Record's key
134
+ * @param query Optional query. If requesting specific
135
+ * fields, fields must always include the ID.
136
+ *
137
+ * @return Record.
138
+ */
139
+ export declare const getEntityRecord: (<EntityRecord extends ET.Attachment<any> | ET.Comment<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any> | Partial<ET.Attachment<any> | ET.Comment<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any>>>(state: State, kind: string, name: string, key: EntityRecordKey, query?: GetRecordsHttpQuery | undefined) => EntityRecord | undefined) & import("rememo").EnhancedSelector;
140
+ /**
141
+ * 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.
142
+ *
143
+ * @param state State tree
144
+ * @param kind Entity kind.
145
+ * @param name Entity name.
146
+ * @param key Record's key
147
+ *
148
+ * @return Record.
149
+ */
150
+ export declare function __experimentalGetEntityRecordNoResolver<EntityRecord extends ET.EntityRecord<any>>(state: State, kind: string, name: string, key: EntityRecordKey): EntityRecord | undefined;
151
+ /**
152
+ * Returns the entity's record object by key,
153
+ * with its attributes mapped to their raw values.
154
+ *
155
+ * @param state State tree.
156
+ * @param kind Entity kind.
157
+ * @param name Entity name.
158
+ * @param key Record's key.
159
+ *
160
+ * @return Object with the entity's raw attributes.
161
+ */
162
+ export declare const getRawEntityRecord: (<EntityRecord extends ET.Attachment<any> | ET.Comment<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any>>(state: State, kind: string, name: string, key: EntityRecordKey) => EntityRecord | undefined) & import("rememo").EnhancedSelector;
163
+ /**
164
+ * Returns true if records have been received for the given set of parameters,
165
+ * or false otherwise.
166
+ *
167
+ * @param state State tree
168
+ * @param kind Entity kind.
169
+ * @param name Entity name.
170
+ * @param query Optional terms query.
171
+ *
172
+ * @return Whether entity records have been received.
173
+ */
174
+ export declare function hasEntityRecords(state: State, kind: string, name: string, query?: GetRecordsHttpQuery): boolean;
175
+ /**
176
+ * Returns the Entity's records.
177
+ *
178
+ * @param state State tree
179
+ * @param kind Entity kind.
180
+ * @param name Entity name.
181
+ * @param query Optional terms query. If requesting specific
182
+ * fields, fields must always include the ID.
183
+ *
184
+ * @return Records.
185
+ */
186
+ export declare const getEntityRecords: <EntityRecord extends ET.Attachment<any> | ET.Comment<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any> | Partial<ET.Attachment<any> | ET.Comment<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any>>>(state: State, kind: string, name: string, query?: GetRecordsHttpQuery | undefined) => EntityRecord[] | null;
187
+ declare type DirtyEntityRecord = {
188
+ title: string;
189
+ key: EntityRecordKey;
190
+ name: string;
191
+ kind: string;
192
+ };
193
+ /**
194
+ * Returns the list of dirty entity records.
195
+ *
196
+ * @param state State tree.
197
+ *
198
+ * @return The list of updated records
199
+ */
200
+ export declare const __experimentalGetDirtyEntityRecords: ((state: State) => Array<DirtyEntityRecord>) & import("rememo").EnhancedSelector;
201
+ /**
202
+ * Returns the list of entities currently being saved.
203
+ *
204
+ * @param state State tree.
205
+ *
206
+ * @return The list of records being saved.
207
+ */
208
+ export declare const __experimentalGetEntitiesBeingSaved: ((state: State) => Array<DirtyEntityRecord>) & import("rememo").EnhancedSelector;
209
+ /**
210
+ * Returns the specified entity record's edits.
211
+ *
212
+ * @param state State tree.
213
+ * @param kind Entity kind.
214
+ * @param name Entity name.
215
+ * @param recordId Record ID.
216
+ *
217
+ * @return The entity record's edits.
218
+ */
219
+ export declare function getEntityRecordEdits(state: State, kind: string, name: string, recordId: EntityRecordKey): Optional<any>;
220
+ /**
221
+ * Returns the specified entity record's non transient edits.
222
+ *
223
+ * Transient edits don't create an undo level, and
224
+ * are not considered for change detection.
225
+ * They are defined in the entity's config.
226
+ *
227
+ * @param state State tree.
228
+ * @param kind Entity kind.
229
+ * @param name Entity name.
230
+ * @param recordId Record ID.
231
+ *
232
+ * @return The entity record's non transient edits.
233
+ */
234
+ export declare const getEntityRecordNonTransientEdits: ((state: State, kind: string, name: string, recordId: EntityRecordKey) => Optional<any>) & import("rememo").EnhancedSelector;
235
+ /**
236
+ * Returns true if the specified entity record has edits,
237
+ * and false otherwise.
238
+ *
239
+ * @param state State tree.
240
+ * @param kind Entity kind.
241
+ * @param name Entity name.
242
+ * @param recordId Record ID.
243
+ *
244
+ * @return Whether the entity record has edits or not.
245
+ */
246
+ export declare function hasEditsForEntityRecord(state: State, kind: string, name: string, recordId: EntityRecordKey): boolean;
247
+ /**
248
+ * Returns the specified entity record, merged with its edits.
249
+ *
250
+ * @param state State tree.
251
+ * @param kind Entity kind.
252
+ * @param name Entity name.
253
+ * @param recordId Record ID.
254
+ *
255
+ * @return The entity record, merged with its edits.
256
+ */
257
+ export declare const getEditedEntityRecord: (<EntityRecord extends ET.Attachment<any> | ET.Comment<any> | ET.MenuLocation<any> | ET.NavMenu<any> | ET.NavMenuItem<any> | ET.Page<any> | ET.Plugin<any> | ET.Post<any> | ET.Settings<any> | ET.Sidebar<any> | ET.Taxonomy<any> | ET.Theme<any> | ET.User<any> | ET.Type<any> | ET.Widget<any> | ET.WidgetType<any> | ET.WpTemplate<any> | ET.WpTemplatePart<any>>(state: State, kind: string, name: string, recordId: EntityRecordKey) => ET.Updatable<EntityRecord> | undefined) & import("rememo").EnhancedSelector;
258
+ /**
259
+ * Returns true if the specified entity record is autosaving, and false otherwise.
260
+ *
261
+ * @param state State tree.
262
+ * @param kind Entity kind.
263
+ * @param name Entity name.
264
+ * @param recordId Record ID.
265
+ *
266
+ * @return Whether the entity record is autosaving or not.
267
+ */
268
+ export declare function isAutosavingEntityRecord(state: State, kind: string, name: string, recordId: EntityRecordKey): boolean;
269
+ /**
270
+ * Returns true if the specified entity record is saving, and false otherwise.
271
+ *
272
+ * @param state State tree.
273
+ * @param kind Entity kind.
274
+ * @param name Entity name.
275
+ * @param recordId Record ID.
276
+ *
277
+ * @return Whether the entity record is saving or not.
278
+ */
279
+ export declare function isSavingEntityRecord(state: State, kind: string, name: string, recordId: EntityRecordKey): boolean;
280
+ /**
281
+ * Returns true if the specified entity record is deleting, and false otherwise.
282
+ *
283
+ * @param state State tree.
284
+ * @param kind Entity kind.
285
+ * @param name Entity name.
286
+ * @param recordId Record ID.
287
+ *
288
+ * @return Whether the entity record is deleting or not.
289
+ */
290
+ export declare function isDeletingEntityRecord(state: State, kind: string, name: string, recordId: EntityRecordKey): boolean;
291
+ /**
292
+ * Returns the specified entity record's last save error.
293
+ *
294
+ * @param state State tree.
295
+ * @param kind Entity kind.
296
+ * @param name Entity name.
297
+ * @param recordId Record ID.
298
+ *
299
+ * @return The entity record's save error.
300
+ */
301
+ export declare function getLastEntitySaveError(state: State, kind: string, name: string, recordId: EntityRecordKey): any;
302
+ /**
303
+ * Returns the specified entity record's last delete error.
304
+ *
305
+ * @param state State tree.
306
+ * @param kind Entity kind.
307
+ * @param name Entity name.
308
+ * @param recordId Record ID.
309
+ *
310
+ * @return The entity record's save error.
311
+ */
312
+ export declare function getLastEntityDeleteError(state: State, kind: string, name: string, recordId: EntityRecordKey): any;
313
+ /**
314
+ * Returns the previous edit from the current undo offset
315
+ * for the entity records edits history, if any.
316
+ *
317
+ * @param state State tree.
318
+ *
319
+ * @return The edit.
320
+ */
321
+ export declare function getUndoEdit(state: State): Optional<any>;
322
+ /**
323
+ * Returns the next edit from the current undo offset
324
+ * for the entity records edits history, if any.
325
+ *
326
+ * @param state State tree.
327
+ *
328
+ * @return The edit.
329
+ */
330
+ export declare function getRedoEdit(state: State): Optional<any>;
331
+ /**
332
+ * Returns true if there is a previous edit from the current undo offset
333
+ * for the entity records edits history, and false otherwise.
334
+ *
335
+ * @param state State tree.
336
+ *
337
+ * @return Whether there is a previous edit or not.
338
+ */
339
+ export declare function hasUndo(state: State): boolean;
340
+ /**
341
+ * Returns true if there is a next edit from the current undo offset
342
+ * for the entity records edits history, and false otherwise.
343
+ *
344
+ * @param state State tree.
345
+ *
346
+ * @return Whether there is a next edit or not.
347
+ */
348
+ export declare function hasRedo(state: State): boolean;
349
+ /**
350
+ * Return the current theme.
351
+ *
352
+ * @param state Data state.
353
+ *
354
+ * @return The current theme.
355
+ */
356
+ export declare function getCurrentTheme(state: State): any;
357
+ /**
358
+ * Return the ID of the current global styles object.
359
+ *
360
+ * @param state Data state.
361
+ *
362
+ * @return The current global styles ID.
363
+ */
364
+ export declare function __experimentalGetCurrentGlobalStylesId(state: State): string;
365
+ /**
366
+ * Return theme supports data in the index.
367
+ *
368
+ * @param state Data state.
369
+ *
370
+ * @return Index data.
371
+ */
372
+ export declare function getThemeSupports(state: State): any;
373
+ /**
374
+ * Returns the embed preview for the given URL.
375
+ *
376
+ * @param state Data state.
377
+ * @param url Embedded URL.
378
+ *
379
+ * @return Undefined if the preview has not been fetched, otherwise, the preview fetched from the embed preview API.
380
+ */
381
+ export declare function getEmbedPreview(state: State, url: string): any;
382
+ /**
383
+ * Determines if the returned preview is an oEmbed link fallback.
384
+ *
385
+ * WordPress can be configured to return a simple link to a URL if it is not embeddable.
386
+ * We need to be able to determine if a URL is embeddable or not, based on what we
387
+ * get back from the oEmbed preview API.
388
+ *
389
+ * @param state Data state.
390
+ * @param url Embedded URL.
391
+ *
392
+ * @return Is the preview for the URL an oEmbed link fallback.
393
+ */
394
+ export declare function isPreviewEmbedFallback(state: State, url: string): boolean;
395
+ /**
396
+ * Returns whether the current user can perform the given action on the given
397
+ * REST resource.
398
+ *
399
+ * Calling this may trigger an OPTIONS request to the REST API via the
400
+ * `canUser()` resolver.
401
+ *
402
+ * https://developer.wordpress.org/rest-api/reference/
403
+ *
404
+ * @param state Data state.
405
+ * @param action Action to check. One of: 'create', 'read', 'update', 'delete'.
406
+ * @param resource REST resource to check, e.g. 'media' or 'posts'.
407
+ * @param id Optional ID of the rest resource to check.
408
+ *
409
+ * @return Whether or not the user can perform the action,
410
+ * or `undefined` if the OPTIONS request is still being made.
411
+ */
412
+ export declare function canUser(state: State, action: string, resource: string, id?: EntityRecordKey): boolean | undefined;
413
+ /**
414
+ * Returns whether the current user can edit the given entity.
415
+ *
416
+ * Calling this may trigger an OPTIONS request to the REST API via the
417
+ * `canUser()` resolver.
418
+ *
419
+ * https://developer.wordpress.org/rest-api/reference/
420
+ *
421
+ * @param state Data state.
422
+ * @param kind Entity kind.
423
+ * @param name Entity name.
424
+ * @param recordId Record's id.
425
+ * @return Whether or not the user can edit,
426
+ * or `undefined` if the OPTIONS request is still being made.
427
+ */
428
+ export declare function canUserEditEntityRecord(state: State, kind: string, name: string, recordId: EntityRecordKey): boolean | undefined;
429
+ /**
430
+ * Returns the latest autosaves for the post.
431
+ *
432
+ * May return multiple autosaves since the backend stores one autosave per
433
+ * author for each post.
434
+ *
435
+ * @param state State tree.
436
+ * @param postType The type of the parent post.
437
+ * @param postId The id of the parent post.
438
+ *
439
+ * @return An array of autosaves for the post, or undefined if there is none.
440
+ */
441
+ export declare function getAutosaves(state: State, postType: string, postId: EntityRecordKey): Array<any> | undefined;
442
+ /**
443
+ * Returns the autosave for the post and author.
444
+ *
445
+ * @param state State tree.
446
+ * @param postType The type of the parent post.
447
+ * @param postId The id of the parent post.
448
+ * @param authorId The id of the author.
449
+ *
450
+ * @return The autosave for the post and author.
451
+ */
452
+ export declare function getAutosave<EntityRecord extends ET.EntityRecord<any>>(state: State, postType: string, postId: EntityRecordKey, authorId: EntityRecordKey): EntityRecord | undefined;
453
+ /**
454
+ * Returns true if the REST request for autosaves has completed.
455
+ *
456
+ * @param state State tree.
457
+ * @param postType The type of the parent post.
458
+ * @param postId The id of the parent post.
459
+ *
460
+ * @return True if the REST request was completed. False otherwise.
461
+ */
462
+ export declare const hasFetchedAutosaves: Function;
463
+ /**
464
+ * Returns a new reference when edited values have changed. This is useful in
465
+ * inferring where an edit has been made between states by comparison of the
466
+ * return values using strict equality.
467
+ *
468
+ * @example
469
+ *
470
+ * ```
471
+ * const hasEditOccurred = (
472
+ * getReferenceByDistinctEdits( beforeState ) !==
473
+ * getReferenceByDistinctEdits( afterState )
474
+ * );
475
+ * ```
476
+ *
477
+ * @param state Editor state.
478
+ *
479
+ * @return A value whose reference will change only when an edit occurs.
480
+ */
481
+ export declare const getReferenceByDistinctEdits: ((state: State) => never[]) & import("rememo").EnhancedSelector;
482
+ /**
483
+ * Retrieve the frontend template used for a given link.
484
+ *
485
+ * @param state Editor state.
486
+ * @param link Link.
487
+ *
488
+ * @return The template record.
489
+ */
490
+ export declare function __experimentalGetTemplateForLink(state: State, link: string): Optional<ET.Updatable<ET.WpTemplate>> | null;
491
+ /**
492
+ * Retrieve the current theme's base global styles
493
+ *
494
+ * @param state Editor state.
495
+ *
496
+ * @return The Global Styles object.
497
+ */
498
+ export declare function __experimentalGetCurrentThemeBaseGlobalStyles(state: State): any;
499
+ /**
500
+ * Return the ID of the current global styles object.
501
+ *
502
+ * @param state Data state.
503
+ *
504
+ * @return The current global styles ID.
505
+ */
506
+ export declare function __experimentalGetCurrentThemeGlobalStylesVariations(state: State): string | null;
507
+ /**
508
+ * Retrieve the list of registered block patterns.
509
+ *
510
+ * @param state Data state.
511
+ *
512
+ * @return Block pattern list.
513
+ */
514
+ export declare function getBlockPatterns(state: State): Array<any>;
515
+ /**
516
+ * Retrieve the list of registered block pattern categories.
517
+ *
518
+ * @param state Data state.
519
+ *
520
+ * @return Block pattern category list.
521
+ */
522
+ export declare function getBlockPatternCategories(state: State): Array<any>;
523
+ export {};
524
+ //# sourceMappingURL=selectors.d.ts.map
@@ -0,0 +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,CA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AAE,EACvE,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,eAAe,GACvB,YAAY,GAAG,SAAS,CAO1B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,UAY/B,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,2BAA2B,WAE9B,KAAK,iDAMd,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAC/C,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,MAAM,GACV,QAAQ,CAAE,EAAE,CAAC,SAAS,CAAE,EAAE,CAAC,UAAU,CAAE,CAAE,GAAG,IAAI,CAmBlD;AAED;;;;;;GAMG;AACH,wBAAgB,6CAA6C,CAC5D,KAAK,EAAE,KAAK,GACV,GAAG,CAML;AAED;;;;;;GAMG;AACH,wBAAgB,mDAAmD,CAClE,KAAK,EAAE,KAAK,GACV,MAAM,GAAG,IAAI,CAMf;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,KAAK,GAAI,KAAK,CAAE,GAAG,CAAE,CAE7D;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAE,KAAK,EAAE,KAAK,GAAI,KAAK,CAAE,GAAG,CAAE,CAEtE"}
@@ -0,0 +1,4 @@
1
+ export interface AnyFunction {
2
+ (...args: any[]): any;
3
+ }
4
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC3B,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAI,GAAG,CAAC;CACxB"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Given the current and next item entity record, returns the minimally "modified"
3
+ * result of the next item, preferring value references from the original item
4
+ * if equal. If all values match, the original item is returned.
5
+ *
6
+ * @param {Object} item Original item.
7
+ * @param {Object} nextItem Next item.
8
+ *
9
+ * @return {Object} Minimally modified merged item.
10
+ */
11
+ export default function conservativeMapItem(item: any, nextItem: any): any;
12
+ //# sourceMappingURL=conservative-map-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conservative-map-item.d.ts","sourceRoot":"","sources":["../../src/utils/conservative-map-item.js"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,2EA+BC"}
@@ -0,0 +1,10 @@
1
+ export default forwardResolver;
2
+ /**
3
+ * Higher-order function which forward the resolution to another resolver with the same arguments.
4
+ *
5
+ * @param {string} resolverName forwarded resolver.
6
+ *
7
+ * @return {Function} Enhanced resolver.
8
+ */
9
+ declare function forwardResolver(resolverName: string): Function;
10
+ //# sourceMappingURL=forward-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forward-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/forward-resolver.js"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,+CAJW,MAAM,YASf"}
@@ -0,0 +1,12 @@
1
+ export default getNormalizedCommaSeparable;
2
+ /**
3
+ * Given a value which can be specified as one or the other of a comma-separated
4
+ * string or an array, returns a value normalized to an array of strings, or
5
+ * null if the value cannot be interpreted as either.
6
+ *
7
+ * @param {string|string[]|*} value
8
+ *
9
+ * @return {?(string[])} Normalized field value.
10
+ */
11
+ declare function getNormalizedCommaSeparable(value: string | string[] | any): (string[]) | null;
12
+ //# sourceMappingURL=get-normalized-comma-separable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-normalized-comma-separable.d.ts","sourceRoot":"","sources":["../../src/utils/get-normalized-comma-separable.js"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;AACH,oDAJW,MAAM,GAAC,MAAM,EAAE,MAAE,GAEf,CAAC,MAAM,EAAE,CAAC,QAUtB"}
@@ -0,0 +1,14 @@
1
+ export default ifMatchingAction;
2
+ export type AnyFunction = import('../types').AnyFunction;
3
+ /** @typedef {import('../types').AnyFunction} AnyFunction */
4
+ /**
5
+ * A higher-order reducer creator which invokes the original reducer only if
6
+ * the dispatching action matches the given predicate, **OR** if state is
7
+ * initializing (undefined).
8
+ *
9
+ * @param {AnyFunction} isMatch Function predicate for allowing reducer call.
10
+ *
11
+ * @return {AnyFunction} Higher-order reducer.
12
+ */
13
+ declare function ifMatchingAction(isMatch: AnyFunction): AnyFunction;
14
+ //# sourceMappingURL=if-matching-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"if-matching-action.d.ts","sourceRoot":"","sources":["../../src/utils/if-matching-action.js"],"names":[],"mappings":";0BAAc,OAAO,UAAU,EAAE,WAAW;AAA5C,4DAA4D;AAE5D;;;;;;;;GAQG;AACH,2CAJW,WAAW,GAEV,WAAW,CAQtB"}
@@ -0,0 +1,9 @@
1
+ export { default as conservativeMapItem } from "./conservative-map-item";
2
+ export { default as getNormalizedCommaSeparable } from "./get-normalized-comma-separable";
3
+ export { default as ifMatchingAction } from "./if-matching-action";
4
+ export { default as forwardResolver } from "./forward-resolver";
5
+ export { default as onSubKey } from "./on-sub-key";
6
+ export { default as replaceAction } from "./replace-action";
7
+ export { default as withWeakMapCache } from "./with-weak-map-cache";
8
+ export { default as isRawAttribute } from "./is-raw-attribute";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.js"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Checks whether the attribute is a "raw" attribute or not.
3
+ *
4
+ * @param {Object} entity Entity record.
5
+ * @param {string} attribute Attribute name.
6
+ *
7
+ * @return {boolean} Is the attribute raw
8
+ */
9
+ export default function isRawAttribute(entity: any, attribute: string): boolean;
10
+ //# sourceMappingURL=is-raw-attribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-raw-attribute.d.ts","sourceRoot":"","sources":["../../src/utils/is-raw-attribute.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,+DAJW,MAAM,GAEL,OAAO,CAIlB"}
@@ -0,0 +1,4 @@
1
+ export function onSubKey(actionProperty: string): AnyFunction;
2
+ export default onSubKey;
3
+ export type AnyFunction = import('../types').AnyFunction;
4
+ //# sourceMappingURL=on-sub-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"on-sub-key.d.ts","sourceRoot":"","sources":["../../src/utils/on-sub-key.js"],"names":[],"mappings":"AAUO,yCAJI,MAAM,GAEL,WAAW,CAwBrB;;0BAhCY,OAAO,UAAU,EAAE,WAAW"}
@@ -0,0 +1,13 @@
1
+ export default replaceAction;
2
+ export type AnyFunction = import('../types').AnyFunction;
3
+ /** @typedef {import('../types').AnyFunction} AnyFunction */
4
+ /**
5
+ * Higher-order reducer creator which substitutes the action object before
6
+ * passing to the original reducer.
7
+ *
8
+ * @param {AnyFunction} replacer Function mapping original action to replacement.
9
+ *
10
+ * @return {AnyFunction} Higher-order reducer.
11
+ */
12
+ declare function replaceAction(replacer: AnyFunction): AnyFunction;
13
+ //# sourceMappingURL=replace-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replace-action.d.ts","sourceRoot":"","sources":["../../src/utils/replace-action.js"],"names":[],"mappings":";0BAAc,OAAO,UAAU,EAAE,WAAW;AAA5C,4DAA4D;AAE5D;;;;;;;GAOG;AACH,yCAJW,WAAW,GAEV,WAAW,CAItB"}