@plaudit/gutenberg-api-extensions 2.80.1 → 2.81.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import {useSelect} from "@wordpress/data";
1
+ import {useSelect, type MapSelect} from "@wordpress/data";
2
2
  import {useMemo} from "@wordpress/element";
3
3
  import {applyFilters} from "@wordpress/hooks";
4
4
 
@@ -26,7 +26,7 @@ export function useSuspendableOptions<T extends CSNPConfig&{options: PromisableP
26
26
 
27
27
  // This if/else statement is present because actually passing attributes through to the selectors represents a SEVERE relative performance hit.
28
28
  // At a minimum, it causes at leat one additional full execution pass, and, due to how data can be cached, that pass is almost guaranteed to turn into at least one full render.
29
- let mapSelect: (...args: Parameters<ExcavateMapSelect<Parameters<typeof useSelect>[0]>>) => [Record<string, any>|null, string|null];
29
+ let mapSelect: (...args: Parameters<MapSelect>) => [Record<string, any>|null, string|null];
30
30
  if (usesBlockAttributes) {
31
31
  mapSelect = wrappedSelect => {
32
32
  const selected = wrappedSelect(blockEditorStore);
@@ -31,7 +31,8 @@ export namespace installSimpleGutenbergApisSupport {
31
31
 
32
32
  type Selectors = {
33
33
  get(name: string, args?: ApiCallArgs): unknown,
34
- resolve(name: string, args?: ApiCallArgs): Promise<unknown>
34
+ resolve(name: string, args?: ApiCallArgs): Promise<unknown>,
35
+ registeredEndpoints(): string[]
35
36
  };
36
37
  type Actions = {
37
38
  registerEndpoint(
@@ -94,6 +95,9 @@ export const store: ReturnType<typeof createReduxStore<{}, Actions, AddBSStateAr
94
95
  },
95
96
  resolve(name, args?) {
96
97
  return handleCacheMiss(name, args);
98
+ },
99
+ registeredEndpoints(): string[] {
100
+ return Object.keys(endpoints);
97
101
  }
98
102
  };
99
103
  const suspendSelectors: Selectors = {
@@ -102,6 +106,9 @@ export const store: ReturnType<typeof createReduxStore<{}, Actions, AddBSStateAr
102
106
  },
103
107
  resolve(name, args?) {
104
108
  return useToPromise(handleCacheMiss(name, args));
109
+ },
110
+ registeredEndpoints(): string[] {
111
+ return Object.keys(endpoints);
105
112
  }
106
113
  };
107
114
 
@@ -0,0 +1 @@
1
+ See `Deploy Schema` section of ../README.md