@wordpress/data 10.41.0 → 10.41.1-next.v.202603161435.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/README.md +20 -28
- package/build/components/async-mode-provider/context.cjs +1 -1
- package/build/components/async-mode-provider/context.cjs.map +3 -3
- package/build/components/async-mode-provider/index.cjs +1 -1
- package/build/components/async-mode-provider/index.cjs.map +1 -1
- package/build/components/async-mode-provider/use-async-mode.cjs +1 -1
- package/build/components/async-mode-provider/use-async-mode.cjs.map +3 -3
- package/build/components/registry-provider/context.cjs +1 -1
- package/build/components/registry-provider/context.cjs.map +1 -1
- package/build/components/registry-provider/index.cjs +1 -1
- package/build/components/registry-provider/index.cjs.map +1 -1
- package/build/components/registry-provider/use-registry.cjs +1 -1
- package/build/components/registry-provider/use-registry.cjs.map +3 -3
- package/build/components/use-dispatch/index.cjs +1 -1
- package/build/components/use-dispatch/index.cjs.map +1 -1
- package/build/components/use-dispatch/use-dispatch-with-map.cjs +1 -1
- package/build/components/use-dispatch/use-dispatch-with-map.cjs.map +3 -3
- package/build/components/use-dispatch/use-dispatch.cjs +1 -1
- package/build/components/use-dispatch/use-dispatch.cjs.map +3 -3
- package/build/components/use-select/index.cjs +2 -2
- package/build/components/use-select/index.cjs.map +3 -3
- package/build/components/with-dispatch/index.cjs +1 -1
- package/build/components/with-dispatch/index.cjs.map +3 -3
- package/build/components/with-registry/index.cjs +1 -1
- package/build/components/with-registry/index.cjs.map +3 -3
- package/build/components/with-select/index.cjs +1 -1
- package/build/components/with-select/index.cjs.map +3 -3
- package/build/controls.cjs +7 -6
- package/build/controls.cjs.map +3 -3
- package/build/default-registry.cjs +3 -2
- package/build/default-registry.cjs.map +3 -3
- package/build/dispatch.cjs +3 -1
- package/build/dispatch.cjs.map +2 -2
- package/build/factory.cjs.map +2 -2
- package/build/index.cjs +9 -8
- package/build/index.cjs.map +3 -3
- package/build/plugins/index.cjs +1 -1
- package/build/plugins/index.cjs.map +1 -1
- package/build/plugins/persistence/index.cjs +13 -8
- package/build/plugins/persistence/index.cjs.map +3 -3
- package/build/plugins/persistence/storage/default.cjs +1 -1
- package/build/plugins/persistence/storage/default.cjs.map +3 -3
- package/build/plugins/persistence/storage/object.cjs +1 -1
- package/build/plugins/persistence/storage/object.cjs.map +3 -3
- package/build/promise-middleware.cjs +2 -1
- package/build/promise-middleware.cjs.map +3 -3
- package/build/redux-store/index.cjs +32 -16
- package/build/redux-store/index.cjs.map +3 -3
- package/build/redux-store/metadata/selectors.cjs +1 -1
- package/build/redux-store/metadata/selectors.cjs.map +3 -3
- package/build/redux-store/metadata/types.cjs +19 -0
- package/build/redux-store/metadata/types.cjs.map +7 -0
- package/build/registry.cjs +11 -7
- package/build/registry.cjs.map +3 -3
- package/build/resolvers-cache-middleware.cjs +6 -3
- package/build/resolvers-cache-middleware.cjs.map +3 -3
- package/build/select.cjs +3 -1
- package/build/select.cjs.map +2 -2
- package/build/store/index.cjs +1 -1
- package/build/store/index.cjs.map +3 -3
- package/build/types.cjs.map +1 -1
- package/build-module/components/async-mode-provider/context.mjs +1 -1
- package/build-module/components/async-mode-provider/context.mjs.map +3 -3
- package/build-module/components/async-mode-provider/index.mjs +1 -1
- package/build-module/components/async-mode-provider/index.mjs.map +1 -1
- package/build-module/components/async-mode-provider/use-async-mode.mjs +1 -1
- package/build-module/components/async-mode-provider/use-async-mode.mjs.map +3 -3
- package/build-module/components/registry-provider/context.mjs +1 -1
- package/build-module/components/registry-provider/context.mjs.map +1 -1
- package/build-module/components/registry-provider/index.mjs +1 -1
- package/build-module/components/registry-provider/index.mjs.map +1 -1
- package/build-module/components/registry-provider/use-registry.mjs +1 -1
- package/build-module/components/registry-provider/use-registry.mjs.map +3 -3
- package/build-module/components/use-dispatch/index.mjs +1 -1
- package/build-module/components/use-dispatch/index.mjs.map +1 -1
- package/build-module/components/use-dispatch/use-dispatch-with-map.mjs +1 -1
- package/build-module/components/use-dispatch/use-dispatch-with-map.mjs.map +3 -3
- package/build-module/components/use-dispatch/use-dispatch.mjs +1 -1
- package/build-module/components/use-dispatch/use-dispatch.mjs.map +3 -3
- package/build-module/components/use-select/index.mjs +2 -2
- package/build-module/components/use-select/index.mjs.map +3 -3
- package/build-module/components/with-dispatch/index.mjs +1 -1
- package/build-module/components/with-dispatch/index.mjs.map +3 -3
- package/build-module/components/with-registry/index.mjs +1 -1
- package/build-module/components/with-registry/index.mjs.map +3 -3
- package/build-module/components/with-select/index.mjs +1 -1
- package/build-module/components/with-select/index.mjs.map +3 -3
- package/build-module/controls.mjs +7 -6
- package/build-module/controls.mjs.map +3 -3
- package/build-module/default-registry.mjs +3 -2
- package/build-module/default-registry.mjs.map +3 -3
- package/build-module/dispatch.mjs +3 -1
- package/build-module/dispatch.mjs.map +2 -2
- package/build-module/factory.mjs.map +2 -2
- package/build-module/index.mjs +4 -3
- package/build-module/index.mjs.map +2 -2
- package/build-module/plugins/index.mjs +1 -1
- package/build-module/plugins/index.mjs.map +1 -1
- package/build-module/plugins/persistence/index.mjs +13 -8
- package/build-module/plugins/persistence/index.mjs.map +3 -3
- package/build-module/plugins/persistence/storage/default.mjs +1 -1
- package/build-module/plugins/persistence/storage/default.mjs.map +3 -3
- package/build-module/plugins/persistence/storage/object.mjs +1 -1
- package/build-module/plugins/persistence/storage/object.mjs.map +3 -3
- package/build-module/promise-middleware.mjs +2 -1
- package/build-module/promise-middleware.mjs.map +3 -3
- package/build-module/redux-store/index.mjs +32 -16
- package/build-module/redux-store/index.mjs.map +3 -3
- package/build-module/redux-store/metadata/selectors.mjs +1 -1
- package/build-module/redux-store/metadata/selectors.mjs.map +3 -3
- package/build-module/redux-store/metadata/types.mjs +1 -0
- package/build-module/redux-store/metadata/types.mjs.map +7 -0
- package/build-module/registry.mjs +11 -7
- package/build-module/registry.mjs.map +3 -3
- package/build-module/resolvers-cache-middleware.mjs +6 -3
- package/build-module/resolvers-cache-middleware.mjs.map +3 -3
- package/build-module/select.mjs +3 -1
- package/build-module/select.mjs.map +2 -2
- package/build-module/store/index.mjs +1 -1
- package/build-module/store/index.mjs.map +3 -3
- package/build-types/components/async-mode-provider/context.d.ts +37 -3
- package/build-types/components/async-mode-provider/context.d.ts.map +1 -1
- package/build-types/components/async-mode-provider/index.d.ts +2 -2
- package/build-types/components/async-mode-provider/index.d.ts.map +1 -1
- package/build-types/components/async-mode-provider/use-async-mode.d.ts.map +1 -1
- package/build-types/components/registry-provider/context.d.ts +10 -3
- package/build-types/components/registry-provider/context.d.ts.map +1 -1
- package/build-types/components/registry-provider/index.d.ts +2 -2
- package/build-types/components/registry-provider/index.d.ts.map +1 -1
- package/build-types/components/registry-provider/use-registry.d.ts +3 -2
- package/build-types/components/registry-provider/use-registry.d.ts.map +1 -1
- package/build-types/components/use-dispatch/index.d.ts +2 -2
- package/build-types/components/use-dispatch/index.d.ts.map +1 -1
- package/build-types/components/use-dispatch/use-dispatch-with-map.d.ts +11 -9
- package/build-types/components/use-dispatch/use-dispatch-with-map.d.ts.map +1 -1
- package/build-types/components/use-dispatch/use-dispatch.d.ts +10 -19
- package/build-types/components/use-dispatch/use-dispatch.d.ts.map +1 -1
- package/build-types/components/use-select/index.d.ts +24 -28
- package/build-types/components/use-select/index.d.ts.map +1 -1
- package/build-types/components/with-dispatch/index.d.ts +10 -11
- package/build-types/components/with-dispatch/index.d.ts.map +1 -1
- package/build-types/components/with-registry/index.d.ts +2 -6
- package/build-types/components/with-registry/index.d.ts.map +1 -1
- package/build-types/components/with-select/index.d.ts +7 -8
- package/build-types/components/with-select/index.d.ts.map +1 -1
- package/build-types/controls.d.ts +57 -44
- package/build-types/controls.d.ts.map +1 -1
- package/build-types/default-registry.d.ts +2 -2
- package/build-types/default-registry.d.ts.map +1 -1
- package/build-types/dispatch.d.ts +4 -0
- package/build-types/dispatch.d.ts.map +1 -1
- package/build-types/factory.d.ts +2 -1
- package/build-types/factory.d.ts.map +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/plugins/index.d.ts +1 -1
- package/build-types/plugins/index.d.ts.map +1 -1
- package/build-types/plugins/persistence/index.d.ts +38 -27
- package/build-types/plugins/persistence/index.d.ts.map +1 -1
- package/build-types/plugins/persistence/storage/default.d.ts +7 -1
- package/build-types/plugins/persistence/storage/default.d.ts.map +1 -1
- package/build-types/plugins/persistence/storage/object.d.ts +4 -5
- package/build-types/plugins/persistence/storage/object.d.ts.map +1 -1
- package/build-types/promise-middleware.d.ts +6 -4
- package/build-types/promise-middleware.d.ts.map +1 -1
- package/build-types/redux-store/index.d.ts +12 -15
- package/build-types/redux-store/index.d.ts.map +1 -1
- package/build-types/redux-store/metadata/selectors.d.ts +45 -50
- package/build-types/redux-store/metadata/selectors.d.ts.map +1 -1
- package/build-types/redux-store/metadata/types.d.ts +48 -0
- package/build-types/redux-store/metadata/types.d.ts.map +1 -0
- package/build-types/registry.d.ts +5 -49
- package/build-types/registry.d.ts.map +1 -1
- package/build-types/resolvers-cache-middleware.d.ts +13 -7
- package/build-types/resolvers-cache-middleware.d.ts.map +1 -1
- package/build-types/select.d.ts +3 -0
- package/build-types/select.d.ts.map +1 -1
- package/build-types/store/index.d.ts +5 -12
- package/build-types/store/index.d.ts.map +1 -1
- package/build-types/types.d.ts +201 -10
- package/build-types/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/components/async-mode-provider/{context.js → context.ts} +0 -1
- package/src/components/async-mode-provider/{use-async-mode.js → use-async-mode.ts} +1 -1
- package/src/components/registry-provider/{use-registry.js → use-registry.ts} +3 -2
- package/src/components/use-dispatch/{use-dispatch-with-map.js → use-dispatch-with-map.ts} +18 -9
- package/src/components/use-dispatch/{use-dispatch.js → use-dispatch.ts} +25 -20
- package/src/components/use-select/{index.js → index.ts} +84 -70
- package/src/components/with-dispatch/{index.js → index.tsx} +20 -13
- package/src/components/with-registry/{index.js → index.tsx} +1 -5
- package/src/components/with-select/{index.js → index.tsx} +17 -10
- package/src/{controls.js → controls.ts} +53 -26
- package/src/{default-registry.js → default-registry.ts} +3 -1
- package/src/dispatch.ts +7 -1
- package/src/factory.ts +4 -3
- package/src/index.ts +4 -8
- package/src/plugins/persistence/{index.js → index.ts} +93 -54
- package/src/plugins/persistence/storage/{default.js → default.ts} +3 -2
- package/src/plugins/persistence/storage/object.ts +25 -0
- package/src/{promise-middleware.js → promise-middleware.ts} +3 -3
- package/src/redux-store/{index.js → index.ts} +218 -131
- package/src/redux-store/metadata/{selectors.js → selectors.ts} +83 -54
- package/src/redux-store/metadata/types.ts +100 -0
- package/src/{registry.js → registry.ts} +98 -88
- package/src/{resolvers-cache-middleware.js → resolvers-cache-middleware.ts} +22 -7
- package/src/select.ts +6 -1
- package/src/store/{index.js → index.ts} +13 -8
- package/src/types.ts +263 -24
- package/src/plugins/persistence/storage/object.js +0 -23
- /package/src/components/async-mode-provider/{index.js → index.ts} +0 -0
- /package/src/components/registry-provider/{context.js → context.ts} +0 -0
- /package/src/components/registry-provider/{index.js → index.ts} +0 -0
- /package/src/components/use-dispatch/{index.js → index.ts} +0 -0
- /package/src/plugins/{index.js → index.ts} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export const Context: import("react").Context<import("
|
|
1
|
+
export declare const Context: import("react").Context<import("../..").DataRegistry>;
|
|
2
|
+
declare const Provider: import("react").Provider<import("../..").DataRegistry>;
|
|
2
3
|
/**
|
|
3
4
|
* A custom react Context consumer exposing the provided `registry` to
|
|
4
5
|
* children components. Used along with the RegistryProvider.
|
|
@@ -30,7 +31,13 @@ export const Context: import("react").Context<import("../../registry").WPDataReg
|
|
|
30
31
|
* }
|
|
31
32
|
* ```
|
|
32
33
|
*/
|
|
33
|
-
export const RegistryConsumer: import("react").Consumer<import("
|
|
34
|
+
export declare const RegistryConsumer: import("react").Consumer<import("../..").DataRegistry>;
|
|
35
|
+
/**
|
|
36
|
+
* A custom Context provider for exposing the provided `registry` to children
|
|
37
|
+
* components via a consumer.
|
|
38
|
+
*
|
|
39
|
+
* See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
|
|
40
|
+
* example.
|
|
41
|
+
*/
|
|
34
42
|
export default Provider;
|
|
35
|
-
declare const Provider: import("react").Provider<import("../../registry").WPDataRegistry>;
|
|
36
43
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/context.
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/context.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,OAAO,uDAAmC,CAAC;AAGxD,QAAA,MAAkB,QAAQ,wDAAY,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,gBAAgB,wDAAW,CAAC;AAEzC;;;;;;GAMG;AACH,eAAe,QAAQ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
1
|
+
export { default as RegistryProvider, RegistryConsumer } from './context';
|
|
2
|
+
export { default as useRegistry } from './use-registry';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DataRegistry } from '../../types';
|
|
1
2
|
/**
|
|
2
3
|
* A custom react hook exposing the registry context for use.
|
|
3
4
|
*
|
|
@@ -35,7 +36,7 @@
|
|
|
35
36
|
* };
|
|
36
37
|
* ```
|
|
37
38
|
*
|
|
38
|
-
* @return
|
|
39
|
+
* @return A custom react hook exposing the registry context value.
|
|
39
40
|
*/
|
|
40
|
-
export default function useRegistry():
|
|
41
|
+
export default function useRegistry(): DataRegistry;
|
|
41
42
|
//# sourceMappingURL=use-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-registry.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/use-registry.
|
|
1
|
+
{"version":3,"file":"use-registry.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/use-registry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,IAAI,YAAY,CAElD"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as useDispatch } from
|
|
2
|
-
export { default as useDispatchWithMap } from
|
|
1
|
+
export { default as useDispatch } from './use-dispatch';
|
|
2
|
+
export { default as useDispatchWithMap } from './use-dispatch-with-map';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import type { DataRegistry } from '../../types';
|
|
2
|
+
type DispatchMap = (dispatch: DataRegistry['dispatch'], registry: DataRegistry) => Record<string, (...args: unknown[]) => unknown>;
|
|
2
3
|
/**
|
|
3
4
|
* Custom react hook for returning aggregate dispatch actions using the provided
|
|
4
5
|
* dispatchMap.
|
|
5
6
|
*
|
|
6
7
|
* Currently this is an internal api only and is implemented by `withDispatch`
|
|
7
8
|
*
|
|
8
|
-
* @param
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @param
|
|
13
|
-
* @return
|
|
14
|
-
*
|
|
9
|
+
* @param dispatchMap Receives the `registry.dispatch` function as
|
|
10
|
+
* the first argument and the `registry` object
|
|
11
|
+
* as the second argument. Should return an
|
|
12
|
+
* object mapping props to functions.
|
|
13
|
+
* @param deps An array of dependencies for the hook.
|
|
14
|
+
* @return An object mapping props to functions created by the passed
|
|
15
|
+
* in dispatchMap.
|
|
15
16
|
*/
|
|
16
|
-
declare
|
|
17
|
+
declare const useDispatchWithMap: (dispatchMap: DispatchMap, deps: unknown[]) => Record<string, (...args: unknown[]) => unknown>;
|
|
18
|
+
export default useDispatchWithMap;
|
|
17
19
|
//# sourceMappingURL=use-dispatch-with-map.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-dispatch-with-map.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/use-dispatch-with-map.
|
|
1
|
+
{"version":3,"file":"use-dispatch-with-map.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/use-dispatch-with-map.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,WAAW,GAAG,CAClB,QAAQ,EAAE,YAAY,CAAE,UAAU,CAAE,EACpC,QAAQ,EAAE,YAAY,KAClB,MAAM,CAAE,MAAM,EAAE,CAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAM,OAAO,CAAE,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,kBAAkB,GACvB,aAAa,WAAW,EACxB,MAAM,OAAO,EAAE,KACb,MAAM,CAAE,MAAM,EAAE,CAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAM,OAAO,CAiCnD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,26 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
export type StoreDescriptor<StoreConfig extends import("../../types").AnyConfig> = import("../../types").StoreDescriptor<StoreConfig>;
|
|
3
|
-
export type UseDispatchReturn<StoreNameOrDescriptor> = import("../../types").UseDispatchReturn<StoreNameOrDescriptor>;
|
|
4
|
-
/**
|
|
5
|
-
* @typedef {import('../../types').StoreDescriptor<StoreConfig>} StoreDescriptor
|
|
6
|
-
* @template {import('../../types').AnyConfig} StoreConfig
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {import('../../types').UseDispatchReturn<StoreNameOrDescriptor>} UseDispatchReturn
|
|
10
|
-
* @template StoreNameOrDescriptor
|
|
11
|
-
*/
|
|
1
|
+
import type { StoreDescriptor, AnyConfig, UseDispatchReturn } from '../../types';
|
|
12
2
|
/**
|
|
13
3
|
* A custom react hook returning the current registry dispatch actions creators.
|
|
14
4
|
*
|
|
15
5
|
* Note: The component using this hook must be within the context of a
|
|
16
6
|
* RegistryProvider.
|
|
17
7
|
*
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* function is returned instead.
|
|
8
|
+
* @param storeNameOrDescriptor Optionally provide the name of the
|
|
9
|
+
* store or its descriptor from which to
|
|
10
|
+
* retrieve action creators. If not
|
|
11
|
+
* provided, the registry.dispatch
|
|
12
|
+
* function is returned instead.
|
|
24
13
|
*
|
|
25
14
|
* @example
|
|
26
15
|
* This illustrates a pattern where you may need to retrieve dynamic data from
|
|
@@ -53,7 +42,9 @@ export type UseDispatchReturn<StoreNameOrDescriptor> = import("../../types").Use
|
|
|
53
42
|
* //
|
|
54
43
|
* // <SaleButton>Start Sale!</SaleButton>
|
|
55
44
|
* ```
|
|
56
|
-
*
|
|
45
|
+
*
|
|
46
|
+
* @return The dispatch function or action creators for the store.
|
|
57
47
|
*/
|
|
58
|
-
declare
|
|
48
|
+
declare const useDispatch: <StoreNameOrDescriptor extends undefined | string | StoreDescriptor<AnyConfig> = undefined>(storeNameOrDescriptor?: StoreNameOrDescriptor) => UseDispatchReturn<StoreNameOrDescriptor>;
|
|
49
|
+
export default useDispatch;
|
|
59
50
|
//# sourceMappingURL=use-dispatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-dispatch.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/use-dispatch.
|
|
1
|
+
{"version":3,"file":"use-dispatch.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/use-dispatch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACX,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,QAAA,MAAM,WAAW,GAChB,qBAAqB,SAClB,SAAS,GACT,MAAM,GACN,eAAe,CAAE,SAAS,CAAE,GAAG,SAAS,EAE3C,wBAAwB,qBAAqB,KAC3C,iBAAiB,CAAE,qBAAqB,CAO1C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import type { MapSelect, StoreDescriptor, AnyConfig, UseSelectReturn } from '../../types';
|
|
1
2
|
/**
|
|
2
3
|
* Custom react hook for retrieving props from registered selectors.
|
|
3
4
|
*
|
|
4
5
|
* In general, this custom React hook follows the
|
|
5
6
|
* [rules of hooks](https://react.dev/reference/rules/rules-of-hooks).
|
|
6
7
|
*
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* invoked on every state change unless the dependencies change.
|
|
8
|
+
* @param mapSelect Function called on every state change. The returned value is
|
|
9
|
+
* exposed to the component implementing this hook. The function
|
|
10
|
+
* receives the `registry.select` method on the first argument
|
|
11
|
+
* and the `registry` on the second argument.
|
|
12
|
+
* When a store key is passed, all selectors for the store will be
|
|
13
|
+
* returned. This is only meant for usage of these selectors in event
|
|
14
|
+
* callbacks, not for data needed to create the element tree.
|
|
15
|
+
* @param deps If provided, this memoizes the mapSelect so the same `mapSelect` is
|
|
16
|
+
* invoked on every state change unless the dependencies change.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```js
|
|
@@ -60,31 +60,27 @@
|
|
|
60
60
|
* return <div onPaste={ onPaste }>{ children }</div>;
|
|
61
61
|
* }
|
|
62
62
|
* ```
|
|
63
|
-
*
|
|
63
|
+
*
|
|
64
|
+
* @return The selected data or store selectors.
|
|
64
65
|
*/
|
|
65
|
-
export default function useSelect<T extends MapSelect | StoreDescriptor<
|
|
66
|
+
export default function useSelect<T extends MapSelect | StoreDescriptor<AnyConfig>>(mapSelect: T, deps?: unknown[]): UseSelectReturn<T>;
|
|
66
67
|
/**
|
|
67
68
|
* A variant of the `useSelect` hook that has the same API, but is a compatible
|
|
68
69
|
* Suspense-enabled data source.
|
|
69
70
|
*
|
|
70
|
-
* @
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* state change unless the dependencies change.
|
|
71
|
+
* @param mapSelect Function called on every state change. The
|
|
72
|
+
* returned value is exposed to the component
|
|
73
|
+
* using this hook. The function receives the
|
|
74
|
+
* `registry.suspendSelect` method as the first
|
|
75
|
+
* argument and the `registry` as the second one.
|
|
76
|
+
* @param deps A dependency array used to memoize the `mapSelect`
|
|
77
|
+
* so that the same `mapSelect` is invoked on every
|
|
78
|
+
* state change unless the dependencies change.
|
|
79
79
|
*
|
|
80
|
-
* @throws
|
|
80
|
+
* @throws A suspense Promise that is thrown if any of the called
|
|
81
81
|
* selectors is in an unresolved state.
|
|
82
82
|
*
|
|
83
|
-
* @return
|
|
83
|
+
* @return Data object returned by the `mapSelect` function.
|
|
84
84
|
*/
|
|
85
|
-
export function useSuspenseSelect<T extends MapSelect>(mapSelect: T, deps:
|
|
86
|
-
export type StoreDescriptor<C extends import("../../types").AnyConfig> = import("../../types").StoreDescriptor<C>;
|
|
87
|
-
export type ReduxStoreConfig<State, Actions extends Record<string, import("../../types").ActionCreator>, Selectors> = import("../../types").ReduxStoreConfig<State, Actions, Selectors>;
|
|
88
|
-
export type MapSelect = import("../../types").MapSelect;
|
|
89
|
-
export type UseSelectReturn<T extends MapSelect | StoreDescriptor<any>> = import("../../types").UseSelectReturn<T>;
|
|
85
|
+
export declare function useSuspenseSelect<T extends MapSelect>(mapSelect: T, deps: unknown[]): ReturnType<T>;
|
|
90
86
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/use-select/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/use-select/index.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACX,SAAS,EAET,eAAe,EACf,SAAS,EACT,eAAe,EAEf,MAAM,aAAa,CAAC;AAsOrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,CAAC,SAAS,SAAS,GAAG,eAAe,CAAE,SAAS,CAAE,EAChD,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,GAAI,eAAe,CAAE,CAAC,CAAE,CAsBxD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAE,CAAC,SAAS,SAAS,EACrD,SAAS,EAAE,CAAC,EACZ,IAAI,EAAE,OAAO,EAAE,GACb,UAAU,CAAE,CAAC,CAAE,CAEjB"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
export type ComponentType = React.ComponentType;
|
|
3
|
-
/** @typedef {React.ComponentType} ComponentType */
|
|
1
|
+
import type { DataRegistry } from '../../types';
|
|
4
2
|
/**
|
|
5
3
|
* Higher-order component used to add dispatch props using registered action
|
|
6
4
|
* creators.
|
|
7
5
|
*
|
|
8
|
-
* @param
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
6
|
+
* @param mapDispatchToProps A function of returning an object of
|
|
7
|
+
* prop names where value is a
|
|
8
|
+
* dispatch-bound action creator, or a
|
|
9
|
+
* function to be called with the
|
|
10
|
+
* component's props and returning an
|
|
11
|
+
* action creator.
|
|
14
12
|
*
|
|
15
13
|
* @example
|
|
16
14
|
* ```jsx
|
|
@@ -80,7 +78,8 @@ export type ComponentType = React.ComponentType;
|
|
|
80
78
|
* returns an object with the same keys. For example, it should not contain
|
|
81
79
|
* conditions under which a different value would be returned.
|
|
82
80
|
*
|
|
83
|
-
* @return
|
|
81
|
+
* @return Enhanced component with merged dispatcher props.
|
|
84
82
|
*/
|
|
85
|
-
declare
|
|
83
|
+
declare const withDispatch: (mapDispatchToProps: (dispatch: DataRegistry["dispatch"], ownProps: Record<string, unknown>, registry: DataRegistry) => Record<string, (...args: unknown[]) => unknown>) => (Inner: import("react").ComponentType<any>) => (ownProps: Record<string, unknown>) => import("react").JSX.Element;
|
|
84
|
+
export default withDispatch;
|
|
86
85
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-dispatch/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-dispatch/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,QAAA,MAAM,YAAY,GACjB,oBAAoB,CACnB,QAAQ,EAAE,YAAY,CAAE,UAAU,CAAE,EACpC,QAAQ,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,EACnC,QAAQ,EAAE,YAAY,KAClB,MAAM,CAAE,MAAM,EAAE,CAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAM,OAAO,CAAE,+DAGnB,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,gCAS7D,CAAC;AAEH,eAAe,YAAY,CAAC"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
export default withRegistry;
|
|
2
1
|
/**
|
|
3
2
|
* Higher-order component which renders the original component with the current
|
|
4
3
|
* registry context passed as its `registry` prop.
|
|
5
|
-
*
|
|
6
|
-
* @param {Component} OriginalComponent Original component.
|
|
7
|
-
*
|
|
8
|
-
* @return {Component} Enhanced component.
|
|
9
4
|
*/
|
|
10
|
-
declare const withRegistry: (Inner: import("react").ComponentType<any>) => (props:
|
|
5
|
+
declare const withRegistry: (Inner: import("react").ComponentType<any>) => (props: Record<string, unknown>) => import("react").JSX.Element;
|
|
6
|
+
export default withRegistry;
|
|
11
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-registry/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-registry/index.tsx"],"names":[],"mappings":"AAUA;;;GAGG;AACH,QAAA,MAAM,YAAY,yDACiB,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,gCAQ3D,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
export type ComponentType = React.ComponentType;
|
|
3
|
-
/** @typedef {React.ComponentType} ComponentType */
|
|
1
|
+
import type { SelectFunction, DataRegistry } from '../../types';
|
|
4
2
|
/**
|
|
5
3
|
* Higher-order component used to inject state-derived props using registered
|
|
6
4
|
* selectors.
|
|
7
5
|
*
|
|
8
|
-
* @param
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* @param mapSelectToProps Function called on every state change,
|
|
7
|
+
* expected to return object of props to
|
|
8
|
+
* merge with the component's own props.
|
|
11
9
|
*
|
|
12
10
|
* @example
|
|
13
11
|
* ```js
|
|
@@ -39,7 +37,8 @@ export type ComponentType = React.ComponentType;
|
|
|
39
37
|
* component and update automatically if the price of a hammer ever changes in
|
|
40
38
|
* the store.
|
|
41
39
|
*
|
|
42
|
-
* @return
|
|
40
|
+
* @return Enhanced component with merged state data props.
|
|
43
41
|
*/
|
|
44
|
-
declare
|
|
42
|
+
declare const withSelect: (mapSelectToProps: (select: SelectFunction, ownProps: Record<string, unknown>, registry: DataRegistry) => Record<string, unknown>) => (Inner: import("react").ComponentType<any>) => import("react").ComponentType<Record<string, unknown>>;
|
|
43
|
+
export default withSelect;
|
|
45
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-select/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-select/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,QAAA,MAAM,UAAU,GACf,kBAAkB,CACjB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,EACnC,QAAQ,EAAE,YAAY,KAClB,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,0GAa7B,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
|
@@ -1,41 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
export { select };
|
|
3
|
-
export { resolveSelect };
|
|
4
|
-
export { dispatch };
|
|
5
|
-
}
|
|
6
|
-
export const builtinControls: {
|
|
7
|
-
"@@data/SELECT": ((registry: any) => ({ storeKey, selectorName, args }: {
|
|
8
|
-
storeKey: any;
|
|
9
|
-
selectorName: any;
|
|
10
|
-
args: any;
|
|
11
|
-
}) => any) & {
|
|
12
|
-
isRegistryControl?: boolean;
|
|
13
|
-
};
|
|
14
|
-
"@@data/RESOLVE_SELECT": ((registry: any) => ({ storeKey, selectorName, args }: {
|
|
15
|
-
storeKey: any;
|
|
16
|
-
selectorName: any;
|
|
17
|
-
args: any;
|
|
18
|
-
}) => any) & {
|
|
19
|
-
isRegistryControl?: boolean;
|
|
20
|
-
};
|
|
21
|
-
"@@data/DISPATCH": ((registry: any) => ({ storeKey, actionName, args }: {
|
|
22
|
-
storeKey: any;
|
|
23
|
-
actionName: any;
|
|
24
|
-
args: any;
|
|
25
|
-
}) => any) & {
|
|
26
|
-
isRegistryControl?: boolean;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export type StoreDescriptor = import("./types").StoreDescriptor;
|
|
1
|
+
import type { StoreDescriptor } from './types';
|
|
30
2
|
/**
|
|
31
3
|
* Dispatches a control action for triggering a synchronous registry select.
|
|
32
4
|
*
|
|
33
5
|
* Note: This control synchronously returns the current selector value, triggering the
|
|
34
6
|
* resolution, but not waiting for it.
|
|
35
7
|
*
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
38
|
-
* @param
|
|
8
|
+
* @param storeNameOrDescriptor Unique namespace identifier for the store
|
|
9
|
+
* @param selectorName The name of the selector.
|
|
10
|
+
* @param args Arguments for the selector.
|
|
39
11
|
*
|
|
40
12
|
* @example
|
|
41
13
|
* ```js
|
|
@@ -48,9 +20,14 @@ export type StoreDescriptor = import("./types").StoreDescriptor;
|
|
|
48
20
|
* }
|
|
49
21
|
* ```
|
|
50
22
|
*
|
|
51
|
-
* @return
|
|
23
|
+
* @return The control descriptor.
|
|
52
24
|
*/
|
|
53
|
-
declare function select(storeNameOrDescriptor: string | StoreDescriptor, selectorName: string, ...args:
|
|
25
|
+
declare function select(storeNameOrDescriptor: string | StoreDescriptor, selectorName: string, ...args: unknown[]): {
|
|
26
|
+
type: string;
|
|
27
|
+
storeKey: string;
|
|
28
|
+
selectorName: string;
|
|
29
|
+
args: unknown[];
|
|
30
|
+
};
|
|
54
31
|
/**
|
|
55
32
|
* Dispatches a control action for triggering and resolving a registry select.
|
|
56
33
|
*
|
|
@@ -58,9 +35,9 @@ declare function select(storeNameOrDescriptor: string | StoreDescriptor, selecto
|
|
|
58
35
|
* selectors that may have a resolver. In such case, it will return a `Promise` that resolves
|
|
59
36
|
* after the selector finishes resolving, with the final result value.
|
|
60
37
|
*
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
38
|
+
* @param storeNameOrDescriptor Unique namespace identifier for the store
|
|
39
|
+
* @param selectorName The name of the selector
|
|
40
|
+
* @param args Arguments for the selector.
|
|
64
41
|
*
|
|
65
42
|
* @example
|
|
66
43
|
* ```js
|
|
@@ -73,15 +50,20 @@ declare function select(storeNameOrDescriptor: string | StoreDescriptor, selecto
|
|
|
73
50
|
* }
|
|
74
51
|
* ```
|
|
75
52
|
*
|
|
76
|
-
* @return
|
|
53
|
+
* @return The control descriptor.
|
|
77
54
|
*/
|
|
78
|
-
declare function resolveSelect(storeNameOrDescriptor: string | StoreDescriptor
|
|
55
|
+
declare function resolveSelect(storeNameOrDescriptor: string | StoreDescriptor<any>, selectorName: string, ...args: any[]): {
|
|
56
|
+
type: string;
|
|
57
|
+
storeKey: string;
|
|
58
|
+
selectorName: string;
|
|
59
|
+
args: any[];
|
|
60
|
+
};
|
|
79
61
|
/**
|
|
80
62
|
* Dispatches a control action for triggering a registry dispatch.
|
|
81
63
|
*
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
64
|
+
* @param storeNameOrDescriptor Unique namespace identifier for the store
|
|
65
|
+
* @param actionName The name of the action to dispatch
|
|
66
|
+
* @param args Arguments for the dispatch action.
|
|
85
67
|
*
|
|
86
68
|
* @example
|
|
87
69
|
* ```js
|
|
@@ -94,8 +76,39 @@ declare function resolveSelect(storeNameOrDescriptor: string | StoreDescriptor,
|
|
|
94
76
|
* }
|
|
95
77
|
* ```
|
|
96
78
|
*
|
|
97
|
-
* @return
|
|
79
|
+
* @return The control descriptor.
|
|
98
80
|
*/
|
|
99
|
-
declare function dispatch(storeNameOrDescriptor: string | StoreDescriptor, actionName: string, ...args:
|
|
81
|
+
declare function dispatch(storeNameOrDescriptor: string | StoreDescriptor, actionName: string, ...args: unknown[]): {
|
|
82
|
+
type: string;
|
|
83
|
+
storeKey: string;
|
|
84
|
+
actionName: string;
|
|
85
|
+
args: unknown[];
|
|
86
|
+
};
|
|
87
|
+
export declare const controls: {
|
|
88
|
+
select: typeof select;
|
|
89
|
+
resolveSelect: typeof resolveSelect;
|
|
90
|
+
dispatch: typeof dispatch;
|
|
91
|
+
};
|
|
92
|
+
type SelectorControlArgs = {
|
|
93
|
+
storeKey: string;
|
|
94
|
+
selectorName: string;
|
|
95
|
+
args: unknown[];
|
|
96
|
+
};
|
|
97
|
+
type ActionControlArgs = {
|
|
98
|
+
storeKey: string;
|
|
99
|
+
actionName: string;
|
|
100
|
+
args: unknown[];
|
|
101
|
+
};
|
|
102
|
+
export declare const builtinControls: {
|
|
103
|
+
"@@data/SELECT": ((registry: import("./types").DataRegistry) => ({ storeKey, selectorName, args }: SelectorControlArgs) => any) & {
|
|
104
|
+
isRegistryControl?: boolean;
|
|
105
|
+
};
|
|
106
|
+
"@@data/RESOLVE_SELECT": ((registry: import("./types").DataRegistry) => ({ storeKey, selectorName, args }: SelectorControlArgs) => any) & {
|
|
107
|
+
isRegistryControl?: boolean;
|
|
108
|
+
};
|
|
109
|
+
"@@data/DISPATCH": ((registry: import("./types").DataRegistry) => ({ storeKey, actionName, args }: ActionControlArgs) => any) & {
|
|
110
|
+
isRegistryControl?: boolean;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
100
113
|
export {};
|
|
101
114
|
//# sourceMappingURL=controls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAU/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iBAAS,MAAM,CACd,qBAAqB,EAAE,MAAM,GAAG,eAAe,EAC/C,YAAY,EAAE,MAAM,EACpB,GAAG,IAAI,EAAE,OAAO,EAAE;;;;;EAUlB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAS,aAAa,CACrB,qBAAqB,EAAE,MAAM,GAAG,eAAe,CAAE,GAAG,CAAE,EACtD,YAAY,EAAE,MAAM,EACpB,GAAG,IAAI,EAAE,GAAG,EAAE;;;;;EAUd;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,iBAAS,QAAQ,CAChB,qBAAqB,EAAE,MAAM,GAAG,eAAe,EAC/C,UAAU,EAAE,MAAM,EAClB,GAAG,IAAI,EAAE,OAAO,EAAE;;;;;EAUlB;AAED,eAAO,MAAM,QAAQ;;;;CAAsC,CAAC;AAE5D,KAAK,mBAAmB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,EAAE,CAAC;CAChB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,EAAE,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,eAAe;uGAGW,mBAAmB;;;+GAKnB,mBAAmB;;;uGAgBrB,iBAAiB;;;CAGrD,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default
|
|
1
|
+
declare const defaultRegistry: import("./types").DataRegistry;
|
|
2
|
+
export default defaultRegistry;
|
|
3
3
|
//# sourceMappingURL=default-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-registry.d.ts","sourceRoot":"","sources":["../src/default-registry.
|
|
1
|
+
{"version":3,"file":"default-registry.d.ts","sourceRoot":"","sources":["../src/default-registry.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,eAAe,gCAAmB,CAAC;AAEzC,eAAe,eAAe,CAAC"}
|
|
@@ -9,6 +9,10 @@ import type { AnyConfig, StoreDescriptor, DispatchReturn } from './types';
|
|
|
9
9
|
* Note: Action creators returned by the dispatch will return a promise when
|
|
10
10
|
* they are called.
|
|
11
11
|
*
|
|
12
|
+
* Warning: This global `dispatch` function only works with the default registry.
|
|
13
|
+
* It will not work with custom `RegistryProvider` or `BlockEditorProvider` contexts.
|
|
14
|
+
* In React components, prefer the `useDispatch` hook instead, which is registry-aware.
|
|
15
|
+
*
|
|
12
16
|
* @param storeNameOrDescriptor The store descriptor. The legacy calling convention of passing
|
|
13
17
|
* the store name is also supported.
|
|
14
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG1E
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG1E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,QAAQ,CACvB,qBAAqB,SAAS,eAAe,CAAE,SAAS,CAAE,GAAG,MAAM,EAEnE,qBAAqB,EAAE,qBAAqB,GAC1C,cAAc,CAAE,qBAAqB,CAAE,CAIzC"}
|
package/build-types/factory.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import type { select as globalSelect } from './select';
|
|
5
|
+
import type { DataRegistry } from './types';
|
|
5
6
|
type RegistrySelector<Selector extends (...args: any[]) => any> = {
|
|
6
7
|
(...args: Parameters<Selector>): ReturnType<Selector>;
|
|
7
8
|
isRegistrySelector?: boolean;
|
|
@@ -68,7 +69,7 @@ export declare function createRegistrySelector<Selector extends (...args: any[])
|
|
|
68
69
|
*
|
|
69
70
|
* @return Registry control that can be registered with a store.
|
|
70
71
|
*/
|
|
71
|
-
export declare function createRegistryControl<T extends (...args: any) => any>(registryControl: T & {
|
|
72
|
+
export declare function createRegistryControl<T extends (registry: DataRegistry) => (...args: any) => any>(registryControl: T & {
|
|
72
73
|
isRegistryControl?: boolean;
|
|
73
74
|
}): T & {
|
|
74
75
|
isRegistryControl?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,KAAK,gBAAgB,CAAE,QAAQ,SAAS,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAM,GAAG,IAAK;IACrE,CAAE,GAAG,IAAI,EAAE,UAAU,CAAE,QAAQ,CAAE,GAAI,UAAU,CAAE,QAAQ,CAAE,CAAC;IAC5D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,SAAS,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAM,GAAG,EAE1C,gBAAgB,EAAE,CAAE,MAAM,EAAE,OAAO,YAAY,KAAM,QAAQ,GAC3D,gBAAgB,CAAE,QAAQ,CAAE,CA0B9B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,qBAAqB,CACpC,CAAC,SAAS,CAAE,QAAQ,EAAE,YAAY,KAAM,CAAE,GAAG,IAAI,EAAE,GAAG,KAAM,GAAG,EAC7D,eAAe,EAAE,CAAC,GAAG;IAAE,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAE;wBAAT,OAAO;EAIpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAGrC,OAAO,KAAK,EACX,eAAe,EACf,gBAAgB,EAChB,eAAe,IAAI,eAAe,EAClC,SAAS,EACT,yBAAyB,EACzB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAGrC,OAAO,KAAK,EACX,eAAe,EACf,gBAAgB,EAChB,eAAe,IAAI,eAAe,EAClC,SAAS,EACT,yBAAyB,EACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,GACX,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACN,OAAO,IAAI,SAAS,EACpB,iBAAiB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,mBAAmB,SAAS,CAAC;AAE7B;;;;GAIG;AACH,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,eAAe,EACS,eAAe,CAAC;AAErD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAE,CAAC,SAAS,eAAe,CAAE,SAAS,CAAE,EACpE,qBAAqB,EAAE,CAAC,GAAG,MAAM,GAC/B,yBAAyB,CAAE,CAAC,CAAE,CAIhC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GACzB,uBACG,MAAM,GACN,eAAe,CAAE,gBAAgB,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE,CAAE,KACrD,GAA6D,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,SAAS,GACrB,UAAU,MAAM,IAAI,EACpB,wBACG,MAAM,GACN,eAAe,CAAE,gBAAgB,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE,CAAE,KACrD,CAAE,MAAM,IAAI,CAC8C,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,QACE,CAAC;AAEtC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,QAAwC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,EAAE,GAAyB,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,GACpB,OAAO,eAAe,CAAE,gBAAgB,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE,CAAE,KACzD,IAAyC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as persistence } from
|
|
1
|
+
export { default as persistence } from './persistence';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
|