@wordpress/data 10.32.0 → 10.32.1-next.ff1cebbba.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,56 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var context_exports = {};
|
|
20
|
+
__export(context_exports, {
|
|
21
|
+
AsyncModeConsumer: () => AsyncModeConsumer,
|
|
22
|
+
Context: () => Context,
|
|
23
|
+
default: () => context_default
|
|
5
24
|
});
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Context Provider Component used to switch the data module component rerendering
|
|
22
|
-
* between Sync and Async modes.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
*
|
|
26
|
-
* ```js
|
|
27
|
-
* import { useSelect, AsyncModeProvider } from '@wordpress/data';
|
|
28
|
-
* import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
29
|
-
*
|
|
30
|
-
* function BlockCount() {
|
|
31
|
-
* const count = useSelect( ( select ) => {
|
|
32
|
-
* return select( blockEditorStore ).getBlockCount()
|
|
33
|
-
* }, [] );
|
|
34
|
-
*
|
|
35
|
-
* return count;
|
|
36
|
-
* }
|
|
37
|
-
*
|
|
38
|
-
* function App() {
|
|
39
|
-
* return (
|
|
40
|
-
* <AsyncModeProvider value={ true }>
|
|
41
|
-
* <BlockCount />
|
|
42
|
-
* </AsyncModeProvider>
|
|
43
|
-
* );
|
|
44
|
-
* }
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* In this example, the BlockCount component is rerendered asynchronously.
|
|
48
|
-
* It means if a more critical task is being performed (like typing in an input),
|
|
49
|
-
* the rerendering is delayed until the browser becomes IDLE.
|
|
50
|
-
* It is possible to nest multiple levels of AsyncModeProvider to fine-tune the rendering behavior.
|
|
51
|
-
*
|
|
52
|
-
* @param {boolean} props.value Enable Async Mode.
|
|
53
|
-
* @return {Component} The component to be rendered.
|
|
54
|
-
*/
|
|
55
|
-
var _default = exports.default = Provider;
|
|
56
|
-
//# sourceMappingURL=context.js.map
|
|
25
|
+
module.exports = __toCommonJS(context_exports);
|
|
26
|
+
var import_element = require("@wordpress/element");
|
|
27
|
+
const Context = (0, import_element.createContext)(false);
|
|
28
|
+
Context.displayName = "AsyncModeContext";
|
|
29
|
+
const { Consumer, Provider } = Context;
|
|
30
|
+
const AsyncModeConsumer = Consumer;
|
|
31
|
+
var context_default = Provider;
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
AsyncModeConsumer,
|
|
35
|
+
Context
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/async-mode-provider/context.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nexport const Context = createContext( false );\nContext.displayName = 'AsyncModeContext';\n\nconst { Consumer, Provider } = Context;\n\nexport const AsyncModeConsumer = Consumer;\n\n/**\n * Context Provider Component used to switch the data module component rerendering\n * between Sync and Async modes.\n *\n * @example\n *\n * ```js\n * import { useSelect, AsyncModeProvider } from '@wordpress/data';\n * import { store as blockEditorStore } from '@wordpress/block-editor';\n *\n * function BlockCount() {\n * const count = useSelect( ( select ) => {\n * return select( blockEditorStore ).getBlockCount()\n * }, [] );\n *\n * return count;\n * }\n *\n * function App() {\n * return (\n * <AsyncModeProvider value={ true }>\n * <BlockCount />\n * </AsyncModeProvider>\n * );\n * }\n * ```\n *\n * In this example, the BlockCount component is rerendered asynchronously.\n * It means if a more critical task is being performed (like typing in an input),\n * the rerendering is delayed until the browser becomes IDLE.\n * It is possible to nest multiple levels of AsyncModeProvider to fine-tune the rendering behavior.\n *\n * @param {boolean} props.value Enable Async Mode.\n * @return {Component} The component to be rendered.\n */\nexport default Provider;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA8B;AAEvB,MAAM,cAAU,8BAAe,KAAM;AAC5C,QAAQ,cAAc;AAEtB,MAAM,EAAE,UAAU,SAAS,IAAI;AAExB,MAAM,oBAAoB;AAqCjC,IAAO,kBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,29 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
17
|
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var async_mode_provider_exports = {};
|
|
30
|
+
__export(async_mode_provider_exports, {
|
|
31
|
+
AsyncModeConsumer: () => import_context.AsyncModeConsumer,
|
|
32
|
+
AsyncModeProvider: () => import_context.default,
|
|
33
|
+
useAsyncMode: () => import_use_async_mode.default
|
|
18
34
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
module.exports = __toCommonJS(async_mode_provider_exports);
|
|
36
|
+
var import_use_async_mode = __toESM(require("./use-async-mode"));
|
|
37
|
+
var import_context = __toESM(require("./context"));
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
AsyncModeConsumer,
|
|
41
|
+
AsyncModeProvider,
|
|
42
|
+
useAsyncMode
|
|
24
43
|
});
|
|
25
|
-
|
|
26
|
-
var _context = _interopRequireWildcard(require("./context"));
|
|
27
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/async-mode-provider/index.js"],
|
|
4
|
+
"sourcesContent": ["export { default as useAsyncMode } from './use-async-mode';\nexport { default as AsyncModeProvider, AsyncModeConsumer } from './context';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAwC;AACxC,qBAAgE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var use_async_mode_exports = {};
|
|
20
|
+
__export(use_async_mode_exports, {
|
|
21
|
+
default: () => useAsyncMode
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
/**
|
|
10
|
-
* WordPress dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
23
|
+
module.exports = __toCommonJS(use_async_mode_exports);
|
|
24
|
+
var import_element = require("@wordpress/element");
|
|
25
|
+
var import_context = require("./context");
|
|
17
26
|
function useAsyncMode() {
|
|
18
|
-
return (0,
|
|
27
|
+
return (0, import_element.useContext)(import_context.Context);
|
|
19
28
|
}
|
|
20
|
-
//# sourceMappingURL=use-async-mode.js.map
|
|
29
|
+
//# sourceMappingURL=use-async-mode.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/async-mode-provider/use-async-mode.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Context } from './context';\n\nexport default function useAsyncMode() {\n\treturn useContext( Context );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA2B;AAK3B,qBAAwB;AAET,SAAR,eAAgC;AACtC,aAAO,2BAAY,sBAAQ;AAC5B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,66 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var context_exports = {};
|
|
30
|
+
__export(context_exports, {
|
|
31
|
+
Context: () => Context,
|
|
32
|
+
RegistryConsumer: () => RegistryConsumer,
|
|
33
|
+
default: () => context_default
|
|
6
34
|
});
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Consumer,
|
|
22
|
-
Provider
|
|
23
|
-
} = Context;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* A custom react Context consumer exposing the provided `registry` to
|
|
27
|
-
* children components. Used along with the RegistryProvider.
|
|
28
|
-
*
|
|
29
|
-
* You can read more about the react context api here:
|
|
30
|
-
* https://react.dev/learn/passing-data-deeply-with-context#step-3-provide-the-context
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```js
|
|
34
|
-
* import {
|
|
35
|
-
* RegistryProvider,
|
|
36
|
-
* RegistryConsumer,
|
|
37
|
-
* createRegistry
|
|
38
|
-
* } from '@wordpress/data';
|
|
39
|
-
*
|
|
40
|
-
* const registry = createRegistry( {} );
|
|
41
|
-
*
|
|
42
|
-
* const App = ( { props } ) => {
|
|
43
|
-
* return <RegistryProvider value={ registry }>
|
|
44
|
-
* <div>Hello There</div>
|
|
45
|
-
* <RegistryConsumer>
|
|
46
|
-
* { ( registry ) => (
|
|
47
|
-
* <ComponentUsingRegistry
|
|
48
|
-
* { ...props }
|
|
49
|
-
* registry={ registry }
|
|
50
|
-
* ) }
|
|
51
|
-
* </RegistryConsumer>
|
|
52
|
-
* </RegistryProvider>
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
const RegistryConsumer = exports.RegistryConsumer = Consumer;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* A custom Context provider for exposing the provided `registry` to children
|
|
60
|
-
* components via a consumer.
|
|
61
|
-
*
|
|
62
|
-
* See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
|
|
63
|
-
* example.
|
|
64
|
-
*/
|
|
65
|
-
var _default = exports.default = Provider;
|
|
66
|
-
//# sourceMappingURL=context.js.map
|
|
35
|
+
module.exports = __toCommonJS(context_exports);
|
|
36
|
+
var import_element = require("@wordpress/element");
|
|
37
|
+
var import_default_registry = __toESM(require("../../default-registry"));
|
|
38
|
+
const Context = (0, import_element.createContext)(import_default_registry.default);
|
|
39
|
+
Context.displayName = "RegistryProviderContext";
|
|
40
|
+
const { Consumer, Provider } = Context;
|
|
41
|
+
const RegistryConsumer = Consumer;
|
|
42
|
+
var context_default = Provider;
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
Context,
|
|
46
|
+
RegistryConsumer
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/registry-provider/context.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport defaultRegistry from '../../default-registry';\n\nexport const Context = createContext( defaultRegistry );\nContext.displayName = 'RegistryProviderContext';\n\nconst { Consumer, Provider } = Context;\n\n/**\n * A custom react Context consumer exposing the provided `registry` to\n * children components. Used along with the RegistryProvider.\n *\n * You can read more about the react context api here:\n * https://react.dev/learn/passing-data-deeply-with-context#step-3-provide-the-context\n *\n * @example\n * ```js\n * import {\n * RegistryProvider,\n * RegistryConsumer,\n * createRegistry\n * } from '@wordpress/data';\n *\n * const registry = createRegistry( {} );\n *\n * const App = ( { props } ) => {\n * return <RegistryProvider value={ registry }>\n * <div>Hello There</div>\n * <RegistryConsumer>\n * { ( registry ) => (\n * <ComponentUsingRegistry\n * \t\t{ ...props }\n * \t registry={ registry }\n * ) }\n * </RegistryConsumer>\n * </RegistryProvider>\n * }\n * ```\n */\nexport const RegistryConsumer = Consumer;\n\n/**\n * A custom Context provider for exposing the provided `registry` to children\n * components via a consumer.\n *\n * See <a name=\"#RegistryConsumer\">RegistryConsumer</a> documentation for\n * example.\n */\nexport default Provider;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA8B;AAK9B,8BAA4B;AAErB,MAAM,cAAU,8BAAe,wBAAAA,OAAgB;AACtD,QAAQ,cAAc;AAEtB,MAAM,EAAE,UAAU,SAAS,IAAI;AAiCxB,MAAM,mBAAmB;AAShC,IAAO,kBAAQ;",
|
|
6
|
+
"names": ["defaultRegistry"]
|
|
7
|
+
}
|
|
@@ -1,29 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
17
|
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var registry_provider_exports = {};
|
|
30
|
+
__export(registry_provider_exports, {
|
|
31
|
+
RegistryConsumer: () => import_context.RegistryConsumer,
|
|
32
|
+
RegistryProvider: () => import_context.default,
|
|
33
|
+
useRegistry: () => import_use_registry.default
|
|
18
34
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
module.exports = __toCommonJS(registry_provider_exports);
|
|
36
|
+
var import_context = __toESM(require("./context"));
|
|
37
|
+
var import_use_registry = __toESM(require("./use-registry"));
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
RegistryConsumer,
|
|
41
|
+
RegistryProvider,
|
|
42
|
+
useRegistry
|
|
24
43
|
});
|
|
25
|
-
|
|
26
|
-
var _useRegistry = _interopRequireDefault(require("./use-registry"));
|
|
27
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/registry-provider/index.js"],
|
|
4
|
+
"sourcesContent": ["export { default as RegistryProvider, RegistryConsumer } from './context';\nexport { default as useRegistry } from './use-registry';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA8D;AAC9D,0BAAuC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,59 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var use_registry_exports = {};
|
|
20
|
+
__export(use_registry_exports, {
|
|
21
|
+
default: () => useRegistry
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
/**
|
|
10
|
-
* WordPress dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* A custom react hook exposing the registry context for use.
|
|
19
|
-
*
|
|
20
|
-
* This exposes the `registry` value provided via the
|
|
21
|
-
* <a href="#RegistryProvider">Registry Provider</a> to a component implementing
|
|
22
|
-
* this hook.
|
|
23
|
-
*
|
|
24
|
-
* It acts similarly to the `useContext` react hook.
|
|
25
|
-
*
|
|
26
|
-
* Note: Generally speaking, `useRegistry` is a low level hook that in most cases
|
|
27
|
-
* won't be needed for implementation. Most interactions with the `@wordpress/data`
|
|
28
|
-
* API can be performed via the `useSelect` hook, or the `withSelect` and
|
|
29
|
-
* `withDispatch` higher order components.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```js
|
|
33
|
-
* import {
|
|
34
|
-
* RegistryProvider,
|
|
35
|
-
* createRegistry,
|
|
36
|
-
* useRegistry,
|
|
37
|
-
* } from '@wordpress/data';
|
|
38
|
-
*
|
|
39
|
-
* const registry = createRegistry( {} );
|
|
40
|
-
*
|
|
41
|
-
* const SomeChildUsingRegistry = ( props ) => {
|
|
42
|
-
* const registry = useRegistry();
|
|
43
|
-
* // ...logic implementing the registry in other react hooks.
|
|
44
|
-
* };
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* const ParentProvidingRegistry = ( props ) => {
|
|
48
|
-
* return <RegistryProvider value={ registry }>
|
|
49
|
-
* <SomeChildUsingRegistry { ...props } />
|
|
50
|
-
* </RegistryProvider>
|
|
51
|
-
* };
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* @return {Function} A custom react hook exposing the registry context value.
|
|
55
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(use_registry_exports);
|
|
24
|
+
var import_element = require("@wordpress/element");
|
|
25
|
+
var import_context = require("./context");
|
|
56
26
|
function useRegistry() {
|
|
57
|
-
return (0,
|
|
27
|
+
return (0, import_element.useContext)(import_context.Context);
|
|
58
28
|
}
|
|
59
|
-
//# sourceMappingURL=use-registry.js.map
|
|
29
|
+
//# sourceMappingURL=use-registry.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/registry-provider/use-registry.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { Context } from './context';\n\n/**\n * A custom react hook exposing the registry context for use.\n *\n * This exposes the `registry` value provided via the\n * <a href=\"#RegistryProvider\">Registry Provider</a> to a component implementing\n * this hook.\n *\n * It acts similarly to the `useContext` react hook.\n *\n * Note: Generally speaking, `useRegistry` is a low level hook that in most cases\n * won't be needed for implementation. Most interactions with the `@wordpress/data`\n * API can be performed via the `useSelect` hook, or the `withSelect` and\n * `withDispatch` higher order components.\n *\n * @example\n * ```js\n * import {\n * RegistryProvider,\n * createRegistry,\n * useRegistry,\n * } from '@wordpress/data';\n *\n * const registry = createRegistry( {} );\n *\n * const SomeChildUsingRegistry = ( props ) => {\n * const registry = useRegistry();\n * // ...logic implementing the registry in other react hooks.\n * };\n *\n *\n * const ParentProvidingRegistry = ( props ) => {\n * return <RegistryProvider value={ registry }>\n * <SomeChildUsingRegistry { ...props } />\n * </RegistryProvider>\n * };\n * ```\n *\n * @return {Function} A custom react hook exposing the registry context value.\n */\nexport default function useRegistry() {\n\treturn useContext( Context );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA2B;AAK3B,qBAAwB;AAyCT,SAAR,cAA+B;AACrC,aAAO,2BAAY,sBAAQ;AAC5B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,21 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
17
|
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var use_dispatch_exports = {};
|
|
30
|
+
__export(use_dispatch_exports, {
|
|
31
|
+
useDispatch: () => import_use_dispatch.default,
|
|
32
|
+
useDispatchWithMap: () => import_use_dispatch_with_map.default
|
|
12
33
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
module.exports = __toCommonJS(use_dispatch_exports);
|
|
35
|
+
var import_use_dispatch = __toESM(require("./use-dispatch"));
|
|
36
|
+
var import_use_dispatch_with_map = __toESM(require("./use-dispatch-with-map"));
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
useDispatch,
|
|
40
|
+
useDispatchWithMap
|
|
18
41
|
});
|
|
19
|
-
|
|
20
|
-
var _useDispatchWithMap = _interopRequireDefault(require("./use-dispatch-with-map"));
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/use-dispatch/index.js"],
|
|
4
|
+
"sourcesContent": ["export { default as useDispatch } from './use-dispatch';\nexport { default as useDispatchWithMap } from './use-dispatch-with-map';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAuC;AACvC,mCAA8C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|