@wordpress/data 10.32.0 → 10.32.1-next.b8c8708f3.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/build/components/async-mode-provider/context.js +35 -54
- package/build/components/async-mode-provider/context.js.map +7 -1
- package/build/components/async-mode-provider/index.js +40 -25
- package/build/components/async-mode-provider/index.js.map +7 -1
- package/build/components/async-mode-provider/use-async-mode.js +25 -16
- package/build/components/async-mode-provider/use-async-mode.js.map +7 -1
- package/build/components/registry-provider/context.js +46 -64
- package/build/components/registry-provider/context.js.map +7 -1
- package/build/components/registry-provider/index.js +40 -25
- package/build/components/registry-provider/index.js.map +7 -1
- package/build/components/registry-provider/use-registry.js +25 -55
- package/build/components/registry-provider/use-registry.js.map +7 -1
- package/build/components/use-dispatch/index.js +38 -17
- package/build/components/use-dispatch/index.js.map +7 -1
- package/build/components/use-dispatch/use-dispatch-with-map.js +59 -44
- package/build/components/use-dispatch/use-dispatch-with-map.js.map +7 -1
- package/build/components/use-dispatch/use-dispatch.js +36 -71
- package/build/components/use-dispatch/use-dispatch.js.map +7 -1
- package/build/components/use-select/index.js +79 -208
- package/build/components/use-select/index.js.map +7 -1
- package/build/components/with-dispatch/index.js +34 -107
- package/build/components/with-dispatch/index.js.map +7 -1
- package/build/components/with-registry/index.js +30 -30
- package/build/components/with-registry/index.js.map +7 -1
- package/build/components/with-select/index.js +44 -67
- package/build/components/with-select/index.js.map +7 -1
- package/build/controls.js +49 -110
- package/build/controls.js.map +7 -1
- package/build/create-selector.js +36 -11
- package/build/create-selector.js.map +7 -1
- package/build/default-registry.js +24 -10
- package/build/default-registry.js.map +7 -1
- package/build/dispatch.js +38 -31
- package/build/dispatch.js.map +7 -1
- package/build/factory.js +29 -85
- package/build/factory.js.map +7 -1
- package/build/index.js +114 -301
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -14
- package/build/lock-unlock.js.map +7 -1
- package/build/plugins/index.js +36 -11
- package/build/plugins/index.js.map +7 -1
- package/build/plugins/persistence/index.js +74 -139
- package/build/plugins/persistence/index.js.map +7 -1
- package/build/plugins/persistence/storage/default.js +37 -18
- package/build/plugins/persistence/storage/default.js.map +7 -1
- package/build/plugins/persistence/storage/object.js +24 -7
- package/build/plugins/persistence/storage/object.js.map +7 -1
- package/build/promise-middleware.js +37 -20
- package/build/promise-middleware.js.map +7 -1
- package/build/redux-store/combine-reducers.js +26 -5
- package/build/redux-store/combine-reducers.js.map +7 -1
- package/build/redux-store/index.js +221 -331
- package/build/redux-store/index.js.map +7 -1
- package/build/redux-store/metadata/actions.js +51 -112
- package/build/redux-store/metadata/actions.js.map +7 -1
- package/build/redux-store/metadata/equivalent-key-map.d.js +1 -1
- package/build/redux-store/metadata/equivalent-key-map.d.js.map +7 -1
- package/build/redux-store/metadata/reducer.js +111 -115
- package/build/redux-store/metadata/reducer.js.map +7 -1
- package/build/redux-store/metadata/selectors.js +109 -181
- package/build/redux-store/metadata/selectors.js.map +7 -1
- package/build/redux-store/metadata/utils.js +32 -35
- package/build/redux-store/metadata/utils.js.map +7 -1
- package/build/redux-store/thunk-middleware.js +24 -7
- package/build/redux-store/thunk-middleware.js.map +7 -1
- package/build/registry.js +94 -198
- package/build/registry.js.map +7 -1
- package/build/resolvers-cache-middleware.js +26 -27
- package/build/resolvers-cache-middleware.js.map +7 -1
- package/build/select.js +38 -31
- package/build/select.js.map +7 -1
- package/build/store/index.js +52 -16
- package/build/store/index.js.map +7 -1
- package/build/types.js +16 -5
- package/build/types.js.map +7 -1
- package/build/utils/emitter.js +33 -16
- package/build/utils/emitter.js.map +7 -1
- package/build-module/components/async-mode-provider/context.js +12 -49
- package/build-module/components/async-mode-provider/context.js.map +7 -1
- package/build-module/components/async-mode-provider/index.js +8 -3
- package/build-module/components/async-mode-provider/index.js.map +7 -1
- package/build-module/components/async-mode-provider/use-async-mode.js +7 -11
- package/build-module/components/async-mode-provider/use-async-mode.js.map +7 -1
- package/build-module/components/registry-provider/context.js +13 -58
- package/build-module/components/registry-provider/context.js.map +7 -1
- package/build-module/components/registry-provider/index.js +8 -3
- package/build-module/components/registry-provider/index.js.map +7 -1
- package/build-module/components/registry-provider/use-registry.js +7 -51
- package/build-module/components/registry-provider/use-registry.js.map +7 -1
- package/build-module/components/use-dispatch/index.js +7 -3
- package/build-module/components/use-dispatch/index.js.map +7 -1
- package/build-module/components/use-dispatch/use-dispatch-with-map.js +27 -35
- package/build-module/components/use-dispatch/use-dispatch-with-map.js.map +7 -1
- package/build-module/components/use-dispatch/use-dispatch.js +8 -66
- package/build-module/components/use-dispatch/use-dispatch.js.map +7 -1
- package/build-module/components/use-select/index.js +45 -193
- package/build-module/components/use-select/index.js.map +7 -1
- package/build-module/components/with-dispatch/index.js +16 -104
- package/build-module/components/with-dispatch/index.js.map +7 -1
- package/build-module/components/with-registry/index.js +12 -27
- package/build-module/components/with-registry/index.js.map +7 -1
- package/build-module/components/with-select/index.js +16 -63
- package/build-module/components/with-select/index.js.map +7 -1
- package/build-module/controls.js +25 -105
- package/build-module/controls.js.map +7 -1
- package/build-module/create-selector.js +5 -8
- package/build-module/create-selector.js.map +7 -1
- package/build-module/default-registry.js +6 -6
- package/build-module/default-registry.js.map +7 -1
- package/build-module/dispatch.js +6 -27
- package/build-module/dispatch.js.map +7 -1
- package/build-module/factory.js +8 -82
- package/build-module/factory.js.map +7 -1
- package/build-module/index.js +62 -185
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/plugins/index.js +5 -2
- package/build-module/plugins/index.js.map +7 -1
- package/build-module/plugins/persistence/index.js +38 -129
- package/build-module/plugins/persistence/index.js.map +7 -1
- package/build-module/plugins/persistence/storage/default.js +8 -11
- package/build-module/plugins/persistence/storage/default.js.map +7 -1
- package/build-module/plugins/persistence/storage/object.js +6 -3
- package/build-module/plugins/persistence/storage/object.js.map +7 -1
- package/build-module/promise-middleware.js +8 -14
- package/build-module/promise-middleware.js.map +7 -1
- package/build-module/redux-store/combine-reducers.js +5 -2
- package/build-module/redux-store/combine-reducers.js.map +7 -1
- package/build-module/redux-store/index.js +180 -310
- package/build-module/redux-store/index.js.map +7 -1
- package/build-module/redux-store/metadata/actions.js +30 -109
- package/build-module/redux-store/metadata/actions.js.map +7 -1
- package/build-module/redux-store/metadata/equivalent-key-map.d.js +1 -2
- package/build-module/redux-store/metadata/equivalent-key-map.d.js.map +7 -1
- package/build-module/redux-store/metadata/reducer.js +83 -108
- package/build-module/redux-store/metadata/reducer.js.map +7 -1
- package/build-module/redux-store/metadata/selectors.js +76 -175
- package/build-module/redux-store/metadata/selectors.js.map +7 -1
- package/build-module/redux-store/metadata/utils.js +10 -30
- package/build-module/redux-store/metadata/utils.js.map +7 -1
- package/build-module/redux-store/thunk-middleware.js +7 -4
- package/build-module/redux-store/thunk-middleware.js.map +7 -1
- package/build-module/registry.js +56 -187
- package/build-module/registry.js.map +7 -1
- package/build-module/resolvers-cache-middleware.js +8 -23
- package/build-module/resolvers-cache-middleware.js.map +7 -1
- package/build-module/select.js +6 -27
- package/build-module/select.js.map +7 -1
- package/build-module/store/index.js +34 -12
- package/build-module/store/index.js.map +7 -1
- package/build-module/types.js +1 -2
- package/build-module/types.js.map +7 -1
- package/build-module/utils/emitter.js +12 -13
- package/build-module/utils/emitter.js.map +7 -1
- package/package.json +17 -10
|
@@ -1,28 +1,50 @@
|
|
|
1
1
|
const coreDataStore = {
|
|
2
|
-
name:
|
|
2
|
+
name: "core/data",
|
|
3
3
|
instantiate(registry) {
|
|
4
|
-
const getCoreDataSelector = selectorName => (key, ...args) => {
|
|
4
|
+
const getCoreDataSelector = (selectorName) => (key, ...args) => {
|
|
5
5
|
return registry.select(key)[selectorName](...args);
|
|
6
6
|
};
|
|
7
|
-
const getCoreDataAction = actionName => (key, ...args) => {
|
|
7
|
+
const getCoreDataAction = (actionName) => (key, ...args) => {
|
|
8
8
|
return registry.dispatch(key)[actionName](...args);
|
|
9
9
|
};
|
|
10
10
|
return {
|
|
11
11
|
getSelectors() {
|
|
12
|
-
return Object.fromEntries(
|
|
12
|
+
return Object.fromEntries(
|
|
13
|
+
[
|
|
14
|
+
"getIsResolving",
|
|
15
|
+
"hasStartedResolution",
|
|
16
|
+
"hasFinishedResolution",
|
|
17
|
+
"isResolving",
|
|
18
|
+
"getCachedResolvers"
|
|
19
|
+
].map((selectorName) => [
|
|
20
|
+
selectorName,
|
|
21
|
+
getCoreDataSelector(selectorName)
|
|
22
|
+
])
|
|
23
|
+
);
|
|
13
24
|
},
|
|
14
25
|
getActions() {
|
|
15
|
-
return Object.fromEntries(
|
|
26
|
+
return Object.fromEntries(
|
|
27
|
+
[
|
|
28
|
+
"startResolution",
|
|
29
|
+
"finishResolution",
|
|
30
|
+
"invalidateResolution",
|
|
31
|
+
"invalidateResolutionForStore",
|
|
32
|
+
"invalidateResolutionForStoreSelector"
|
|
33
|
+
].map((actionName) => [
|
|
34
|
+
actionName,
|
|
35
|
+
getCoreDataAction(actionName)
|
|
36
|
+
])
|
|
37
|
+
);
|
|
16
38
|
},
|
|
17
39
|
subscribe() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
// if a change happens, the corresponding store where the tracking stated live
|
|
21
|
-
// would have already triggered a "subscribe" call.
|
|
22
|
-
return () => () => {};
|
|
40
|
+
return () => () => {
|
|
41
|
+
};
|
|
23
42
|
}
|
|
24
43
|
};
|
|
25
44
|
}
|
|
26
45
|
};
|
|
27
|
-
|
|
28
|
-
|
|
46
|
+
var store_default = coreDataStore;
|
|
47
|
+
export {
|
|
48
|
+
store_default as default
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/index.js"],
|
|
4
|
+
"sourcesContent": ["const coreDataStore = {\n\tname: 'core/data',\n\tinstantiate( registry ) {\n\t\tconst getCoreDataSelector =\n\t\t\t( selectorName ) =>\n\t\t\t( key, ...args ) => {\n\t\t\t\treturn registry.select( key )[ selectorName ]( ...args );\n\t\t\t};\n\n\t\tconst getCoreDataAction =\n\t\t\t( actionName ) =>\n\t\t\t( key, ...args ) => {\n\t\t\t\treturn registry.dispatch( key )[ actionName ]( ...args );\n\t\t\t};\n\n\t\treturn {\n\t\t\tgetSelectors() {\n\t\t\t\treturn Object.fromEntries(\n\t\t\t\t\t[\n\t\t\t\t\t\t'getIsResolving',\n\t\t\t\t\t\t'hasStartedResolution',\n\t\t\t\t\t\t'hasFinishedResolution',\n\t\t\t\t\t\t'isResolving',\n\t\t\t\t\t\t'getCachedResolvers',\n\t\t\t\t\t].map( ( selectorName ) => [\n\t\t\t\t\t\tselectorName,\n\t\t\t\t\t\tgetCoreDataSelector( selectorName ),\n\t\t\t\t\t] )\n\t\t\t\t);\n\t\t\t},\n\n\t\t\tgetActions() {\n\t\t\t\treturn Object.fromEntries(\n\t\t\t\t\t[\n\t\t\t\t\t\t'startResolution',\n\t\t\t\t\t\t'finishResolution',\n\t\t\t\t\t\t'invalidateResolution',\n\t\t\t\t\t\t'invalidateResolutionForStore',\n\t\t\t\t\t\t'invalidateResolutionForStoreSelector',\n\t\t\t\t\t].map( ( actionName ) => [\n\t\t\t\t\t\tactionName,\n\t\t\t\t\t\tgetCoreDataAction( actionName ),\n\t\t\t\t\t] )\n\t\t\t\t);\n\t\t\t},\n\n\t\t\tsubscribe() {\n\t\t\t\t// There's no reasons to trigger any listener when we subscribe to this store\n\t\t\t\t// because there's no state stored in this store that need to retrigger selectors\n\t\t\t\t// if a change happens, the corresponding store where the tracking stated live\n\t\t\t\t// would have already triggered a \"subscribe\" call.\n\t\t\t\treturn () => () => {};\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default coreDataStore;\n"],
|
|
5
|
+
"mappings": "AAAA,MAAM,gBAAgB;AAAA,EACrB,MAAM;AAAA,EACN,YAAa,UAAW;AACvB,UAAM,sBACL,CAAE,iBACF,CAAE,QAAQ,SAAU;AACnB,aAAO,SAAS,OAAQ,GAAI,EAAG,YAAa,EAAG,GAAG,IAAK;AAAA,IACxD;AAED,UAAM,oBACL,CAAE,eACF,CAAE,QAAQ,SAAU;AACnB,aAAO,SAAS,SAAU,GAAI,EAAG,UAAW,EAAG,GAAG,IAAK;AAAA,IACxD;AAED,WAAO;AAAA,MACN,eAAe;AACd,eAAO,OAAO;AAAA,UACb;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACD,EAAE,IAAK,CAAE,iBAAkB;AAAA,YAC1B;AAAA,YACA,oBAAqB,YAAa;AAAA,UACnC,CAAE;AAAA,QACH;AAAA,MACD;AAAA,MAEA,aAAa;AACZ,eAAO,OAAO;AAAA,UACb;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACD,EAAE,IAAK,CAAE,eAAgB;AAAA,YACxB;AAAA,YACA,kBAAmB,UAAW;AAAA,UAC/B,CAAE;AAAA,QACH;AAAA,MACD;AAAA,MAEA,YAAY;AAKX,eAAO,MAAM,MAAM;AAAA,QAAC;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AACD;AAEA,IAAO,gBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build-module/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=types.js.map
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
* Create an event emitter.
|
|
3
|
-
*
|
|
4
|
-
* @return The event emitter.
|
|
5
|
-
*/
|
|
6
|
-
export function createEmitter() {
|
|
1
|
+
function createEmitter() {
|
|
7
2
|
let isPaused = false;
|
|
8
3
|
let isPending = false;
|
|
9
|
-
const listeners = new Set();
|
|
10
|
-
const notifyListeners = () =>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
5
|
+
const notifyListeners = () => (
|
|
6
|
+
// We use Array.from to clone the listeners Set
|
|
7
|
+
// This ensures that we don't run a listener
|
|
8
|
+
// that was added as a response to another listener.
|
|
9
|
+
Array.from(listeners).forEach((listener) => listener())
|
|
10
|
+
);
|
|
15
11
|
return {
|
|
16
12
|
get isPaused() {
|
|
17
13
|
return isPaused;
|
|
@@ -39,4 +35,7 @@ export function createEmitter() {
|
|
|
39
35
|
}
|
|
40
36
|
};
|
|
41
37
|
}
|
|
42
|
-
|
|
38
|
+
export {
|
|
39
|
+
createEmitter
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=emitter.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/emitter.ts"],
|
|
4
|
+
"sourcesContent": ["export interface DataEmitter {\n\temit: VoidFunction;\n\tsubscribe: ( listener: VoidFunction ) => VoidFunction;\n\tpause: VoidFunction;\n\tresume: VoidFunction;\n\tisPaused: boolean;\n}\n\n/**\n * Create an event emitter.\n *\n * @return The event emitter.\n */\nexport function createEmitter(): DataEmitter {\n\tlet isPaused = false;\n\tlet isPending = false;\n\tconst listeners = new Set< VoidFunction >();\n\tconst notifyListeners = () =>\n\t\t// We use Array.from to clone the listeners Set\n\t\t// This ensures that we don't run a listener\n\t\t// that was added as a response to another listener.\n\t\tArray.from( listeners ).forEach( ( listener ) => listener() );\n\n\treturn {\n\t\tget isPaused() {\n\t\t\treturn isPaused;\n\t\t},\n\n\t\tsubscribe( listener ) {\n\t\t\tlisteners.add( listener );\n\t\t\treturn () => listeners.delete( listener );\n\t\t},\n\n\t\tpause() {\n\t\t\tisPaused = true;\n\t\t},\n\n\t\tresume() {\n\t\t\tisPaused = false;\n\t\t\tif ( isPending ) {\n\t\t\t\tisPending = false;\n\t\t\t\tnotifyListeners();\n\t\t\t}\n\t\t},\n\n\t\temit() {\n\t\t\tif ( isPaused ) {\n\t\t\t\tisPending = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnotifyListeners();\n\t\t},\n\t};\n}\n"],
|
|
5
|
+
"mappings": "AAaO,SAAS,gBAA6B;AAC5C,MAAI,WAAW;AACf,MAAI,YAAY;AAChB,QAAM,YAAY,oBAAI,IAAoB;AAC1C,QAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA,IAIvB,MAAM,KAAM,SAAU,EAAE,QAAS,CAAE,aAAc,SAAS,CAAE;AAAA;AAE7D,SAAO;AAAA,IACN,IAAI,WAAW;AACd,aAAO;AAAA,IACR;AAAA,IAEA,UAAW,UAAW;AACrB,gBAAU,IAAK,QAAS;AACxB,aAAO,MAAM,UAAU,OAAQ,QAAS;AAAA,IACzC;AAAA,IAEA,QAAQ;AACP,iBAAW;AAAA,IACZ;AAAA,IAEA,SAAS;AACR,iBAAW;AACX,UAAK,WAAY;AAChB,oBAAY;AACZ,wBAAgB;AAAA,MACjB;AAAA,IACD;AAAA,IAEA,OAAO;AACN,UAAK,UAAW;AACf,oBAAY;AACZ;AAAA,MACD;AACA,sBAAgB;AAAA,IACjB;AAAA,EACD;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/data",
|
|
3
|
-
"version": "10.32.0",
|
|
3
|
+
"version": "10.32.1-next.b8c8708f3.0",
|
|
4
4
|
"description": "Data module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -25,19 +25,26 @@
|
|
|
25
25
|
},
|
|
26
26
|
"main": "build/index.js",
|
|
27
27
|
"module": "build-module/index.js",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./build-types/index.d.ts",
|
|
31
|
+
"import": "./build-module/index.js",
|
|
32
|
+
"require": "./build/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
28
36
|
"react-native": "src/index",
|
|
29
37
|
"wpScript": true,
|
|
30
38
|
"types": "build-types",
|
|
31
39
|
"sideEffects": false,
|
|
32
40
|
"dependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"@wordpress/
|
|
35
|
-
"@wordpress/
|
|
36
|
-
"@wordpress/
|
|
37
|
-
"@wordpress/
|
|
38
|
-
"@wordpress/
|
|
39
|
-
"@wordpress/
|
|
40
|
-
"@wordpress/redux-routine": "^5.32.0",
|
|
41
|
+
"@wordpress/compose": "^7.32.1-next.b8c8708f3.0",
|
|
42
|
+
"@wordpress/deprecated": "^4.32.1-next.b8c8708f3.0",
|
|
43
|
+
"@wordpress/element": "^6.32.1-next.b8c8708f3.0",
|
|
44
|
+
"@wordpress/is-shallow-equal": "^5.32.1-next.b8c8708f3.0",
|
|
45
|
+
"@wordpress/priority-queue": "^3.32.1-next.b8c8708f3.0",
|
|
46
|
+
"@wordpress/private-apis": "^1.32.1-next.b8c8708f3.0",
|
|
47
|
+
"@wordpress/redux-routine": "^5.32.1-next.b8c8708f3.0",
|
|
41
48
|
"deepmerge": "^4.3.0",
|
|
42
49
|
"equivalent-key-map": "^0.2.2",
|
|
43
50
|
"is-plain-object": "^5.0.0",
|
|
@@ -52,5 +59,5 @@
|
|
|
52
59
|
"publishConfig": {
|
|
53
60
|
"access": "public"
|
|
54
61
|
},
|
|
55
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "67cfd7e661931aeb0d06bec894599d287a4f8d0f"
|
|
56
63
|
}
|