changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
21:48c4eec2b7e6 | 22:8c2e4d02f4ef |
---|---|
523 /******/ }; |
523 /******/ }; |
524 /******/ })(); |
524 /******/ })(); |
525 /******/ |
525 /******/ |
526 /************************************************************************/ |
526 /************************************************************************/ |
527 var __webpack_exports__ = {}; |
527 var __webpack_exports__ = {}; |
528 // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. |
|
529 (() => { |
|
530 // ESM COMPAT FLAG |
528 // ESM COMPAT FLAG |
531 __webpack_require__.r(__webpack_exports__); |
529 __webpack_require__.r(__webpack_exports__); |
532 |
530 |
533 // EXPORTS |
531 // EXPORTS |
534 __webpack_require__.d(__webpack_exports__, { |
532 __webpack_require__.d(__webpack_exports__, { |
597 __webpack_require__.r(plugins_namespaceObject); |
595 __webpack_require__.r(plugins_namespaceObject); |
598 __webpack_require__.d(plugins_namespaceObject, { |
596 __webpack_require__.d(plugins_namespaceObject, { |
599 persistence: () => (persistence) |
597 persistence: () => (persistence) |
600 }); |
598 }); |
601 |
599 |
602 ;// CONCATENATED MODULE: external ["wp","deprecated"] |
600 ;// external ["wp","deprecated"] |
603 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; |
601 const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; |
604 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); |
602 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); |
605 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js |
603 ;// ./node_modules/redux/dist/redux.mjs |
606 function _typeof(o) { |
604 // src/utils/formatProdErrorMessage.ts |
607 "@babel/helpers - typeof"; |
|
608 |
|
609 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { |
|
610 return typeof o; |
|
611 } : function (o) { |
|
612 return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
|
613 }, _typeof(o); |
|
614 } |
|
615 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js |
|
616 |
|
617 function _toPrimitive(input, hint) { |
|
618 if (_typeof(input) !== "object" || input === null) return input; |
|
619 var prim = input[Symbol.toPrimitive]; |
|
620 if (prim !== undefined) { |
|
621 var res = prim.call(input, hint || "default"); |
|
622 if (_typeof(res) !== "object") return res; |
|
623 throw new TypeError("@@toPrimitive must return a primitive value."); |
|
624 } |
|
625 return (hint === "string" ? String : Number)(input); |
|
626 } |
|
627 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js |
|
628 |
|
629 |
|
630 function _toPropertyKey(arg) { |
|
631 var key = _toPrimitive(arg, "string"); |
|
632 return _typeof(key) === "symbol" ? key : String(key); |
|
633 } |
|
634 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js |
|
635 |
|
636 function _defineProperty(obj, key, value) { |
|
637 key = _toPropertyKey(key); |
|
638 if (key in obj) { |
|
639 Object.defineProperty(obj, key, { |
|
640 value: value, |
|
641 enumerable: true, |
|
642 configurable: true, |
|
643 writable: true |
|
644 }); |
|
645 } else { |
|
646 obj[key] = value; |
|
647 } |
|
648 return obj; |
|
649 } |
|
650 ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js |
|
651 |
|
652 function ownKeys(e, r) { |
|
653 var t = Object.keys(e); |
|
654 if (Object.getOwnPropertySymbols) { |
|
655 var o = Object.getOwnPropertySymbols(e); |
|
656 r && (o = o.filter(function (r) { |
|
657 return Object.getOwnPropertyDescriptor(e, r).enumerable; |
|
658 })), t.push.apply(t, o); |
|
659 } |
|
660 return t; |
|
661 } |
|
662 function _objectSpread2(e) { |
|
663 for (var r = 1; r < arguments.length; r++) { |
|
664 var t = null != arguments[r] ? arguments[r] : {}; |
|
665 r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { |
|
666 _defineProperty(e, r, t[r]); |
|
667 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { |
|
668 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
|
669 }); |
|
670 } |
|
671 return e; |
|
672 } |
|
673 ;// CONCATENATED MODULE: ./node_modules/redux/es/redux.js |
|
674 |
|
675 |
|
676 /** |
|
677 * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js |
|
678 * |
|
679 * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes |
|
680 * during build. |
|
681 * @param {number} code |
|
682 */ |
|
683 function formatProdErrorMessage(code) { |
605 function formatProdErrorMessage(code) { |
684 return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. '; |
606 return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `; |
685 } |
607 } |
686 |
608 |
687 // Inlined version of the `symbol-observable` polyfill |
609 // src/utils/symbol-observable.ts |
688 var $$observable = (function () { |
610 var $$observable = /* @__PURE__ */ (() => typeof Symbol === "function" && Symbol.observable || "@@observable")(); |
689 return typeof Symbol === 'function' && Symbol.observable || '@@observable'; |
611 var symbol_observable_default = $$observable; |
690 })(); |
612 |
691 |
613 // src/utils/actionTypes.ts |
692 /** |
614 var randomString = () => Math.random().toString(36).substring(7).split("").join("."); |
693 * These are private action types reserved by Redux. |
615 var ActionTypes = { |
694 * For any unknown actions, you must return the current state. |
616 INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`, |
695 * If the current state is undefined, you must return the initial state. |
617 REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`, |
696 * Do not reference these action types directly in your code. |
618 PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}` |
697 */ |
|
698 var randomString = function randomString() { |
|
699 return Math.random().toString(36).substring(7).split('').join('.'); |
|
700 }; |
619 }; |
701 |
620 var actionTypes_default = ActionTypes; |
702 var ActionTypes = { |
621 |
703 INIT: "@@redux/INIT" + randomString(), |
622 // src/utils/isPlainObject.ts |
704 REPLACE: "@@redux/REPLACE" + randomString(), |
|
705 PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { |
|
706 return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); |
|
707 } |
|
708 }; |
|
709 |
|
710 /** |
|
711 * @param {any} obj The object to inspect. |
|
712 * @returns {boolean} True if the argument appears to be a plain object. |
|
713 */ |
|
714 function isPlainObject(obj) { |
623 function isPlainObject(obj) { |
715 if (typeof obj !== 'object' || obj === null) return false; |
624 if (typeof obj !== "object" || obj === null) |
716 var proto = obj; |
625 return false; |
717 |
626 let proto = obj; |
718 while (Object.getPrototypeOf(proto) !== null) { |
627 while (Object.getPrototypeOf(proto) !== null) { |
719 proto = Object.getPrototypeOf(proto); |
628 proto = Object.getPrototypeOf(proto); |
720 } |
629 } |
721 |
630 return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null; |
722 return Object.getPrototypeOf(obj) === proto; |
631 } |
723 } |
632 |
724 |
633 // src/utils/kindOf.ts |
725 // Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of |
|
726 function miniKindOf(val) { |
634 function miniKindOf(val) { |
727 if (val === void 0) return 'undefined'; |
635 if (val === void 0) |
728 if (val === null) return 'null'; |
636 return "undefined"; |
729 var type = typeof val; |
637 if (val === null) |
730 |
638 return "null"; |
639 const type = typeof val; |
|
731 switch (type) { |
640 switch (type) { |
732 case 'boolean': |
641 case "boolean": |
733 case 'string': |
642 case "string": |
734 case 'number': |
643 case "number": |
735 case 'symbol': |
644 case "symbol": |
736 case 'function': |
645 case "function": { |
737 { |
646 return type; |
738 return type; |
647 } |
739 } |
648 } |
740 } |
649 if (Array.isArray(val)) |
741 |
650 return "array"; |
742 if (Array.isArray(val)) return 'array'; |
651 if (isDate(val)) |
743 if (isDate(val)) return 'date'; |
652 return "date"; |
744 if (isError(val)) return 'error'; |
653 if (isError(val)) |
745 var constructorName = ctorName(val); |
654 return "error"; |
746 |
655 const constructorName = ctorName(val); |
747 switch (constructorName) { |
656 switch (constructorName) { |
748 case 'Symbol': |
657 case "Symbol": |
749 case 'Promise': |
658 case "Promise": |
750 case 'WeakMap': |
659 case "WeakMap": |
751 case 'WeakSet': |
660 case "WeakSet": |
752 case 'Map': |
661 case "Map": |
753 case 'Set': |
662 case "Set": |
754 return constructorName; |
663 return constructorName; |
755 } // other |
664 } |
756 |
665 return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\s/g, ""); |
757 |
666 } |
758 return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); |
|
759 } |
|
760 |
|
761 function ctorName(val) { |
667 function ctorName(val) { |
762 return typeof val.constructor === 'function' ? val.constructor.name : null; |
668 return typeof val.constructor === "function" ? val.constructor.name : null; |
763 } |
669 } |
764 |
|
765 function isError(val) { |
670 function isError(val) { |
766 return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'; |
671 return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number"; |
767 } |
672 } |
768 |
|
769 function isDate(val) { |
673 function isDate(val) { |
770 if (val instanceof Date) return true; |
674 if (val instanceof Date) |
771 return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; |
675 return true; |
772 } |
676 return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function"; |
773 |
677 } |
774 function kindOf(val) { |
678 function kindOf(val) { |
775 var typeOfVal = typeof val; |
679 let typeOfVal = typeof val; |
776 |
|
777 if (false) {} |
680 if (false) {} |
778 |
|
779 return typeOfVal; |
681 return typeOfVal; |
780 } |
682 } |
781 |
683 |
782 /** |
684 // src/createStore.ts |
783 * @deprecated |
|
784 * |
|
785 * **We recommend using the `configureStore` method |
|
786 * of the `@reduxjs/toolkit` package**, which replaces `createStore`. |
|
787 * |
|
788 * Redux Toolkit is our recommended approach for writing Redux logic today, |
|
789 * including store setup, reducers, data fetching, and more. |
|
790 * |
|
791 * **For more details, please read this Redux docs page:** |
|
792 * **https://redux.js.org/introduction/why-rtk-is-redux-today** |
|
793 * |
|
794 * `configureStore` from Redux Toolkit is an improved version of `createStore` that |
|
795 * simplifies setup and helps avoid common bugs. |
|
796 * |
|
797 * You should not be using the `redux` core package by itself today, except for learning purposes. |
|
798 * The `createStore` method from the core `redux` package will not be removed, but we encourage |
|
799 * all users to migrate to using Redux Toolkit for all Redux code. |
|
800 * |
|
801 * If you want to use `createStore` without this visual deprecation warning, use |
|
802 * the `legacy_createStore` import instead: |
|
803 * |
|
804 * `import { legacy_createStore as createStore} from 'redux'` |
|
805 * |
|
806 */ |
|
807 |
|
808 function createStore(reducer, preloadedState, enhancer) { |
685 function createStore(reducer, preloadedState, enhancer) { |
809 var _ref2; |
686 if (typeof reducer !== "function") { |
810 |
687 throw new Error( true ? formatProdErrorMessage(2) : 0); |
811 if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') { |
688 } |
689 if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") { |
|
812 throw new Error( true ? formatProdErrorMessage(0) : 0); |
690 throw new Error( true ? formatProdErrorMessage(0) : 0); |
813 } |
691 } |
814 |
692 if (typeof preloadedState === "function" && typeof enhancer === "undefined") { |
815 if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { |
|
816 enhancer = preloadedState; |
693 enhancer = preloadedState; |
817 preloadedState = undefined; |
694 preloadedState = void 0; |
818 } |
695 } |
819 |
696 if (typeof enhancer !== "undefined") { |
820 if (typeof enhancer !== 'undefined') { |
697 if (typeof enhancer !== "function") { |
821 if (typeof enhancer !== 'function') { |
|
822 throw new Error( true ? formatProdErrorMessage(1) : 0); |
698 throw new Error( true ? formatProdErrorMessage(1) : 0); |
823 } |
699 } |
824 |
|
825 return enhancer(createStore)(reducer, preloadedState); |
700 return enhancer(createStore)(reducer, preloadedState); |
826 } |
701 } |
827 |
702 let currentReducer = reducer; |
828 if (typeof reducer !== 'function') { |
703 let currentState = preloadedState; |
829 throw new Error( true ? formatProdErrorMessage(2) : 0); |
704 let currentListeners = /* @__PURE__ */ new Map(); |
830 } |
705 let nextListeners = currentListeners; |
831 |
706 let listenerIdCounter = 0; |
832 var currentReducer = reducer; |
707 let isDispatching = false; |
833 var currentState = preloadedState; |
|
834 var currentListeners = []; |
|
835 var nextListeners = currentListeners; |
|
836 var isDispatching = false; |
|
837 /** |
|
838 * This makes a shallow copy of currentListeners so we can use |
|
839 * nextListeners as a temporary list while dispatching. |
|
840 * |
|
841 * This prevents any bugs around consumers calling |
|
842 * subscribe/unsubscribe in the middle of a dispatch. |
|
843 */ |
|
844 |
|
845 function ensureCanMutateNextListeners() { |
708 function ensureCanMutateNextListeners() { |
846 if (nextListeners === currentListeners) { |
709 if (nextListeners === currentListeners) { |
847 nextListeners = currentListeners.slice(); |
710 nextListeners = /* @__PURE__ */ new Map(); |
848 } |
711 currentListeners.forEach((listener, key) => { |
849 } |
712 nextListeners.set(key, listener); |
850 /** |
713 }); |
851 * Reads the state tree managed by the store. |
714 } |
852 * |
715 } |
853 * @returns {any} The current state tree of your application. |
|
854 */ |
|
855 |
|
856 |
|
857 function getState() { |
716 function getState() { |
858 if (isDispatching) { |
717 if (isDispatching) { |
859 throw new Error( true ? formatProdErrorMessage(3) : 0); |
718 throw new Error( true ? formatProdErrorMessage(3) : 0); |
860 } |
719 } |
861 |
|
862 return currentState; |
720 return currentState; |
863 } |
721 } |
864 /** |
|
865 * Adds a change listener. It will be called any time an action is dispatched, |
|
866 * and some part of the state tree may potentially have changed. You may then |
|
867 * call `getState()` to read the current state tree inside the callback. |
|
868 * |
|
869 * You may call `dispatch()` from a change listener, with the following |
|
870 * caveats: |
|
871 * |
|
872 * 1. The subscriptions are snapshotted just before every `dispatch()` call. |
|
873 * If you subscribe or unsubscribe while the listeners are being invoked, this |
|
874 * will not have any effect on the `dispatch()` that is currently in progress. |
|
875 * However, the next `dispatch()` call, whether nested or not, will use a more |
|
876 * recent snapshot of the subscription list. |
|
877 * |
|
878 * 2. The listener should not expect to see all state changes, as the state |
|
879 * might have been updated multiple times during a nested `dispatch()` before |
|
880 * the listener is called. It is, however, guaranteed that all subscribers |
|
881 * registered before the `dispatch()` started will be called with the latest |
|
882 * state by the time it exits. |
|
883 * |
|
884 * @param {Function} listener A callback to be invoked on every dispatch. |
|
885 * @returns {Function} A function to remove this change listener. |
|
886 */ |
|
887 |
|
888 |
|
889 function subscribe(listener) { |
722 function subscribe(listener) { |
890 if (typeof listener !== 'function') { |
723 if (typeof listener !== "function") { |
891 throw new Error( true ? formatProdErrorMessage(4) : 0); |
724 throw new Error( true ? formatProdErrorMessage(4) : 0); |
892 } |
725 } |
893 |
|
894 if (isDispatching) { |
726 if (isDispatching) { |
895 throw new Error( true ? formatProdErrorMessage(5) : 0); |
727 throw new Error( true ? formatProdErrorMessage(5) : 0); |
896 } |
728 } |
897 |
729 let isSubscribed = true; |
898 var isSubscribed = true; |
|
899 ensureCanMutateNextListeners(); |
730 ensureCanMutateNextListeners(); |
900 nextListeners.push(listener); |
731 const listenerId = listenerIdCounter++; |
732 nextListeners.set(listenerId, listener); |
|
901 return function unsubscribe() { |
733 return function unsubscribe() { |
902 if (!isSubscribed) { |
734 if (!isSubscribed) { |
903 return; |
735 return; |
904 } |
736 } |
905 |
|
906 if (isDispatching) { |
737 if (isDispatching) { |
907 throw new Error( true ? formatProdErrorMessage(6) : 0); |
738 throw new Error( true ? formatProdErrorMessage(6) : 0); |
908 } |
739 } |
909 |
|
910 isSubscribed = false; |
740 isSubscribed = false; |
911 ensureCanMutateNextListeners(); |
741 ensureCanMutateNextListeners(); |
912 var index = nextListeners.indexOf(listener); |
742 nextListeners.delete(listenerId); |
913 nextListeners.splice(index, 1); |
|
914 currentListeners = null; |
743 currentListeners = null; |
915 }; |
744 }; |
916 } |
745 } |
917 /** |
|
918 * Dispatches an action. It is the only way to trigger a state change. |
|
919 * |
|
920 * The `reducer` function, used to create the store, will be called with the |
|
921 * current state tree and the given `action`. Its return value will |
|
922 * be considered the **next** state of the tree, and the change listeners |
|
923 * will be notified. |
|
924 * |
|
925 * The base implementation only supports plain object actions. If you want to |
|
926 * dispatch a Promise, an Observable, a thunk, or something else, you need to |
|
927 * wrap your store creating function into the corresponding middleware. For |
|
928 * example, see the documentation for the `redux-thunk` package. Even the |
|
929 * middleware will eventually dispatch plain object actions using this method. |
|
930 * |
|
931 * @param {Object} action A plain object representing “what changed”. It is |
|
932 * a good idea to keep actions serializable so you can record and replay user |
|
933 * sessions, or use the time travelling `redux-devtools`. An action must have |
|
934 * a `type` property which may not be `undefined`. It is a good idea to use |
|
935 * string constants for action types. |
|
936 * |
|
937 * @returns {Object} For convenience, the same action object you dispatched. |
|
938 * |
|
939 * Note that, if you use a custom middleware, it may wrap `dispatch()` to |
|
940 * return something else (for example, a Promise you can await). |
|
941 */ |
|
942 |
|
943 |
|
944 function dispatch(action) { |
746 function dispatch(action) { |
945 if (!isPlainObject(action)) { |
747 if (!isPlainObject(action)) { |
946 throw new Error( true ? formatProdErrorMessage(7) : 0); |
748 throw new Error( true ? formatProdErrorMessage(7) : 0); |
947 } |
749 } |
948 |
750 if (typeof action.type === "undefined") { |
949 if (typeof action.type === 'undefined') { |
|
950 throw new Error( true ? formatProdErrorMessage(8) : 0); |
751 throw new Error( true ? formatProdErrorMessage(8) : 0); |
951 } |
752 } |
952 |
753 if (typeof action.type !== "string") { |
754 throw new Error( true ? formatProdErrorMessage(17) : 0); |
|
755 } |
|
953 if (isDispatching) { |
756 if (isDispatching) { |
954 throw new Error( true ? formatProdErrorMessage(9) : 0); |
757 throw new Error( true ? formatProdErrorMessage(9) : 0); |
955 } |
758 } |
956 |
|
957 try { |
759 try { |
958 isDispatching = true; |
760 isDispatching = true; |
959 currentState = currentReducer(currentState, action); |
761 currentState = currentReducer(currentState, action); |
960 } finally { |
762 } finally { |
961 isDispatching = false; |
763 isDispatching = false; |
962 } |
764 } |
963 |
765 const listeners = currentListeners = nextListeners; |
964 var listeners = currentListeners = nextListeners; |
766 listeners.forEach((listener) => { |
965 |
|
966 for (var i = 0; i < listeners.length; i++) { |
|
967 var listener = listeners[i]; |
|
968 listener(); |
767 listener(); |
969 } |
768 }); |
970 |
|
971 return action; |
769 return action; |
972 } |
770 } |
973 /** |
|
974 * Replaces the reducer currently used by the store to calculate the state. |
|
975 * |
|
976 * You might need this if your app implements code splitting and you want to |
|
977 * load some of the reducers dynamically. You might also need this if you |
|
978 * implement a hot reloading mechanism for Redux. |
|
979 * |
|
980 * @param {Function} nextReducer The reducer for the store to use instead. |
|
981 * @returns {void} |
|
982 */ |
|
983 |
|
984 |
|
985 function replaceReducer(nextReducer) { |
771 function replaceReducer(nextReducer) { |
986 if (typeof nextReducer !== 'function') { |
772 if (typeof nextReducer !== "function") { |
987 throw new Error( true ? formatProdErrorMessage(10) : 0); |
773 throw new Error( true ? formatProdErrorMessage(10) : 0); |
988 } |
774 } |
989 |
775 currentReducer = nextReducer; |
990 currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT. |
|
991 // Any reducers that existed in both the new and old rootReducer |
|
992 // will receive the previous state. This effectively populates |
|
993 // the new state tree with any relevant data from the old one. |
|
994 |
|
995 dispatch({ |
776 dispatch({ |
996 type: ActionTypes.REPLACE |
777 type: actionTypes_default.REPLACE |
997 }); |
778 }); |
998 } |
779 } |
999 /** |
|
1000 * Interoperability point for observable/reactive libraries. |
|
1001 * @returns {observable} A minimal observable of state changes. |
|
1002 * For more information, see the observable proposal: |
|
1003 * https://github.com/tc39/proposal-observable |
|
1004 */ |
|
1005 |
|
1006 |
|
1007 function observable() { |
780 function observable() { |
1008 var _ref; |
781 const outerSubscribe = subscribe; |
1009 |
782 return { |
1010 var outerSubscribe = subscribe; |
|
1011 return _ref = { |
|
1012 /** |
783 /** |
1013 * The minimal observable subscription method. |
784 * The minimal observable subscription method. |
1014 * @param {Object} observer Any object that can be used as an observer. |
785 * @param observer Any object that can be used as an observer. |
1015 * The observer object should have a `next` method. |
786 * The observer object should have a `next` method. |
1016 * @returns {subscription} An object with an `unsubscribe` method that can |
787 * @returns An object with an `unsubscribe` method that can |
1017 * be used to unsubscribe the observable from the store, and prevent further |
788 * be used to unsubscribe the observable from the store, and prevent further |
1018 * emission of values from the observable. |
789 * emission of values from the observable. |
1019 */ |
790 */ |
1020 subscribe: function subscribe(observer) { |
791 subscribe(observer) { |
1021 if (typeof observer !== 'object' || observer === null) { |
792 if (typeof observer !== "object" || observer === null) { |
1022 throw new Error( true ? formatProdErrorMessage(11) : 0); |
793 throw new Error( true ? formatProdErrorMessage(11) : 0); |
1023 } |
794 } |
1024 |
|
1025 function observeState() { |
795 function observeState() { |
1026 if (observer.next) { |
796 const observerAsObserver = observer; |
1027 observer.next(getState()); |
797 if (observerAsObserver.next) { |
798 observerAsObserver.next(getState()); |
|
1028 } |
799 } |
1029 } |
800 } |
1030 |
|
1031 observeState(); |
801 observeState(); |
1032 var unsubscribe = outerSubscribe(observeState); |
802 const unsubscribe = outerSubscribe(observeState); |
1033 return { |
803 return { |
1034 unsubscribe: unsubscribe |
804 unsubscribe |
1035 }; |
805 }; |
1036 } |
806 }, |
1037 }, _ref[$$observable] = function () { |
807 [symbol_observable_default]() { |
1038 return this; |
808 return this; |
1039 }, _ref; |
809 } |
1040 } // When a store is created, an "INIT" action is dispatched so that every |
810 }; |
1041 // reducer returns their initial state. This effectively populates |
811 } |
1042 // the initial state tree. |
|
1043 |
|
1044 |
|
1045 dispatch({ |
812 dispatch({ |
1046 type: ActionTypes.INIT |
813 type: actionTypes_default.INIT |
1047 }); |
814 }); |
1048 return _ref2 = { |
815 const store = { |
1049 dispatch: dispatch, |
816 dispatch, |
1050 subscribe: subscribe, |
817 subscribe, |
1051 getState: getState, |
818 getState, |
1052 replaceReducer: replaceReducer |
819 replaceReducer, |
1053 }, _ref2[$$observable] = observable, _ref2; |
820 [symbol_observable_default]: observable |
1054 } |
821 }; |
1055 /** |
822 return store; |
1056 * Creates a Redux store that holds the state tree. |
823 } |
1057 * |
824 function legacy_createStore(reducer, preloadedState, enhancer) { |
1058 * **We recommend using `configureStore` from the |
825 return createStore(reducer, preloadedState, enhancer); |
1059 * `@reduxjs/toolkit` package**, which replaces `createStore`: |
826 } |
1060 * **https://redux.js.org/introduction/why-rtk-is-redux-today** |
827 |
1061 * |
828 // src/utils/warning.ts |
1062 * The only way to change the data in the store is to call `dispatch()` on it. |
|
1063 * |
|
1064 * There should only be a single store in your app. To specify how different |
|
1065 * parts of the state tree respond to actions, you may combine several reducers |
|
1066 * into a single reducer function by using `combineReducers`. |
|
1067 * |
|
1068 * @param {Function} reducer A function that returns the next state tree, given |
|
1069 * the current state tree and the action to handle. |
|
1070 * |
|
1071 * @param {any} [preloadedState] The initial state. You may optionally specify it |
|
1072 * to hydrate the state from the server in universal apps, or to restore a |
|
1073 * previously serialized user session. |
|
1074 * If you use `combineReducers` to produce the root reducer function, this must be |
|
1075 * an object with the same shape as `combineReducers` keys. |
|
1076 * |
|
1077 * @param {Function} [enhancer] The store enhancer. You may optionally specify it |
|
1078 * to enhance the store with third-party capabilities such as middleware, |
|
1079 * time travel, persistence, etc. The only store enhancer that ships with Redux |
|
1080 * is `applyMiddleware()`. |
|
1081 * |
|
1082 * @returns {Store} A Redux store that lets you read the state, dispatch actions |
|
1083 * and subscribe to changes. |
|
1084 */ |
|
1085 |
|
1086 var legacy_createStore = (/* unused pure expression or super */ null && (createStore)); |
|
1087 |
|
1088 /** |
|
1089 * Prints a warning in the console if it exists. |
|
1090 * |
|
1091 * @param {String} message The warning message. |
|
1092 * @returns {void} |
|
1093 */ |
|
1094 function warning(message) { |
829 function warning(message) { |
1095 /* eslint-disable no-console */ |
830 if (typeof console !== "undefined" && typeof console.error === "function") { |
1096 if (typeof console !== 'undefined' && typeof console.error === 'function') { |
|
1097 console.error(message); |
831 console.error(message); |
1098 } |
832 } |
1099 /* eslint-enable no-console */ |
|
1100 |
|
1101 |
|
1102 try { |
833 try { |
1103 // This error was thrown as a convenience so that if you enable |
|
1104 // "break on all exceptions" in your console, |
|
1105 // it would pause the execution at this line. |
|
1106 throw new Error(message); |
834 throw new Error(message); |
1107 } catch (e) {} // eslint-disable-line no-empty |
835 } catch (e) { |
1108 |
836 } |
1109 } |
837 } |
1110 |
838 |
839 // src/combineReducers.ts |
|
1111 function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { |
840 function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { |
1112 var reducerKeys = Object.keys(reducers); |
841 const reducerKeys = Object.keys(reducers); |
1113 var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; |
842 const argumentName = action && action.type === actionTypes_default.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer"; |
1114 |
|
1115 if (reducerKeys.length === 0) { |
843 if (reducerKeys.length === 0) { |
1116 return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; |
844 return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers."; |
1117 } |
845 } |
1118 |
|
1119 if (!isPlainObject(inputState)) { |
846 if (!isPlainObject(inputState)) { |
1120 return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); |
847 return `The ${argumentName} has unexpected type of "${kindOf(inputState)}". Expected argument to be an object with the following keys: "${reducerKeys.join('", "')}"`; |
1121 } |
848 } |
1122 |
849 const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]); |
1123 var unexpectedKeys = Object.keys(inputState).filter(function (key) { |
850 unexpectedKeys.forEach((key) => { |
1124 return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; |
|
1125 }); |
|
1126 unexpectedKeys.forEach(function (key) { |
|
1127 unexpectedKeyCache[key] = true; |
851 unexpectedKeyCache[key] = true; |
1128 }); |
852 }); |
1129 if (action && action.type === ActionTypes.REPLACE) return; |
853 if (action && action.type === actionTypes_default.REPLACE) |
1130 |
854 return; |
1131 if (unexpectedKeys.length > 0) { |
855 if (unexpectedKeys.length > 0) { |
1132 return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored."); |
856 return `Unexpected ${unexpectedKeys.length > 1 ? "keys" : "key"} "${unexpectedKeys.join('", "')}" found in ${argumentName}. Expected to find one of the known reducer keys instead: "${reducerKeys.join('", "')}". Unexpected keys will be ignored.`; |
1133 } |
857 } |
1134 } |
858 } |
1135 |
|
1136 function assertReducerShape(reducers) { |
859 function assertReducerShape(reducers) { |
1137 Object.keys(reducers).forEach(function (key) { |
860 Object.keys(reducers).forEach((key) => { |
1138 var reducer = reducers[key]; |
861 const reducer = reducers[key]; |
1139 var initialState = reducer(undefined, { |
862 const initialState = reducer(void 0, { |
1140 type: ActionTypes.INIT |
863 type: actionTypes_default.INIT |
1141 }); |
864 }); |
1142 |
865 if (typeof initialState === "undefined") { |
1143 if (typeof initialState === 'undefined') { |
|
1144 throw new Error( true ? formatProdErrorMessage(12) : 0); |
866 throw new Error( true ? formatProdErrorMessage(12) : 0); |
1145 } |
867 } |
1146 |
868 if (typeof reducer(void 0, { |
1147 if (typeof reducer(undefined, { |
869 type: actionTypes_default.PROBE_UNKNOWN_ACTION() |
1148 type: ActionTypes.PROBE_UNKNOWN_ACTION() |
870 }) === "undefined") { |
1149 }) === 'undefined') { |
|
1150 throw new Error( true ? formatProdErrorMessage(13) : 0); |
871 throw new Error( true ? formatProdErrorMessage(13) : 0); |
1151 } |
872 } |
1152 }); |
873 }); |
1153 } |
874 } |
1154 /** |
|
1155 * Turns an object whose values are different reducer functions, into a single |
|
1156 * reducer function. It will call every child reducer, and gather their results |
|
1157 * into a single state object, whose keys correspond to the keys of the passed |
|
1158 * reducer functions. |
|
1159 * |
|
1160 * @param {Object} reducers An object whose values correspond to different |
|
1161 * reducer functions that need to be combined into one. One handy way to obtain |
|
1162 * it is to use ES6 `import * as reducers` syntax. The reducers may never return |
|
1163 * undefined for any action. Instead, they should return their initial state |
|
1164 * if the state passed to them was undefined, and the current state for any |
|
1165 * unrecognized action. |
|
1166 * |
|
1167 * @returns {Function} A reducer function that invokes every reducer inside the |
|
1168 * passed object, and builds a state object with the same shape. |
|
1169 */ |
|
1170 |
|
1171 |
|
1172 function combineReducers(reducers) { |
875 function combineReducers(reducers) { |
1173 var reducerKeys = Object.keys(reducers); |
876 const reducerKeys = Object.keys(reducers); |
1174 var finalReducers = {}; |
877 const finalReducers = {}; |
1175 |
878 for (let i = 0; i < reducerKeys.length; i++) { |
1176 for (var i = 0; i < reducerKeys.length; i++) { |
879 const key = reducerKeys[i]; |
1177 var key = reducerKeys[i]; |
|
1178 |
|
1179 if (false) {} |
880 if (false) {} |
1180 |
881 if (typeof reducers[key] === "function") { |
1181 if (typeof reducers[key] === 'function') { |
|
1182 finalReducers[key] = reducers[key]; |
882 finalReducers[key] = reducers[key]; |
1183 } |
883 } |
1184 } |
884 } |
1185 |
885 const finalReducerKeys = Object.keys(finalReducers); |
1186 var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same |
886 let unexpectedKeyCache; |
1187 // keys multiple times. |
|
1188 |
|
1189 var unexpectedKeyCache; |
|
1190 |
|
1191 if (false) {} |
887 if (false) {} |
1192 |
888 let shapeAssertionError; |
1193 var shapeAssertionError; |
|
1194 |
|
1195 try { |
889 try { |
1196 assertReducerShape(finalReducers); |
890 assertReducerShape(finalReducers); |
1197 } catch (e) { |
891 } catch (e) { |
1198 shapeAssertionError = e; |
892 shapeAssertionError = e; |
1199 } |
893 } |
1200 |
894 return function combination(state = {}, action) { |
1201 return function combination(state, action) { |
|
1202 if (state === void 0) { |
|
1203 state = {}; |
|
1204 } |
|
1205 |
|
1206 if (shapeAssertionError) { |
895 if (shapeAssertionError) { |
1207 throw shapeAssertionError; |
896 throw shapeAssertionError; |
1208 } |
897 } |
1209 |
898 if (false) {} |
1210 if (false) { var warningMessage; } |
899 let hasChanged = false; |
1211 |
900 const nextState = {}; |
1212 var hasChanged = false; |
901 for (let i = 0; i < finalReducerKeys.length; i++) { |
1213 var nextState = {}; |
902 const key = finalReducerKeys[i]; |
1214 |
903 const reducer = finalReducers[key]; |
1215 for (var _i = 0; _i < finalReducerKeys.length; _i++) { |
904 const previousStateForKey = state[key]; |
1216 var _key = finalReducerKeys[_i]; |
905 const nextStateForKey = reducer(previousStateForKey, action); |
1217 var reducer = finalReducers[_key]; |
906 if (typeof nextStateForKey === "undefined") { |
1218 var previousStateForKey = state[_key]; |
907 const actionType = action && action.type; |
1219 var nextStateForKey = reducer(previousStateForKey, action); |
|
1220 |
|
1221 if (typeof nextStateForKey === 'undefined') { |
|
1222 var actionType = action && action.type; |
|
1223 throw new Error( true ? formatProdErrorMessage(14) : 0); |
908 throw new Error( true ? formatProdErrorMessage(14) : 0); |
1224 } |
909 } |
1225 |
910 nextState[key] = nextStateForKey; |
1226 nextState[_key] = nextStateForKey; |
|
1227 hasChanged = hasChanged || nextStateForKey !== previousStateForKey; |
911 hasChanged = hasChanged || nextStateForKey !== previousStateForKey; |
1228 } |
912 } |
1229 |
|
1230 hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; |
913 hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; |
1231 return hasChanged ? nextState : state; |
914 return hasChanged ? nextState : state; |
1232 }; |
915 }; |
1233 } |
916 } |
1234 |
917 |
918 // src/bindActionCreators.ts |
|
1235 function bindActionCreator(actionCreator, dispatch) { |
919 function bindActionCreator(actionCreator, dispatch) { |
1236 return function () { |
920 return function(...args) { |
1237 return dispatch(actionCreator.apply(this, arguments)); |
921 return dispatch(actionCreator.apply(this, args)); |
1238 }; |
922 }; |
1239 } |
923 } |
1240 /** |
|
1241 * Turns an object whose values are action creators, into an object with the |
|
1242 * same keys, but with every function wrapped into a `dispatch` call so they |
|
1243 * may be invoked directly. This is just a convenience method, as you can call |
|
1244 * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. |
|
1245 * |
|
1246 * For convenience, you can also pass an action creator as the first argument, |
|
1247 * and get a dispatch wrapped function in return. |
|
1248 * |
|
1249 * @param {Function|Object} actionCreators An object whose values are action |
|
1250 * creator functions. One handy way to obtain it is to use ES6 `import * as` |
|
1251 * syntax. You may also pass a single function. |
|
1252 * |
|
1253 * @param {Function} dispatch The `dispatch` function available on your Redux |
|
1254 * store. |
|
1255 * |
|
1256 * @returns {Function|Object} The object mimicking the original object, but with |
|
1257 * every action creator wrapped into the `dispatch` call. If you passed a |
|
1258 * function as `actionCreators`, the return value will also be a single |
|
1259 * function. |
|
1260 */ |
|
1261 |
|
1262 |
|
1263 function bindActionCreators(actionCreators, dispatch) { |
924 function bindActionCreators(actionCreators, dispatch) { |
1264 if (typeof actionCreators === 'function') { |
925 if (typeof actionCreators === "function") { |
1265 return bindActionCreator(actionCreators, dispatch); |
926 return bindActionCreator(actionCreators, dispatch); |
1266 } |
927 } |
1267 |
928 if (typeof actionCreators !== "object" || actionCreators === null) { |
1268 if (typeof actionCreators !== 'object' || actionCreators === null) { |
|
1269 throw new Error( true ? formatProdErrorMessage(16) : 0); |
929 throw new Error( true ? formatProdErrorMessage(16) : 0); |
1270 } |
930 } |
1271 |
931 const boundActionCreators = {}; |
1272 var boundActionCreators = {}; |
932 for (const key in actionCreators) { |
1273 |
933 const actionCreator = actionCreators[key]; |
1274 for (var key in actionCreators) { |
934 if (typeof actionCreator === "function") { |
1275 var actionCreator = actionCreators[key]; |
|
1276 |
|
1277 if (typeof actionCreator === 'function') { |
|
1278 boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); |
935 boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); |
1279 } |
936 } |
1280 } |
937 } |
1281 |
|
1282 return boundActionCreators; |
938 return boundActionCreators; |
1283 } |
939 } |
1284 |
940 |
1285 /** |
941 // src/compose.ts |
1286 * Composes single-argument functions from right to left. The rightmost |
942 function compose(...funcs) { |
1287 * function can take multiple arguments as it provides the signature for |
|
1288 * the resulting composite function. |
|
1289 * |
|
1290 * @param {...Function} funcs The functions to compose. |
|
1291 * @returns {Function} A function obtained by composing the argument functions |
|
1292 * from right to left. For example, compose(f, g, h) is identical to doing |
|
1293 * (...args) => f(g(h(...args))). |
|
1294 */ |
|
1295 function compose() { |
|
1296 for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { |
|
1297 funcs[_key] = arguments[_key]; |
|
1298 } |
|
1299 |
|
1300 if (funcs.length === 0) { |
943 if (funcs.length === 0) { |
1301 return function (arg) { |
944 return (arg) => arg; |
1302 return arg; |
945 } |
1303 }; |
|
1304 } |
|
1305 |
|
1306 if (funcs.length === 1) { |
946 if (funcs.length === 1) { |
1307 return funcs[0]; |
947 return funcs[0]; |
1308 } |
948 } |
1309 |
949 return funcs.reduce((a, b) => (...args) => a(b(...args))); |
1310 return funcs.reduce(function (a, b) { |
950 } |
1311 return function () { |
951 |
1312 return a(b.apply(void 0, arguments)); |
952 // src/applyMiddleware.ts |
953 function applyMiddleware(...middlewares) { |
|
954 return (createStore2) => (reducer, preloadedState) => { |
|
955 const store = createStore2(reducer, preloadedState); |
|
956 let dispatch = () => { |
|
957 throw new Error( true ? formatProdErrorMessage(15) : 0); |
|
1313 }; |
958 }; |
1314 }); |
959 const middlewareAPI = { |
1315 } |
960 getState: store.getState, |
1316 |
961 dispatch: (action, ...args) => dispatch(action, ...args) |
1317 /** |
962 }; |
1318 * Creates a store enhancer that applies middleware to the dispatch method |
963 const chain = middlewares.map((middleware) => middleware(middlewareAPI)); |
1319 * of the Redux store. This is handy for a variety of tasks, such as expressing |
964 dispatch = compose(...chain)(store.dispatch); |
1320 * asynchronous actions in a concise manner, or logging every action payload. |
965 return { |
1321 * |
966 ...store, |
1322 * See `redux-thunk` package as an example of the Redux middleware. |
967 dispatch |
1323 * |
|
1324 * Because middleware is potentially asynchronous, this should be the first |
|
1325 * store enhancer in the composition chain. |
|
1326 * |
|
1327 * Note that each middleware will be given the `dispatch` and `getState` functions |
|
1328 * as named arguments. |
|
1329 * |
|
1330 * @param {...Function} middlewares The middleware chain to be applied. |
|
1331 * @returns {Function} A store enhancer applying the middleware. |
|
1332 */ |
|
1333 |
|
1334 function applyMiddleware() { |
|
1335 for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) { |
|
1336 middlewares[_key] = arguments[_key]; |
|
1337 } |
|
1338 |
|
1339 return function (createStore) { |
|
1340 return function () { |
|
1341 var store = createStore.apply(void 0, arguments); |
|
1342 |
|
1343 var _dispatch = function dispatch() { |
|
1344 throw new Error( true ? formatProdErrorMessage(15) : 0); |
|
1345 }; |
|
1346 |
|
1347 var middlewareAPI = { |
|
1348 getState: store.getState, |
|
1349 dispatch: function dispatch() { |
|
1350 return _dispatch.apply(void 0, arguments); |
|
1351 } |
|
1352 }; |
|
1353 var chain = middlewares.map(function (middleware) { |
|
1354 return middleware(middlewareAPI); |
|
1355 }); |
|
1356 _dispatch = compose.apply(void 0, chain)(store.dispatch); |
|
1357 return _objectSpread2(_objectSpread2({}, store), {}, { |
|
1358 dispatch: _dispatch |
|
1359 }); |
|
1360 }; |
968 }; |
1361 }; |
969 }; |
1362 } |
970 } |
1363 |
971 |
1364 |
972 // src/utils/isAction.ts |
1365 |
973 function isAction(action) { |
974 return isPlainObject(action) && "type" in action && typeof action.type === "string"; |
|
975 } |
|
976 |
|
977 //# sourceMappingURL=redux.mjs.map |
|
1366 // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js |
978 // EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js |
1367 var equivalent_key_map = __webpack_require__(3249); |
979 var equivalent_key_map = __webpack_require__(3249); |
1368 var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map); |
980 var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map); |
1369 ;// CONCATENATED MODULE: external ["wp","reduxRoutine"] |
981 ;// external ["wp","reduxRoutine"] |
1370 const external_wp_reduxRoutine_namespaceObject = window["wp"]["reduxRoutine"]; |
982 const external_wp_reduxRoutine_namespaceObject = window["wp"]["reduxRoutine"]; |
1371 var external_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_wp_reduxRoutine_namespaceObject); |
983 var external_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_wp_reduxRoutine_namespaceObject); |
1372 ;// CONCATENATED MODULE: external ["wp","compose"] |
984 ;// external ["wp","compose"] |
1373 const external_wp_compose_namespaceObject = window["wp"]["compose"]; |
985 const external_wp_compose_namespaceObject = window["wp"]["compose"]; |
1374 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/combine-reducers.js |
986 ;// ./node_modules/@wordpress/data/build-module/redux-store/combine-reducers.js |
1375 function combine_reducers_combineReducers(reducers) { |
987 function combine_reducers_combineReducers(reducers) { |
1376 const keys = Object.keys(reducers); |
988 const keys = Object.keys(reducers); |
1377 return function combinedReducer(state = {}, action) { |
989 return function combinedReducer(state = {}, action) { |
1378 const nextState = {}; |
990 const nextState = {}; |
1379 let hasChanged = false; |
991 let hasChanged = false; |
1386 } |
998 } |
1387 return hasChanged ? nextState : state; |
999 return hasChanged ? nextState : state; |
1388 }; |
1000 }; |
1389 } |
1001 } |
1390 |
1002 |
1391 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/factory.js |
1003 ;// ./node_modules/@wordpress/data/build-module/factory.js |
1004 /** |
|
1005 * Internal dependencies |
|
1006 */ |
|
1007 |
|
1392 /** |
1008 /** |
1393 * Creates a selector function that takes additional curried argument with the |
1009 * Creates a selector function that takes additional curried argument with the |
1394 * registry `select` function. While a regular selector has signature |
1010 * registry `select` function. While a regular selector has signature |
1395 * ```js |
1011 * ```js |
1396 * ( state, ...selectorArgs ) => ( result ) |
1012 * ( state, ...selectorArgs ) => ( result ) |
1422 * Note how the `getCurrentPostId` selector can be called just like any other function, |
1038 * Note how the `getCurrentPostId` selector can be called just like any other function, |
1423 * (it works even inside a regular non-registry selector) and we don't need to pass the |
1039 * (it works even inside a regular non-registry selector) and we don't need to pass the |
1424 * registry as argument. The registry binding happens automatically when registering the selector |
1040 * registry as argument. The registry binding happens automatically when registering the selector |
1425 * with a store. |
1041 * with a store. |
1426 * |
1042 * |
1427 * @param {Function} registrySelector Function receiving a registry `select` |
1043 * @param registrySelector Function receiving a registry `select` |
1428 * function and returning a state selector. |
1044 * function and returning a state selector. |
1429 * |
1045 * |
1430 * @return {Function} Registry selector that can be registered with a store. |
1046 * @return Registry selector that can be registered with a store. |
1431 */ |
1047 */ |
1432 function createRegistrySelector(registrySelector) { |
1048 function createRegistrySelector(registrySelector) { |
1433 const selectorsByRegistry = new WeakMap(); |
1049 const selectorsByRegistry = new WeakMap(); |
1434 // Create a selector function that is bound to the registry referenced by `selector.registry` |
1050 // Create a selector function that is bound to the registry referenced by `selector.registry` |
1435 // and that has the same API as a regular selector. Binding it in such a way makes it |
1051 // and that has the same API as a regular selector. Binding it in such a way makes it |
1449 |
1065 |
1450 /** |
1066 /** |
1451 * Flag indicating that the selector is a registry selector that needs the correct registry |
1067 * Flag indicating that the selector is a registry selector that needs the correct registry |
1452 * reference to be assigned to `selector.registry` to make it work correctly. |
1068 * reference to be assigned to `selector.registry` to make it work correctly. |
1453 * be mapped as a registry selector. |
1069 * be mapped as a registry selector. |
1454 * |
|
1455 * @type {boolean} |
|
1456 */ |
1070 */ |
1457 wrappedSelector.isRegistrySelector = true; |
1071 wrappedSelector.isRegistrySelector = true; |
1458 return wrappedSelector; |
1072 return wrappedSelector; |
1459 } |
1073 } |
1460 |
1074 |
1472 * store. |
1086 * store. |
1473 * |
1087 * |
1474 * When registering a control created with `createRegistryControl` with a store, the store |
1088 * When registering a control created with `createRegistryControl` with a store, the store |
1475 * knows which calling convention to use when executing the control. |
1089 * knows which calling convention to use when executing the control. |
1476 * |
1090 * |
1477 * @param {Function} registryControl Function receiving a registry object and returning a control. |
1091 * @param registryControl Function receiving a registry object and returning a control. |
1478 * |
1092 * |
1479 * @return {Function} Registry control that can be registered with a store. |
1093 * @return Registry control that can be registered with a store. |
1480 */ |
1094 */ |
1481 function createRegistryControl(registryControl) { |
1095 function createRegistryControl(registryControl) { |
1482 registryControl.isRegistryControl = true; |
1096 registryControl.isRegistryControl = true; |
1483 return registryControl; |
1097 return registryControl; |
1484 } |
1098 } |
1485 |
1099 |
1486 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/controls.js |
1100 ;// ./node_modules/@wordpress/data/build-module/controls.js |
1487 /** |
1101 /** |
1488 * Internal dependencies |
1102 * Internal dependencies |
1489 */ |
1103 */ |
1490 |
1104 |
1491 |
1105 |
1615 actionName, |
1229 actionName, |
1616 args |
1230 args |
1617 }) => registry.dispatch(storeKey)[actionName](...args)) |
1231 }) => registry.dispatch(storeKey)[actionName](...args)) |
1618 }; |
1232 }; |
1619 |
1233 |
1620 ;// CONCATENATED MODULE: external ["wp","privateApis"] |
1234 ;// external ["wp","privateApis"] |
1621 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; |
1235 const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; |
1622 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/lock-unlock.js |
1236 ;// ./node_modules/@wordpress/data/build-module/lock-unlock.js |
1623 /** |
1237 /** |
1624 * WordPress dependencies |
1238 * WordPress dependencies |
1625 */ |
1239 */ |
1626 |
1240 |
1627 const { |
1241 const { |
1628 lock, |
1242 lock, |
1629 unlock |
1243 unlock |
1630 } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/data'); |
1244 } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/data'); |
1631 |
1245 |
1632 ;// CONCATENATED MODULE: ./node_modules/is-promise/index.mjs |
1246 ;// ./node_modules/is-promise/index.mjs |
1633 function isPromise(obj) { |
1247 function isPromise(obj) { |
1634 return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; |
1248 return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; |
1635 } |
1249 } |
1636 |
1250 |
1637 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/promise-middleware.js |
1251 ;// ./node_modules/@wordpress/data/build-module/promise-middleware.js |
1638 /** |
1252 /** |
1639 * External dependencies |
1253 * External dependencies |
1640 */ |
1254 */ |
1641 |
1255 |
1642 |
1256 |
1655 } |
1269 } |
1656 return next(action); |
1270 return next(action); |
1657 }; |
1271 }; |
1658 /* harmony default export */ const promise_middleware = (promiseMiddleware); |
1272 /* harmony default export */ const promise_middleware = (promiseMiddleware); |
1659 |
1273 |
1660 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js |
1274 ;// ./node_modules/@wordpress/data/build-module/resolvers-cache-middleware.js |
1661 /** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */ |
1275 /** @typedef {import('./registry').WPDataRegistry} WPDataRegistry */ |
1662 |
1276 |
1663 /** |
1277 /** |
1664 * Creates a middleware handling resolvers cache invalidation. |
1278 * Creates a middleware handling resolvers cache invalidation. |
1665 * |
1279 * |
1699 }); |
1313 }); |
1700 return next(action); |
1314 return next(action); |
1701 }; |
1315 }; |
1702 /* harmony default export */ const resolvers_cache_middleware = (createResolversCacheMiddleware); |
1316 /* harmony default export */ const resolvers_cache_middleware = (createResolversCacheMiddleware); |
1703 |
1317 |
1704 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/thunk-middleware.js |
1318 ;// ./node_modules/@wordpress/data/build-module/redux-store/thunk-middleware.js |
1705 function createThunkMiddleware(args) { |
1319 function createThunkMiddleware(args) { |
1706 return () => next => action => { |
1320 return () => next => action => { |
1707 if (typeof action === 'function') { |
1321 if (typeof action === 'function') { |
1708 return action(args); |
1322 return action(args); |
1709 } |
1323 } |
1710 return next(action); |
1324 return next(action); |
1711 }; |
1325 }; |
1712 } |
1326 } |
1713 |
1327 |
1714 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/utils.js |
1328 ;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/utils.js |
1715 /** |
1329 /** |
1716 * External dependencies |
1330 * External dependencies |
1717 */ |
1331 */ |
1718 |
1332 |
1719 /** |
1333 /** |
1760 idx--; |
1374 idx--; |
1761 } |
1375 } |
1762 return idx === len ? args : args.slice(0, idx); |
1376 return idx === len ? args : args.slice(0, idx); |
1763 } |
1377 } |
1764 |
1378 |
1765 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/reducer.js |
1379 ;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/reducer.js |
1766 /** |
1380 /** |
1767 * External dependencies |
1381 * External dependencies |
1768 */ |
1382 */ |
1769 |
1383 |
1770 /** |
1384 /** |
1886 } |
1500 } |
1887 return state; |
1501 return state; |
1888 }; |
1502 }; |
1889 /* harmony default export */ const metadata_reducer = (isResolved); |
1503 /* harmony default export */ const metadata_reducer = (isResolved); |
1890 |
1504 |
1891 ;// CONCATENATED MODULE: ./node_modules/rememo/rememo.js |
1505 ;// ./node_modules/rememo/rememo.js |
1892 |
1506 |
1893 |
1507 |
1894 /** @typedef {(...args: any[]) => *[]} GetDependants */ |
1508 /** @typedef {(...args: any[]) => *[]} GetDependants */ |
1895 |
1509 |
1896 /** @typedef {() => void} Clear */ |
1510 /** @typedef {() => void} Clear */ |
2184 clear(); |
1798 clear(); |
2185 |
1799 |
2186 return /** @type {S & EnhancedSelector} */ (callSelector); |
1800 return /** @type {S & EnhancedSelector} */ (callSelector); |
2187 } |
1801 } |
2188 |
1802 |
2189 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js |
1803 ;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/selectors.js |
2190 /** |
1804 /** |
2191 * WordPress dependencies |
1805 * WordPress dependencies |
2192 */ |
1806 */ |
2193 |
1807 |
2194 |
1808 |
2379 selectorsByStatus[currentStatus]++; |
1993 selectorsByStatus[currentStatus]++; |
2380 })); |
1994 })); |
2381 return selectorsByStatus; |
1995 return selectorsByStatus; |
2382 }, state => [state]); |
1996 }, state => [state]); |
2383 |
1997 |
2384 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js |
1998 ;// ./node_modules/@wordpress/data/build-module/redux-store/metadata/actions.js |
2385 /** |
1999 /** |
2386 * Returns an action object used in signalling that selector resolution has |
2000 * Returns an action object used in signalling that selector resolution has |
2387 * started. |
2001 * started. |
2388 * |
2002 * |
2389 * @param {string} selectorName Name of selector for which resolver triggered. |
2003 * @param {string} selectorName Name of selector for which resolver triggered. |
2533 type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR', |
2147 type: 'INVALIDATE_RESOLUTION_FOR_STORE_SELECTOR', |
2534 selectorName |
2148 selectorName |
2535 }; |
2149 }; |
2536 } |
2150 } |
2537 |
2151 |
2538 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/index.js |
2152 ;// ./node_modules/@wordpress/data/build-module/redux-store/index.js |
2539 /** |
2153 /** |
2540 * External dependencies |
2154 * External dependencies |
2541 */ |
2155 */ |
2542 |
2156 |
2543 |
2157 |
2750 } |
2364 } |
2751 return selector(state.root, ...args); |
2365 return selector(state.root, ...args); |
2752 }; |
2366 }; |
2753 |
2367 |
2754 // Expose normalization method on the bound selector |
2368 // Expose normalization method on the bound selector |
2755 // in order that it can be called when fullfilling |
2369 // in order that it can be called when fulfilling |
2756 // the resolver. |
2370 // the resolver. |
2757 boundSelector.__unstableNormalizeArgs = selector.__unstableNormalizeArgs; |
2371 boundSelector.__unstableNormalizeArgs = selector.__unstableNormalizeArgs; |
2758 const resolver = resolvers[selectorName]; |
2372 const resolver = resolvers[selectorName]; |
2759 if (!resolver) { |
2373 if (!resolver) { |
2760 boundSelector.hasResolver = false; |
2374 boundSelector.hasResolver = false; |
3065 return selector.__unstableNormalizeArgs(args); |
2679 return selector.__unstableNormalizeArgs(args); |
3066 } |
2680 } |
3067 return args; |
2681 return args; |
3068 } |
2682 } |
3069 |
2683 |
3070 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js |
2684 ;// ./node_modules/@wordpress/data/build-module/store/index.js |
3071 const coreDataStore = { |
2685 const coreDataStore = { |
3072 name: 'core/data', |
2686 name: 'core/data', |
3073 instantiate(registry) { |
2687 instantiate(registry) { |
3074 const getCoreDataSelector = selectorName => (key, ...args) => { |
2688 const getCoreDataSelector = selectorName => (key, ...args) => { |
3075 return registry.select(key)[selectorName](...args); |
2689 return registry.select(key)[selectorName](...args); |
3094 }; |
2708 }; |
3095 } |
2709 } |
3096 }; |
2710 }; |
3097 /* harmony default export */ const store = (coreDataStore); |
2711 /* harmony default export */ const store = (coreDataStore); |
3098 |
2712 |
3099 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/utils/emitter.js |
2713 ;// ./node_modules/@wordpress/data/build-module/utils/emitter.js |
3100 /** |
2714 /** |
3101 * Create an event emitter. |
2715 * Create an event emitter. |
3102 * |
2716 * |
3103 * @return {import("../types").DataEmitter} Emitter. |
2717 * @return The event emitter. |
3104 */ |
2718 */ |
3105 function createEmitter() { |
2719 function createEmitter() { |
3106 let isPaused = false; |
2720 let isPaused = false; |
3107 let isPending = false; |
2721 let isPending = false; |
3108 const listeners = new Set(); |
2722 const listeners = new Set(); |
3137 notifyListeners(); |
2751 notifyListeners(); |
3138 } |
2752 } |
3139 }; |
2753 }; |
3140 } |
2754 } |
3141 |
2755 |
3142 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/registry.js |
2756 ;// ./node_modules/@wordpress/data/build-module/registry.js |
3143 /** |
2757 /** |
3144 * WordPress dependencies |
2758 * WordPress dependencies |
3145 */ |
2759 */ |
3146 |
2760 |
3147 |
2761 |
3187 /** |
2801 /** |
3188 * Creates a new store registry, given an optional object of initial store |
2802 * Creates a new store registry, given an optional object of initial store |
3189 * configurations. |
2803 * configurations. |
3190 * |
2804 * |
3191 * @param {Object} storeConfigs Initial store configurations. |
2805 * @param {Object} storeConfigs Initial store configurations. |
3192 * @param {Object?} parent Parent registry. |
2806 * @param {?Object} parent Parent registry. |
3193 * |
2807 * |
3194 * @return {WPDataRegistry} Data registry. |
2808 * @return {WPDataRegistry} Data registry. |
3195 */ |
2809 */ |
3196 function createRegistry(storeConfigs = {}, parent = null) { |
2810 function createRegistry(storeConfigs = {}, parent = null) { |
3197 const stores = {}; |
2811 const stores = {}; |
3498 } |
3112 } |
3499 }); |
3113 }); |
3500 return registryWithPlugins; |
3114 return registryWithPlugins; |
3501 } |
3115 } |
3502 |
3116 |
3503 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/default-registry.js |
3117 ;// ./node_modules/@wordpress/data/build-module/default-registry.js |
3504 /** |
3118 /** |
3505 * Internal dependencies |
3119 * Internal dependencies |
3506 */ |
3120 */ |
3507 |
3121 |
3508 /* harmony default export */ const default_registry = (createRegistry()); |
3122 /* harmony default export */ const default_registry = (createRegistry()); |
3509 |
3123 |
3510 ;// CONCATENATED MODULE: ./node_modules/is-plain-object/dist/is-plain-object.mjs |
3124 ;// ./node_modules/is-plain-object/dist/is-plain-object.mjs |
3511 /*! |
3125 /*! |
3512 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> |
3126 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> |
3513 * |
3127 * |
3514 * Copyright (c) 2014-2017, Jon Schlinkert. |
3128 * Copyright (c) 2014-2017, Jon Schlinkert. |
3515 * Released under the MIT License. |
3129 * Released under the MIT License. |
3544 |
3158 |
3545 |
3159 |
3546 // EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js |
3160 // EXTERNAL MODULE: ./node_modules/deepmerge/dist/cjs.js |
3547 var cjs = __webpack_require__(66); |
3161 var cjs = __webpack_require__(66); |
3548 var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs); |
3162 var cjs_default = /*#__PURE__*/__webpack_require__.n(cjs); |
3549 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js |
3163 ;// ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/object.js |
3550 let objectStorage; |
3164 let objectStorage; |
3551 const storage = { |
3165 const storage = { |
3552 getItem(key) { |
3166 getItem(key) { |
3553 if (!objectStorage || !objectStorage[key]) { |
3167 if (!objectStorage || !objectStorage[key]) { |
3554 return null; |
3168 return null; |
3565 objectStorage = Object.create(null); |
3179 objectStorage = Object.create(null); |
3566 } |
3180 } |
3567 }; |
3181 }; |
3568 /* harmony default export */ const object = (storage); |
3182 /* harmony default export */ const object = (storage); |
3569 |
3183 |
3570 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js |
3184 ;// ./node_modules/@wordpress/data/build-module/plugins/persistence/storage/default.js |
3571 /** |
3185 /** |
3572 * Internal dependencies |
3186 * Internal dependencies |
3573 */ |
3187 */ |
3574 |
3188 |
3575 let default_storage; |
3189 let default_storage; |
3583 } catch (error) { |
3197 } catch (error) { |
3584 default_storage = object; |
3198 default_storage = object; |
3585 } |
3199 } |
3586 /* harmony default export */ const storage_default = (default_storage); |
3200 /* harmony default export */ const storage_default = (default_storage); |
3587 |
3201 |
3588 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js |
3202 ;// ./node_modules/@wordpress/data/build-module/plugins/persistence/index.js |
3589 /** |
3203 /** |
3590 * External dependencies |
3204 * External dependencies |
3591 */ |
3205 */ |
3592 |
3206 |
3593 |
3207 |
3787 }; |
3401 }; |
3788 } |
3402 } |
3789 persistencePlugin.__unstableMigrate = () => {}; |
3403 persistencePlugin.__unstableMigrate = () => {}; |
3790 /* harmony default export */ const persistence = (persistencePlugin); |
3404 /* harmony default export */ const persistence = (persistencePlugin); |
3791 |
3405 |
3792 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/plugins/index.js |
3406 ;// ./node_modules/@wordpress/data/build-module/plugins/index.js |
3793 |
3407 |
3794 |
3408 |
3795 ;// CONCATENATED MODULE: external ["wp","priorityQueue"] |
3409 ;// external ["wp","priorityQueue"] |
3796 const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"]; |
3410 const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"]; |
3797 ;// CONCATENATED MODULE: external ["wp","element"] |
3411 ;// external ["wp","element"] |
3798 const external_wp_element_namespaceObject = window["wp"]["element"]; |
3412 const external_wp_element_namespaceObject = window["wp"]["element"]; |
3799 ;// CONCATENATED MODULE: external ["wp","isShallowEqual"] |
3413 ;// external ["wp","isShallowEqual"] |
3800 const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; |
3414 const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; |
3801 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); |
3415 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); |
3802 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js |
3416 ;// ./node_modules/@wordpress/data/build-module/components/registry-provider/context.js |
3803 /** |
3417 /** |
3804 * WordPress dependencies |
3418 * WordPress dependencies |
3805 */ |
3419 */ |
3806 |
3420 |
3807 |
3421 |
3818 /** |
3432 /** |
3819 * A custom react Context consumer exposing the provided `registry` to |
3433 * A custom react Context consumer exposing the provided `registry` to |
3820 * children components. Used along with the RegistryProvider. |
3434 * children components. Used along with the RegistryProvider. |
3821 * |
3435 * |
3822 * You can read more about the react context api here: |
3436 * You can read more about the react context api here: |
3823 * https://reactjs.org/docs/context.html#contextprovider |
3437 * https://react.dev/learn/passing-data-deeply-with-context#step-3-provide-the-context |
3824 * |
3438 * |
3825 * @example |
3439 * @example |
3826 * ```js |
3440 * ```js |
3827 * import { |
3441 * import { |
3828 * RegistryProvider, |
3442 * RegistryProvider, |
3855 * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for |
3469 * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for |
3856 * example. |
3470 * example. |
3857 */ |
3471 */ |
3858 /* harmony default export */ const context = (Provider); |
3472 /* harmony default export */ const context = (Provider); |
3859 |
3473 |
3860 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js |
3474 ;// ./node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js |
3861 /** |
3475 /** |
3862 * WordPress dependencies |
3476 * WordPress dependencies |
3863 */ |
3477 */ |
3864 |
3478 |
3865 |
3479 |
3909 */ |
3523 */ |
3910 function useRegistry() { |
3524 function useRegistry() { |
3911 return (0,external_wp_element_namespaceObject.useContext)(Context); |
3525 return (0,external_wp_element_namespaceObject.useContext)(Context); |
3912 } |
3526 } |
3913 |
3527 |
3914 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js |
3528 ;// ./node_modules/@wordpress/data/build-module/components/async-mode-provider/context.js |
3915 /** |
3529 /** |
3916 * WordPress dependencies |
3530 * WordPress dependencies |
3917 */ |
3531 */ |
3918 |
3532 |
3919 const context_Context = (0,external_wp_element_namespaceObject.createContext)(false); |
3533 const context_Context = (0,external_wp_element_namespaceObject.createContext)(false); |
3958 * @param {boolean} props.value Enable Async Mode. |
3572 * @param {boolean} props.value Enable Async Mode. |
3959 * @return {Component} The component to be rendered. |
3573 * @return {Component} The component to be rendered. |
3960 */ |
3574 */ |
3961 /* harmony default export */ const async_mode_provider_context = (context_Provider); |
3575 /* harmony default export */ const async_mode_provider_context = (context_Provider); |
3962 |
3576 |
3963 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js |
3577 ;// ./node_modules/@wordpress/data/build-module/components/async-mode-provider/use-async-mode.js |
3964 /** |
3578 /** |
3965 * WordPress dependencies |
3579 * WordPress dependencies |
3966 */ |
3580 */ |
3967 |
3581 |
3968 |
3582 |
3972 |
3586 |
3973 function useAsyncMode() { |
3587 function useAsyncMode() { |
3974 return (0,external_wp_element_namespaceObject.useContext)(context_Context); |
3588 return (0,external_wp_element_namespaceObject.useContext)(context_Context); |
3975 } |
3589 } |
3976 |
3590 |
3977 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-select/index.js |
3591 ;// ./node_modules/@wordpress/data/build-module/components/use-select/index.js |
3978 /** |
3592 /** |
3979 * WordPress dependencies |
3593 * WordPress dependencies |
3980 */ |
3594 */ |
3981 |
3595 |
3982 |
3596 |
3986 * Internal dependencies |
3600 * Internal dependencies |
3987 */ |
3601 */ |
3988 |
3602 |
3989 |
3603 |
3990 const renderQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)(); |
3604 const renderQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)(); |
3605 function warnOnUnstableReference(a, b) { |
|
3606 if (!a || !b) { |
|
3607 return; |
|
3608 } |
|
3609 const keys = typeof a === 'object' && typeof b === 'object' ? Object.keys(a).filter(k => a[k] !== b[k]) : []; |
|
3610 |
|
3611 // eslint-disable-next-line no-console |
|
3612 console.warn('The `useSelect` hook returns different values when called with the same state and parameters.\n' + 'This can lead to unnecessary re-renders and performance issues if not fixed.\n\n' + 'Non-equal value keys: %s\n\n', keys.join(', ')); |
|
3613 } |
|
3991 |
3614 |
3992 /** |
3615 /** |
3993 * @typedef {import('../../types').StoreDescriptor<C>} StoreDescriptor |
3616 * @typedef {import('../../types').StoreDescriptor<C>} StoreDescriptor |
3994 * @template {import('../../types').AnyConfig} C |
3617 * @template {import('../../types').AnyConfig} C |
3995 */ |
3618 */ |
4109 } |
3732 } |
4110 const listeningStores = { |
3733 const listeningStores = { |
4111 current: null |
3734 current: null |
4112 }; |
3735 }; |
4113 const mapResult = registry.__unstableMarkListeningStores(() => mapSelect(select, registry), listeningStores); |
3736 const mapResult = registry.__unstableMarkListeningStores(() => mapSelect(select, registry), listeningStores); |
4114 if (false) {} |
3737 if (true) { |
3738 if (!didWarnUnstableReference) { |
|
3739 const secondMapResult = mapSelect(select, registry); |
|
3740 if (!external_wp_isShallowEqual_default()(mapResult, secondMapResult)) { |
|
3741 warnOnUnstableReference(mapResult, secondMapResult); |
|
3742 didWarnUnstableReference = true; |
|
3743 } |
|
3744 } |
|
3745 } |
|
4115 if (!subscriber) { |
3746 if (!subscriber) { |
4116 for (const name of listeningStores.current) { |
3747 for (const name of listeningStores.current) { |
4117 storeStatesOnMount.set(name, getStoreState(name)); |
3748 storeStatesOnMount.set(name, getStoreState(name)); |
4118 } |
3749 } |
4119 subscriber = createSubscriber(listeningStores.current); |
3750 subscriber = createSubscriber(listeningStores.current); |
4150 subscribe: subscriber.subscribe, |
3781 subscribe: subscriber.subscribe, |
4151 getValue |
3782 getValue |
4152 }; |
3783 }; |
4153 }; |
3784 }; |
4154 } |
3785 } |
4155 function useStaticSelect(storeName) { |
3786 function _useStaticSelect(storeName) { |
4156 return useRegistry().select(storeName); |
3787 return useRegistry().select(storeName); |
4157 } |
3788 } |
4158 function useMappingSelect(suspense, mapSelect, deps) { |
3789 function _useMappingSelect(suspense, mapSelect, deps) { |
4159 const registry = useRegistry(); |
3790 const registry = useRegistry(); |
4160 const isAsync = useAsyncMode(); |
3791 const isAsync = useAsyncMode(); |
4161 const store = (0,external_wp_element_namespaceObject.useMemo)(() => Store(registry, suspense), [registry, suspense]); |
3792 const store = (0,external_wp_element_namespaceObject.useMemo)(() => Store(registry, suspense), [registry, suspense]); |
4162 |
3793 |
4163 // These are "pass-through" dependencies from the parent hook, |
3794 // These are "pass-through" dependencies from the parent hook, |
4164 // and the parent should catch any hook rule violations. |
3795 // and the parent should catch any hook rule violations. |
4165 // eslint-disable-next-line react-hooks/exhaustive-deps |
|
4166 const selector = (0,external_wp_element_namespaceObject.useCallback)(mapSelect, deps); |
3796 const selector = (0,external_wp_element_namespaceObject.useCallback)(mapSelect, deps); |
4167 const { |
3797 const { |
4168 subscribe, |
3798 subscribe, |
4169 getValue |
3799 getValue |
4170 } = store(selector, isAsync); |
3800 } = store(selector, isAsync); |
4175 |
3805 |
4176 /** |
3806 /** |
4177 * Custom react hook for retrieving props from registered selectors. |
3807 * Custom react hook for retrieving props from registered selectors. |
4178 * |
3808 * |
4179 * In general, this custom React hook follows the |
3809 * In general, this custom React hook follows the |
4180 * [rules of hooks](https://reactjs.org/docs/hooks-rules.html). |
3810 * [rules of hooks](https://react.dev/reference/rules/rules-of-hooks). |
4181 * |
3811 * |
4182 * @template {MapSelect | StoreDescriptor<any>} T |
3812 * @template {MapSelect | StoreDescriptor<any>} T |
4183 * @param {T} mapSelect Function called on every state change. The returned value is |
3813 * @param {T} mapSelect Function called on every state change. The returned value is |
4184 * exposed to the component implementing this hook. The function |
3814 * exposed to the component implementing this hook. The function |
4185 * receives the `registry.select` method on the first argument |
3815 * receives the `registry.select` method on the first argument |
4246 const prevMode = staticSelectModeRef.current ? 'static' : 'mapping'; |
3876 const prevMode = staticSelectModeRef.current ? 'static' : 'mapping'; |
4247 const nextMode = staticSelectMode ? 'static' : 'mapping'; |
3877 const nextMode = staticSelectMode ? 'static' : 'mapping'; |
4248 throw new Error(`Switching useSelect from ${prevMode} to ${nextMode} is not allowed`); |
3878 throw new Error(`Switching useSelect from ${prevMode} to ${nextMode} is not allowed`); |
4249 } |
3879 } |
4250 |
3880 |
4251 /* eslint-disable react-hooks/rules-of-hooks */ |
|
4252 // `staticSelectMode` is not allowed to change during the hook instance's, |
3881 // `staticSelectMode` is not allowed to change during the hook instance's, |
4253 // lifetime, so the rules of hooks are not really violated. |
3882 // lifetime, so the rules of hooks are not really violated. |
4254 return staticSelectMode ? useStaticSelect(mapSelect) : useMappingSelect(false, mapSelect, deps); |
3883 return staticSelectMode ? _useStaticSelect(mapSelect) : _useMappingSelect(false, mapSelect, deps); |
4255 /* eslint-enable react-hooks/rules-of-hooks */ |
|
4256 } |
3884 } |
4257 |
3885 |
4258 /** |
3886 /** |
4259 * A variant of the `useSelect` hook that has the same API, but is a compatible |
3887 * A variant of the `useSelect` hook that has the same API, but is a compatible |
4260 * Suspense-enabled data source. |
3888 * Suspense-enabled data source. |
4273 * selectors is in an unresolved state. |
3901 * selectors is in an unresolved state. |
4274 * |
3902 * |
4275 * @return {ReturnType<T>} Data object returned by the `mapSelect` function. |
3903 * @return {ReturnType<T>} Data object returned by the `mapSelect` function. |
4276 */ |
3904 */ |
4277 function useSuspenseSelect(mapSelect, deps) { |
3905 function useSuspenseSelect(mapSelect, deps) { |
4278 return useMappingSelect(true, mapSelect, deps); |
3906 return _useMappingSelect(true, mapSelect, deps); |
4279 } |
3907 } |
4280 |
3908 |
4281 ;// CONCATENATED MODULE: external "ReactJSXRuntime" |
3909 ;// external "ReactJSXRuntime" |
4282 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
3910 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; |
4283 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-select/index.js |
3911 ;// ./node_modules/@wordpress/data/build-module/components/with-select/index.js |
4284 /** |
3912 /** |
4285 * WordPress dependencies |
3913 * WordPress dependencies |
4286 */ |
3914 */ |
4287 |
3915 |
4288 |
3916 |
4342 ...mergeProps |
3970 ...mergeProps |
4343 }); |
3971 }); |
4344 }), 'withSelect'); |
3972 }), 'withSelect'); |
4345 /* harmony default export */ const with_select = (withSelect); |
3973 /* harmony default export */ const with_select = (withSelect); |
4346 |
3974 |
4347 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js |
3975 ;// ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch-with-map.js |
4348 /** |
3976 /** |
4349 * WordPress dependencies |
3977 * WordPress dependencies |
4350 */ |
3978 */ |
4351 |
3979 |
4352 |
3980 |
4370 * @return {Object} An object mapping props to functions created by the passed |
3998 * @return {Object} An object mapping props to functions created by the passed |
4371 * in dispatchMap. |
3999 * in dispatchMap. |
4372 */ |
4000 */ |
4373 const useDispatchWithMap = (dispatchMap, deps) => { |
4001 const useDispatchWithMap = (dispatchMap, deps) => { |
4374 const registry = useRegistry(); |
4002 const registry = useRegistry(); |
4375 const currentDispatchMap = (0,external_wp_element_namespaceObject.useRef)(dispatchMap); |
4003 const currentDispatchMapRef = (0,external_wp_element_namespaceObject.useRef)(dispatchMap); |
4376 (0,external_wp_compose_namespaceObject.useIsomorphicLayoutEffect)(() => { |
4004 (0,external_wp_compose_namespaceObject.useIsomorphicLayoutEffect)(() => { |
4377 currentDispatchMap.current = dispatchMap; |
4005 currentDispatchMapRef.current = dispatchMap; |
4378 }); |
4006 }); |
4379 return (0,external_wp_element_namespaceObject.useMemo)(() => { |
4007 return (0,external_wp_element_namespaceObject.useMemo)(() => { |
4380 const currentDispatchProps = currentDispatchMap.current(registry.dispatch, registry); |
4008 const currentDispatchProps = currentDispatchMapRef.current(registry.dispatch, registry); |
4381 return Object.fromEntries(Object.entries(currentDispatchProps).map(([propName, dispatcher]) => { |
4009 return Object.fromEntries(Object.entries(currentDispatchProps).map(([propName, dispatcher]) => { |
4382 if (typeof dispatcher !== 'function') { |
4010 if (typeof dispatcher !== 'function') { |
4383 // eslint-disable-next-line no-console |
4011 // eslint-disable-next-line no-console |
4384 console.warn(`Property ${propName} returned from dispatchMap in useDispatchWithMap must be a function.`); |
4012 console.warn(`Property ${propName} returned from dispatchMap in useDispatchWithMap must be a function.`); |
4385 } |
4013 } |
4386 return [propName, (...args) => currentDispatchMap.current(registry.dispatch, registry)[propName](...args)]; |
4014 return [propName, (...args) => currentDispatchMapRef.current(registry.dispatch, registry)[propName](...args)]; |
4387 })); |
4015 })); |
4388 }, [registry, ...deps]); |
4016 }, [registry, ...deps]); |
4389 }; |
4017 }; |
4390 /* harmony default export */ const use_dispatch_with_map = (useDispatchWithMap); |
4018 /* harmony default export */ const use_dispatch_with_map = (useDispatchWithMap); |
4391 |
4019 |
4392 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js |
4020 ;// ./node_modules/@wordpress/data/build-module/components/with-dispatch/index.js |
4393 /** |
4021 /** |
4394 * WordPress dependencies |
4022 * WordPress dependencies |
4395 */ |
4023 */ |
4396 |
4024 |
4397 |
4025 |
4492 ...dispatchProps |
4120 ...dispatchProps |
4493 }); |
4121 }); |
4494 }, 'withDispatch'); |
4122 }, 'withDispatch'); |
4495 /* harmony default export */ const with_dispatch = (withDispatch); |
4123 /* harmony default export */ const with_dispatch = (withDispatch); |
4496 |
4124 |
4497 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/with-registry/index.js |
4125 ;// ./node_modules/@wordpress/data/build-module/components/with-registry/index.js |
4498 /** |
4126 /** |
4499 * WordPress dependencies |
4127 * WordPress dependencies |
4500 */ |
4128 */ |
4501 |
4129 |
4502 |
4130 |
4520 registry: registry |
4148 registry: registry |
4521 }) |
4149 }) |
4522 }), 'withRegistry'); |
4150 }), 'withRegistry'); |
4523 /* harmony default export */ const with_registry = (withRegistry); |
4151 /* harmony default export */ const with_registry = (withRegistry); |
4524 |
4152 |
4525 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js |
4153 ;// ./node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js |
4526 /** |
4154 /** |
4527 * Internal dependencies |
4155 * Internal dependencies |
4528 */ |
4156 */ |
4529 |
4157 |
4530 |
4158 |
4589 } = useRegistry(); |
4217 } = useRegistry(); |
4590 return storeNameOrDescriptor === void 0 ? dispatch : dispatch(storeNameOrDescriptor); |
4218 return storeNameOrDescriptor === void 0 ? dispatch : dispatch(storeNameOrDescriptor); |
4591 }; |
4219 }; |
4592 /* harmony default export */ const use_dispatch = (useDispatch); |
4220 /* harmony default export */ const use_dispatch = (useDispatch); |
4593 |
4221 |
4594 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/dispatch.js |
4222 ;// ./node_modules/@wordpress/data/build-module/dispatch.js |
4595 /** |
4223 /** |
4596 * Internal dependencies |
4224 * Internal dependencies |
4597 */ |
4225 */ |
4598 |
4226 |
4599 |
4227 |
4619 */ |
4247 */ |
4620 function dispatch_dispatch(storeNameOrDescriptor) { |
4248 function dispatch_dispatch(storeNameOrDescriptor) { |
4621 return default_registry.dispatch(storeNameOrDescriptor); |
4249 return default_registry.dispatch(storeNameOrDescriptor); |
4622 } |
4250 } |
4623 |
4251 |
4624 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/select.js |
4252 ;// ./node_modules/@wordpress/data/build-module/select.js |
4625 /** |
4253 /** |
4626 * Internal dependencies |
4254 * Internal dependencies |
4627 */ |
4255 */ |
4628 |
4256 |
4629 |
4257 |
4649 */ |
4277 */ |
4650 function select_select(storeNameOrDescriptor) { |
4278 function select_select(storeNameOrDescriptor) { |
4651 return default_registry.select(storeNameOrDescriptor); |
4279 return default_registry.select(storeNameOrDescriptor); |
4652 } |
4280 } |
4653 |
4281 |
4654 ;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/index.js |
4282 ;// ./node_modules/@wordpress/data/build-module/index.js |
4655 /** |
4283 /** |
4656 * Internal dependencies |
4284 * Internal dependencies |
4657 */ |
4285 */ |
4658 |
4286 |
4659 |
4287 |
4835 * |
4463 * |
4836 * @param {StoreDescriptor} store Store descriptor. |
4464 * @param {StoreDescriptor} store Store descriptor. |
4837 */ |
4465 */ |
4838 const register = default_registry.register; |
4466 const register = default_registry.register; |
4839 |
4467 |
4840 })(); |
|
4841 |
|
4842 (window.wp = window.wp || {}).data = __webpack_exports__; |
4468 (window.wp = window.wp || {}).data = __webpack_exports__; |
4843 /******/ })() |
4469 /******/ })() |
4844 ; |
4470 ; |