--- a/wp/wp-includes/js/dist/nux.js Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-includes/js/dist/nux.js Wed Sep 21 18:19:35 2022 +0200
@@ -82,239 +82,470 @@
/******/
/******/
/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 458);
+/******/ return __webpack_require__(__webpack_require__.s = "51Wn");
/******/ })
/************************************************************************/
/******/ ({
-/***/ 0:
+/***/ "1ZqX":
/***/ (function(module, exports) {
-(function() { module.exports = this["wp"]["element"]; }());
+(function() { module.exports = window["wp"]["data"]; }());
/***/ }),
-/***/ 1:
-/***/ (function(module, exports) {
-
-(function() { module.exports = this["wp"]["i18n"]; }());
-
-/***/ }),
-
-/***/ 14:
+/***/ "51Wn":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
+// ESM COMPAT FLAG
+__webpack_require__.r(__webpack_exports__);
// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; });
+__webpack_require__.d(__webpack_exports__, "store", function() { return /* reexport */ store; });
+__webpack_require__.d(__webpack_exports__, "DotTip", function() { return /* reexport */ dot_tip; });
+
+// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js
+var actions_namespaceObject = {};
+__webpack_require__.r(actions_namespaceObject);
+__webpack_require__.d(actions_namespaceObject, "triggerGuide", function() { return triggerGuide; });
+__webpack_require__.d(actions_namespaceObject, "dismissTip", function() { return dismissTip; });
+__webpack_require__.d(actions_namespaceObject, "disableTips", function() { return disableTips; });
+__webpack_require__.d(actions_namespaceObject, "enableTips", function() { return enableTips; });
+
+// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js
+var selectors_namespaceObject = {};
+__webpack_require__.r(selectors_namespaceObject);
+__webpack_require__.d(selectors_namespaceObject, "getAssociatedGuide", function() { return getAssociatedGuide; });
+__webpack_require__.d(selectors_namespaceObject, "isTipVisible", function() { return isTipVisible; });
+__webpack_require__.d(selectors_namespaceObject, "areTipsEnabled", function() { return selectors_areTipsEnabled; });
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
-var arrayWithHoles = __webpack_require__(38);
+// EXTERNAL MODULE: external ["wp","deprecated"]
+var external_wp_deprecated_ = __webpack_require__("NMb1");
+var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_);
+
+// EXTERNAL MODULE: external ["wp","data"]
+var external_wp_data_ = __webpack_require__("1ZqX");
+
+// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/reducer.js
+/**
+ * WordPress dependencies
+ */
+
+/**
+ * Reducer that tracks which tips are in a guide. Each guide is represented by
+ * an array which contains the tip identifiers contained within that guide.
+ *
+ * @param {Array} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Array} Updated state.
+ */
-// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
-function _iterableToArrayLimit(arr, i) {
- if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
- var _arr = [];
- var _n = true;
- var _d = false;
- var _e = undefined;
+function guides(state = [], action) {
+ switch (action.type) {
+ case 'TRIGGER_GUIDE':
+ return [...state, action.tipIds];
+ }
+
+ return state;
+}
+/**
+ * Reducer that tracks whether or not tips are globally enabled.
+ *
+ * @param {boolean} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {boolean} Updated state.
+ */
+
+function areTipsEnabled(state = true, action) {
+ switch (action.type) {
+ case 'DISABLE_TIPS':
+ return false;
+
+ case 'ENABLE_TIPS':
+ return true;
+ }
+
+ return state;
+}
+/**
+ * Reducer that tracks which tips have been dismissed. If the state object
+ * contains a tip identifier, then that tip is dismissed.
+ *
+ * @param {Object} state Current state.
+ * @param {Object} action Dispatched action.
+ *
+ * @return {Object} Updated state.
+ */
+
+function dismissedTips(state = {}, action) {
+ switch (action.type) {
+ case 'DISMISS_TIP':
+ return { ...state,
+ [action.id]: true
+ };
+
+ case 'ENABLE_TIPS':
+ return {};
+ }
- try {
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value);
+ return state;
+}
+const preferences = Object(external_wp_data_["combineReducers"])({
+ areTipsEnabled,
+ dismissedTips
+});
+/* harmony default export */ var reducer = (Object(external_wp_data_["combineReducers"])({
+ guides,
+ preferences
+}));
+
+// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/actions.js
+/**
+ * Returns an action object that, when dispatched, presents a guide that takes
+ * the user through a series of tips step by step.
+ *
+ * @param {string[]} tipIds Which tips to show in the guide.
+ *
+ * @return {Object} Action object.
+ */
+function triggerGuide(tipIds) {
+ return {
+ type: 'TRIGGER_GUIDE',
+ tipIds
+ };
+}
+/**
+ * Returns an action object that, when dispatched, dismisses the given tip. A
+ * dismissed tip will not show again.
+ *
+ * @param {string} id The tip to dismiss.
+ *
+ * @return {Object} Action object.
+ */
+
+function dismissTip(id) {
+ return {
+ type: 'DISMISS_TIP',
+ id
+ };
+}
+/**
+ * Returns an action object that, when dispatched, prevents all tips from
+ * showing again.
+ *
+ * @return {Object} Action object.
+ */
- if (i && _arr.length === i) break;
- }
- } catch (err) {
- _d = true;
- _e = err;
- } finally {
- try {
- if (!_n && _i["return"] != null) _i["return"]();
- } finally {
- if (_d) throw _e;
+function disableTips() {
+ return {
+ type: 'DISABLE_TIPS'
+ };
+}
+/**
+ * Returns an action object that, when dispatched, makes all tips show again.
+ *
+ * @return {Object} Action object.
+ */
+
+function enableTips() {
+ return {
+ type: 'ENABLE_TIPS'
+ };
+}
+
+// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
+var rememo = __webpack_require__("pPDe");
+
+// EXTERNAL MODULE: external "lodash"
+var external_lodash_ = __webpack_require__("YLtl");
+
+// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/selectors.js
+/**
+ * External dependencies
+ */
+
+
+/**
+ * An object containing information about a guide.
+ *
+ * @typedef {Object} NUXGuideInfo
+ * @property {string[]} tipIds Which tips the guide contains.
+ * @property {?string} currentTipId The guide's currently showing tip.
+ * @property {?string} nextTipId The guide's next tip to show.
+ */
+
+/**
+ * Returns an object describing the guide, if any, that the given tip is a part
+ * of.
+ *
+ * @param {Object} state Global application state.
+ * @param {string} tipId The tip to query.
+ *
+ * @return {?NUXGuideInfo} Information about the associated guide.
+ */
+
+const getAssociatedGuide = Object(rememo["a" /* default */])((state, tipId) => {
+ for (const tipIds of state.guides) {
+ if (Object(external_lodash_["includes"])(tipIds, tipId)) {
+ const nonDismissedTips = Object(external_lodash_["difference"])(tipIds, Object(external_lodash_["keys"])(state.preferences.dismissedTips));
+ const [currentTipId = null, nextTipId = null] = nonDismissedTips;
+ return {
+ tipIds,
+ currentTipId,
+ nextTipId
+ };
}
}
- return _arr;
-}
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
-var unsupportedIterableToArray = __webpack_require__(29);
+ return null;
+}, state => [state.guides, state.preferences.dismissedTips]);
+/**
+ * Determines whether or not the given tip is showing. Tips are hidden if they
+ * are disabled, have been dismissed, or are not the current tip in any
+ * guide that they have been added to.
+ *
+ * @param {Object} state Global application state.
+ * @param {string} tipId The tip to query.
+ *
+ * @return {boolean} Whether or not the given tip is showing.
+ */
+
+function isTipVisible(state, tipId) {
+ if (!state.preferences.areTipsEnabled) {
+ return false;
+ }
+
+ if (Object(external_lodash_["has"])(state.preferences.dismissedTips, [tipId])) {
+ return false;
+ }
+
+ const associatedGuide = getAssociatedGuide(state, tipId);
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
-var nonIterableRest = __webpack_require__(39);
+ if (associatedGuide && associatedGuide.currentTipId !== tipId) {
+ return false;
+ }
-// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
+ return true;
+}
+/**
+ * Returns whether or not tips are globally enabled.
+ *
+ * @param {Object} state Global application state.
+ *
+ * @return {boolean} Whether tips are globally enabled.
+ */
+
+function selectors_areTipsEnabled(state) {
+ return state.preferences.areTipsEnabled;
+}
+
+// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/index.js
+/**
+ * WordPress dependencies
+ */
+
+/**
+ * Internal dependencies
+ */
-function _slicedToArray(arr, i) {
- return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])();
-}
+const STORE_NAME = 'core/nux';
+/**
+ * Store definition for the nux namespace.
+ *
+ * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
+ *
+ * @type {Object}
+ */
-/***/ }),
+const store = Object(external_wp_data_["createReduxStore"])(STORE_NAME, {
+ reducer: reducer,
+ actions: actions_namespaceObject,
+ selectors: selectors_namespaceObject,
+ persist: ['preferences']
+}); // Once we build a more generic persistence plugin that works across types of stores
+// we'd be able to replace this with a register call.
-/***/ 154:
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+Object(external_wp_data_["registerStore"])(STORE_NAME, {
+ reducer: reducer,
+ actions: actions_namespaceObject,
+ selectors: selectors_namespaceObject,
+ persist: ['preferences']
+});
+
+// EXTERNAL MODULE: external ["wp","element"]
+var external_wp_element_ = __webpack_require__("GRId");
-"use strict";
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
-/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
+// EXTERNAL MODULE: external ["wp","compose"]
+var external_wp_compose_ = __webpack_require__("K9lf");
+
+// EXTERNAL MODULE: external ["wp","components"]
+var external_wp_components_ = __webpack_require__("tI+e");
+
+// EXTERNAL MODULE: external ["wp","i18n"]
+var external_wp_i18n_ = __webpack_require__("l3Sj");
+
+// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
+var library_close = __webpack_require__("w95h");
+
+// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
/**
* WordPress dependencies
*/
-var close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
- xmlns: "http://www.w3.org/2000/svg",
- viewBox: "0 0 24 24"
-}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
- d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
-}));
-/* harmony default export */ __webpack_exports__["a"] = (close);
-/***/ }),
-
-/***/ 18:
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; });
-
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
-var arrayLikeToArray = __webpack_require__(26);
-
-// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
-
-function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr);
-}
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
-var iterableToArray = __webpack_require__(35);
-
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
-var unsupportedIterableToArray = __webpack_require__(29);
-
-// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
-function _nonIterableSpread() {
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
-// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
-function _toConsumableArray(arr) {
- return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread();
+function onClick(event) {
+ // Tips are often nested within buttons. We stop propagation so that clicking
+ // on a tip doesn't result in the button being clicked.
+ event.stopPropagation();
}
-/***/ }),
-
-/***/ 2:
-/***/ (function(module, exports) {
-
-(function() { module.exports = this["lodash"]; }());
-
-/***/ }),
+function DotTip({
+ position = 'middle right',
+ children,
+ isVisible,
+ hasNextTip,
+ onDismiss,
+ onDisable
+}) {
+ const anchorParent = Object(external_wp_element_["useRef"])(null);
+ const onFocusOutsideCallback = Object(external_wp_element_["useCallback"])(event => {
+ if (!anchorParent.current) {
+ return;
+ }
-/***/ 26:
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+ if (anchorParent.current.contains(event.relatedTarget)) {
+ return;
+ }
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; });
-function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length;
+ onDisable();
+ }, [onDisable, anchorParent]);
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i];
+ if (!isVisible) {
+ return null;
}
- return arr2;
+ return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], {
+ className: "nux-dot-tip",
+ position: position,
+ noArrow: true,
+ focusOnMount: "container",
+ shouldAnchorIncludePadding: true,
+ role: "dialog",
+ "aria-label": Object(external_wp_i18n_["__"])('Editor tips'),
+ onClick: onClick,
+ onFocusOutside: onFocusOutsideCallback
+ }, Object(external_wp_element_["createElement"])("p", null, children), Object(external_wp_element_["createElement"])("p", null, Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ isLink: true,
+ onClick: onDismiss
+ }, hasNextTip ? Object(external_wp_i18n_["__"])('See next tip') : Object(external_wp_i18n_["__"])('Got it'))), Object(external_wp_element_["createElement"])(external_wp_components_["Button"], {
+ className: "nux-dot-tip__disable",
+ icon: library_close["a" /* default */],
+ label: Object(external_wp_i18n_["__"])('Disable tips'),
+ onClick: onDisable
+ }));
}
-
-/***/ }),
-
-/***/ 29:
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/* harmony default export */ var dot_tip = (Object(external_wp_compose_["compose"])(Object(external_wp_data_["withSelect"])((select, {
+ tipId
+}) => {
+ const {
+ isTipVisible,
+ getAssociatedGuide
+ } = select('core/nux');
+ const associatedGuide = getAssociatedGuide(tipId);
+ return {
+ isVisible: isTipVisible(tipId),
+ hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
+ };
+}), Object(external_wp_data_["withDispatch"])((dispatch, {
+ tipId
+}) => {
+ const {
+ dismissTip,
+ disableTips
+ } = dispatch('core/nux');
+ return {
+ onDismiss() {
+ dismissTip(tipId);
+ },
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; });
-/* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
+ onDisable() {
+ disableTips();
+ }
+
+ };
+}))(DotTip));
-function _unsupportedIterableToArray(o, minLen) {
- if (!o) return;
- if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
- var n = Object.prototype.toString.call(o).slice(8, -1);
- if (n === "Object" && o.constructor) n = o.constructor.name;
- if (n === "Map" || n === "Set") return Array.from(o);
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen);
-}
+// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/index.js
+/**
+ * WordPress dependencies
+ */
+
+
+
+external_wp_deprecated_default()('wp.nux', {
+ since: '5.4',
+ hint: 'wp.components.Guide can be used to show a user guide.'
+});
+
/***/ }),
-/***/ 3:
+/***/ "GRId":
/***/ (function(module, exports) {
-(function() { module.exports = this["wp"]["components"]; }());
+(function() { module.exports = window["wp"]["element"]; }());
/***/ }),
-/***/ 35:
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ "K9lf":
+/***/ (function(module, exports) {
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; });
-function _iterableToArray(iter) {
- if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
-}
+(function() { module.exports = window["wp"]["compose"]; }());
/***/ }),
-/***/ 37:
+/***/ "NMb1":
/***/ (function(module, exports) {
-(function() { module.exports = this["wp"]["deprecated"]; }());
+(function() { module.exports = window["wp"]["deprecated"]; }());
/***/ }),
-/***/ 38:
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ "Tqx9":
+/***/ (function(module, exports) {
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; });
-function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr;
-}
+(function() { module.exports = window["wp"]["primitives"]; }());
/***/ }),
-/***/ 39:
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
+/***/ "YLtl":
+/***/ (function(module, exports) {
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; });
-function _nonIterableRest() {
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
-}
+(function() { module.exports = window["lodash"]; }());
/***/ }),
-/***/ 4:
+/***/ "l3Sj":
/***/ (function(module, exports) {
-(function() { module.exports = this["wp"]["data"]; }());
+(function() { module.exports = window["wp"]["i18n"]; }());
/***/ }),
-/***/ 42:
+/***/ "pPDe":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -596,482 +827,35 @@
/***/ }),
-/***/ 458:
+/***/ "tI+e":
+/***/ (function(module, exports) {
+
+(function() { module.exports = window["wp"]["components"]; }());
+
+/***/ }),
+
+/***/ "w95h":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
-// ESM COMPAT FLAG
-__webpack_require__.r(__webpack_exports__);
-
-// EXPORTS
-__webpack_require__.d(__webpack_exports__, "DotTip", function() { return /* reexport */ dot_tip; });
-
-// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js
-var actions_namespaceObject = {};
-__webpack_require__.r(actions_namespaceObject);
-__webpack_require__.d(actions_namespaceObject, "triggerGuide", function() { return triggerGuide; });
-__webpack_require__.d(actions_namespaceObject, "dismissTip", function() { return dismissTip; });
-__webpack_require__.d(actions_namespaceObject, "disableTips", function() { return disableTips; });
-__webpack_require__.d(actions_namespaceObject, "enableTips", function() { return enableTips; });
-
-// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js
-var selectors_namespaceObject = {};
-__webpack_require__.r(selectors_namespaceObject);
-__webpack_require__.d(selectors_namespaceObject, "getAssociatedGuide", function() { return getAssociatedGuide; });
-__webpack_require__.d(selectors_namespaceObject, "isTipVisible", function() { return isTipVisible; });
-__webpack_require__.d(selectors_namespaceObject, "areTipsEnabled", function() { return selectors_areTipsEnabled; });
-
-// EXTERNAL MODULE: external {"this":["wp","deprecated"]}
-var external_this_wp_deprecated_ = __webpack_require__(37);
-var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_);
-
-// EXTERNAL MODULE: external {"this":["wp","data"]}
-var external_this_wp_data_ = __webpack_require__(4);
-
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
-var defineProperty = __webpack_require__(5);
-
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules
-var toConsumableArray = __webpack_require__(18);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/reducer.js
-
-
-
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
-
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
-/**
- * WordPress dependencies
- */
-
-/**
- * Reducer that tracks which tips are in a guide. Each guide is represented by
- * an array which contains the tip identifiers contained within that guide.
- *
- * @param {Array} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {Array} Updated state.
- */
-
-function guides() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var action = arguments.length > 1 ? arguments[1] : undefined;
-
- switch (action.type) {
- case 'TRIGGER_GUIDE':
- return [].concat(Object(toConsumableArray["a" /* default */])(state), [action.tipIds]);
- }
-
- return state;
-}
-/**
- * Reducer that tracks whether or not tips are globally enabled.
- *
- * @param {boolean} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {boolean} Updated state.
- */
-
-function areTipsEnabled() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
- var action = arguments.length > 1 ? arguments[1] : undefined;
-
- switch (action.type) {
- case 'DISABLE_TIPS':
- return false;
-
- case 'ENABLE_TIPS':
- return true;
- }
-
- return state;
-}
-/**
- * Reducer that tracks which tips have been dismissed. If the state object
- * contains a tip identifier, then that tip is dismissed.
- *
- * @param {Object} state Current state.
- * @param {Object} action Dispatched action.
- *
- * @return {Object} Updated state.
- */
-
-function dismissedTips() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments.length > 1 ? arguments[1] : undefined;
-
- switch (action.type) {
- case 'DISMISS_TIP':
- return _objectSpread({}, state, Object(defineProperty["a" /* default */])({}, action.id, true));
-
- case 'ENABLE_TIPS':
- return {};
- }
-
- return state;
-}
-var preferences = Object(external_this_wp_data_["combineReducers"])({
- areTipsEnabled: areTipsEnabled,
- dismissedTips: dismissedTips
-});
-/* harmony default export */ var reducer = (Object(external_this_wp_data_["combineReducers"])({
- guides: guides,
- preferences: preferences
-}));
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/actions.js
-/**
- * Returns an action object that, when dispatched, presents a guide that takes
- * the user through a series of tips step by step.
- *
- * @param {string[]} tipIds Which tips to show in the guide.
- *
- * @return {Object} Action object.
- */
-function triggerGuide(tipIds) {
- return {
- type: 'TRIGGER_GUIDE',
- tipIds: tipIds
- };
-}
-/**
- * Returns an action object that, when dispatched, dismisses the given tip. A
- * dismissed tip will not show again.
- *
- * @param {string} id The tip to dismiss.
- *
- * @return {Object} Action object.
- */
-
-function dismissTip(id) {
- return {
- type: 'DISMISS_TIP',
- id: id
- };
-}
-/**
- * Returns an action object that, when dispatched, prevents all tips from
- * showing again.
- *
- * @return {Object} Action object.
- */
-
-function disableTips() {
- return {
- type: 'DISABLE_TIPS'
- };
-}
-/**
- * Returns an action object that, when dispatched, makes all tips show again.
- *
- * @return {Object} Action object.
- */
-
-function enableTips() {
- return {
- type: 'ENABLE_TIPS'
- };
-}
-
-// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
-var slicedToArray = __webpack_require__(14);
-
-// EXTERNAL MODULE: ./node_modules/rememo/es/rememo.js
-var rememo = __webpack_require__(42);
-
-// EXTERNAL MODULE: external {"this":"lodash"}
-var external_this_lodash_ = __webpack_require__(2);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/selectors.js
-
-
-function _createForOfIteratorHelper(o) { if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) { var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var it, normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
-
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
-
-/**
- * External dependencies
- */
-
-
-/**
- * An object containing information about a guide.
- *
- * @typedef {Object} NUXGuideInfo
- * @property {string[]} tipIds Which tips the guide contains.
- * @property {?string} currentTipId The guide's currently showing tip.
- * @property {?string} nextTipId The guide's next tip to show.
- */
-
-/**
- * Returns an object describing the guide, if any, that the given tip is a part
- * of.
- *
- * @param {Object} state Global application state.
- * @param {string} tipId The tip to query.
- *
- * @return {?NUXGuideInfo} Information about the associated guide.
- */
-
-var getAssociatedGuide = Object(rememo["a" /* default */])(function (state, tipId) {
- var _iterator = _createForOfIteratorHelper(state.guides),
- _step;
-
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var tipIds = _step.value;
-
- if (Object(external_this_lodash_["includes"])(tipIds, tipId)) {
- var nonDismissedTips = Object(external_this_lodash_["difference"])(tipIds, Object(external_this_lodash_["keys"])(state.preferences.dismissedTips));
-
- var _nonDismissedTips = Object(slicedToArray["a" /* default */])(nonDismissedTips, 2),
- _nonDismissedTips$ = _nonDismissedTips[0],
- currentTipId = _nonDismissedTips$ === void 0 ? null : _nonDismissedTips$,
- _nonDismissedTips$2 = _nonDismissedTips[1],
- nextTipId = _nonDismissedTips$2 === void 0 ? null : _nonDismissedTips$2;
-
- return {
- tipIds: tipIds,
- currentTipId: currentTipId,
- nextTipId: nextTipId
- };
- }
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
-
- return null;
-}, function (state) {
- return [state.guides, state.preferences.dismissedTips];
-});
-/**
- * Determines whether or not the given tip is showing. Tips are hidden if they
- * are disabled, have been dismissed, or are not the current tip in any
- * guide that they have been added to.
- *
- * @param {Object} state Global application state.
- * @param {string} tipId The tip to query.
- *
- * @return {boolean} Whether or not the given tip is showing.
- */
-
-function isTipVisible(state, tipId) {
- if (!state.preferences.areTipsEnabled) {
- return false;
- }
-
- if (Object(external_this_lodash_["has"])(state.preferences.dismissedTips, [tipId])) {
- return false;
- }
-
- var associatedGuide = getAssociatedGuide(state, tipId);
-
- if (associatedGuide && associatedGuide.currentTipId !== tipId) {
- return false;
- }
-
- return true;
-}
-/**
- * Returns whether or not tips are globally enabled.
- *
- * @param {Object} state Global application state.
- *
- * @return {boolean} Whether tips are globally enabled.
- */
-
-function selectors_areTipsEnabled(state) {
- return state.preferences.areTipsEnabled;
-}
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/index.js
-/**
- * WordPress dependencies
- */
-
-/**
- * Internal dependencies
- */
-
-
-
-
-var store = Object(external_this_wp_data_["registerStore"])('core/nux', {
- reducer: reducer,
- actions: actions_namespaceObject,
- selectors: selectors_namespaceObject,
- persist: ['preferences']
-});
-/* harmony default export */ var build_module_store = (store);
-
-// EXTERNAL MODULE: external {"this":["wp","element"]}
-var external_this_wp_element_ = __webpack_require__(0);
-
-// EXTERNAL MODULE: external {"this":["wp","compose"]}
-var external_this_wp_compose_ = __webpack_require__(9);
-
-// EXTERNAL MODULE: external {"this":["wp","components"]}
-var external_this_wp_components_ = __webpack_require__(3);
-
-// EXTERNAL MODULE: external {"this":["wp","i18n"]}
-var external_this_wp_i18n_ = __webpack_require__(1);
-
-// EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
-var library_close = __webpack_require__(154);
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("GRId");
+/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("Tqx9");
+/* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__);
/**
* WordPress dependencies
*/
-
-
-
-
-
-
-function onClick(event) {
- // Tips are often nested within buttons. We stop propagation so that clicking
- // on a tip doesn't result in the button being clicked.
- event.stopPropagation();
-}
-
-function DotTip(_ref) {
- var _ref$position = _ref.position,
- position = _ref$position === void 0 ? 'middle right' : _ref$position,
- children = _ref.children,
- isVisible = _ref.isVisible,
- hasNextTip = _ref.hasNextTip,
- onDismiss = _ref.onDismiss,
- onDisable = _ref.onDisable;
- var anchorParent = Object(external_this_wp_element_["useRef"])(null);
- var onFocusOutsideCallback = Object(external_this_wp_element_["useCallback"])(function (event) {
- if (!anchorParent.current) {
- return;
- }
-
- if (anchorParent.current.contains(event.relatedTarget)) {
- return;
- }
-
- onDisable();
- }, [onDisable, anchorParent]);
-
- if (!isVisible) {
- return null;
- }
-
- return Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Popover"], {
- className: "nux-dot-tip",
- position: position,
- noArrow: true,
- focusOnMount: "container",
- shouldAnchorIncludePadding: true,
- role: "dialog",
- "aria-label": Object(external_this_wp_i18n_["__"])('Editor tips'),
- onClick: onClick,
- onFocusOutside: onFocusOutsideCallback
- }, Object(external_this_wp_element_["createElement"])("p", null, children), Object(external_this_wp_element_["createElement"])("p", null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
- isLink: true,
- onClick: onDismiss
- }, hasNextTip ? Object(external_this_wp_i18n_["__"])('See next tip') : Object(external_this_wp_i18n_["__"])('Got it'))), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
- className: "nux-dot-tip__disable",
- icon: library_close["a" /* default */],
- label: Object(external_this_wp_i18n_["__"])('Disable tips'),
- onClick: onDisable
- }));
-}
-/* harmony default export */ var dot_tip = (Object(external_this_wp_compose_["compose"])(Object(external_this_wp_data_["withSelect"])(function (select, _ref2) {
- var tipId = _ref2.tipId;
-
- var _select = select('core/nux'),
- isTipVisible = _select.isTipVisible,
- getAssociatedGuide = _select.getAssociatedGuide;
+const close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], {
+ xmlns: "http://www.w3.org/2000/svg",
+ viewBox: "0 0 24 24"
+}, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], {
+ d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
+}));
+/* harmony default export */ __webpack_exports__["a"] = (close);
- var associatedGuide = getAssociatedGuide(tipId);
- return {
- isVisible: isTipVisible(tipId),
- hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
- };
-}), Object(external_this_wp_data_["withDispatch"])(function (dispatch, _ref3) {
- var tipId = _ref3.tipId;
-
- var _dispatch = dispatch('core/nux'),
- dismissTip = _dispatch.dismissTip,
- disableTips = _dispatch.disableTips;
-
- return {
- onDismiss: function onDismiss() {
- dismissTip(tipId);
- },
- onDisable: function onDisable() {
- disableTips();
- }
- };
-}))(DotTip));
-
-// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/index.js
-/**
- * WordPress dependencies
- */
-
-/**
- * Internal dependencies
- */
-
-
-
-external_this_wp_deprecated_default()('wp.nux', {
- hint: 'wp.components.Guide can be used to show a user guide.'
-});
-
-
-/***/ }),
-
-/***/ 5:
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; });
-function _defineProperty(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- } else {
- obj[key] = value;
- }
-
- return obj;
-}
-
-/***/ }),
-
-/***/ 6:
-/***/ (function(module, exports) {
-
-(function() { module.exports = this["wp"]["primitives"]; }());
-
-/***/ }),
-
-/***/ 9:
-/***/ (function(module, exports) {
-
-(function() { module.exports = this["wp"]["compose"]; }());
/***/ })