2024-01-31 07:59:56 -05:00
|
|
|
/******/ (() => { // webpackBootstrap
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ "use strict";
|
|
|
|
/******/ // The require scope
|
|
|
|
/******/ var __webpack_require__ = {};
|
|
|
|
/******/
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ /* webpack/runtime/compat get default export */
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ (() => {
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ __webpack_require__.n = (module) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ var getter = module && module.__esModule ?
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ () => (module['default']) :
|
|
|
|
/******/ () => (module);
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ __webpack_require__.d(getter, { a: getter });
|
|
|
|
/******/ return getter;
|
|
|
|
/******/ };
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ })();
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/define property getters */
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ (() => {
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ // define getter functions for harmony exports
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ __webpack_require__.d = (exports, definition) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ for(var key in definition) {
|
|
|
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
|
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
|
|
/******/ }
|
|
|
|
/******/ }
|
2018-12-13 23:41:57 -05:00
|
|
|
/******/ };
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ })();
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ (() => {
|
|
|
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
|
|
/******/ })();
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/make namespace object */
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ (() => {
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ // define __esModule on exports
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ __webpack_require__.r = (exports) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
|
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
/******/ }
|
|
|
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
|
/******/ };
|
2024-01-31 07:59:56 -05:00
|
|
|
/******/ })();
|
2022-04-11 08:04:30 -04:00
|
|
|
/******/
|
2018-12-13 23:41:57 -05:00
|
|
|
/************************************************************************/
|
2022-04-11 08:04:30 -04:00
|
|
|
var __webpack_exports__ = {};
|
2021-05-20 08:20:04 -04:00
|
|
|
// ESM COMPAT FLAG
|
|
|
|
__webpack_require__.r(__webpack_exports__);
|
2021-04-15 11:19:43 -04:00
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
// EXPORTS
|
2022-04-11 08:04:30 -04:00
|
|
|
__webpack_require__.d(__webpack_exports__, {
|
2024-01-31 07:59:56 -05:00
|
|
|
DotTip: () => (/* reexport */ dot_tip),
|
|
|
|
store: () => (/* reexport */ store)
|
2022-04-11 08:04:30 -04:00
|
|
|
});
|
2021-04-15 11:19:43 -04:00
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js
|
|
|
|
var actions_namespaceObject = {};
|
|
|
|
__webpack_require__.r(actions_namespaceObject);
|
2022-04-11 08:04:30 -04:00
|
|
|
__webpack_require__.d(actions_namespaceObject, {
|
2024-01-31 07:59:56 -05:00
|
|
|
disableTips: () => (disableTips),
|
|
|
|
dismissTip: () => (dismissTip),
|
|
|
|
enableTips: () => (enableTips),
|
|
|
|
triggerGuide: () => (triggerGuide)
|
2022-04-11 08:04:30 -04:00
|
|
|
});
|
2021-04-15 11:19:43 -04:00
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
// NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js
|
|
|
|
var selectors_namespaceObject = {};
|
|
|
|
__webpack_require__.r(selectors_namespaceObject);
|
2022-04-11 08:04:30 -04:00
|
|
|
__webpack_require__.d(selectors_namespaceObject, {
|
2024-01-31 07:59:56 -05:00
|
|
|
areTipsEnabled: () => (selectors_areTipsEnabled),
|
|
|
|
getAssociatedGuide: () => (getAssociatedGuide),
|
|
|
|
isTipVisible: () => (isTipVisible)
|
2022-04-11 08:04:30 -04:00
|
|
|
});
|
2021-01-27 21:04:13 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: external ["wp","deprecated"]
|
2024-01-31 07:59:56 -05:00
|
|
|
const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
|
2022-04-11 08:04:30 -04:00
|
|
|
var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
|
|
|
|
;// CONCATENATED MODULE: external ["wp","data"]
|
2024-01-31 07:59:56 -05:00
|
|
|
const external_wp_data_namespaceObject = window["wp"]["data"];
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/reducer.js
|
2021-01-27 21:04:13 -05:00
|
|
|
/**
|
|
|
|
* WordPress dependencies
|
|
|
|
*/
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
2021-11-08 09:29:21 -05:00
|
|
|
* @param {Array} state Current state.
|
2021-05-20 08:20:04 -04:00
|
|
|
* @param {Object} action Dispatched action.
|
|
|
|
*
|
|
|
|
* @return {Array} Updated state.
|
|
|
|
*/
|
2023-07-18 03:20:48 -04:00
|
|
|
function guides(state = [], action) {
|
2021-05-20 08:20:04 -04:00
|
|
|
switch (action.type) {
|
|
|
|
case 'TRIGGER_GUIDE':
|
|
|
|
return [...state, action.tipIds];
|
|
|
|
}
|
|
|
|
return state;
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
/**
|
|
|
|
* Reducer that tracks whether or not tips are globally enabled.
|
|
|
|
*
|
2021-11-08 09:29:21 -05:00
|
|
|
* @param {boolean} state Current state.
|
|
|
|
* @param {Object} action Dispatched action.
|
2021-05-20 08:20:04 -04:00
|
|
|
*
|
|
|
|
* @return {boolean} Updated state.
|
|
|
|
*/
|
2023-07-18 03:20:48 -04:00
|
|
|
function areTipsEnabled(state = true, action) {
|
2021-05-20 08:20:04 -04:00
|
|
|
switch (action.type) {
|
|
|
|
case 'DISABLE_TIPS':
|
|
|
|
return false;
|
|
|
|
case 'ENABLE_TIPS':
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return state;
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2021-05-20 08:20:04 -04:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2023-07-18 03:20:48 -04:00
|
|
|
function dismissedTips(state = {}, action) {
|
2021-05-20 08:20:04 -04:00
|
|
|
switch (action.type) {
|
|
|
|
case 'DISMISS_TIP':
|
2023-09-26 10:23:26 -04:00
|
|
|
return {
|
|
|
|
...state,
|
2021-05-20 08:20:04 -04:00
|
|
|
[action.id]: true
|
|
|
|
};
|
|
|
|
case 'ENABLE_TIPS':
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
return state;
|
|
|
|
}
|
2022-04-11 08:04:30 -04:00
|
|
|
const preferences = (0,external_wp_data_namespaceObject.combineReducers)({
|
2021-05-20 08:20:04 -04:00
|
|
|
areTipsEnabled,
|
|
|
|
dismissedTips
|
|
|
|
});
|
2024-01-31 07:59:56 -05:00
|
|
|
/* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
|
2021-05-20 08:20:04 -04:00
|
|
|
guides,
|
|
|
|
preferences
|
|
|
|
}));
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/actions.js
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
2021-05-20 08:20:04 -04:00
|
|
|
* Returns an action object that, when dispatched, presents a guide that takes
|
|
|
|
* the user through a series of tips step by step.
|
2020-01-03 08:17:24 -05:00
|
|
|
*
|
2021-05-20 08:20:04 -04:00
|
|
|
* @param {string[]} tipIds Which tips to show in the guide.
|
2018-12-17 22:14:52 -05:00
|
|
|
*
|
2021-05-20 08:20:04 -04:00
|
|
|
* @return {Object} Action object.
|
2018-12-17 22:14:52 -05:00
|
|
|
*/
|
2021-05-20 08:20:04 -04:00
|
|
|
function triggerGuide(tipIds) {
|
|
|
|
return {
|
|
|
|
type: 'TRIGGER_GUIDE',
|
|
|
|
tipIds
|
|
|
|
};
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
2021-05-20 08:20:04 -04:00
|
|
|
* Returns an action object that, when dispatched, dismisses the given tip. A
|
|
|
|
* dismissed tip will not show again.
|
2018-12-17 22:14:52 -05:00
|
|
|
*
|
2021-05-20 08:20:04 -04:00
|
|
|
* @param {string} id The tip to dismiss.
|
2019-10-15 11:37:08 -04:00
|
|
|
*
|
2021-05-20 08:20:04 -04:00
|
|
|
* @return {Object} Action object.
|
2018-12-17 22:14:52 -05:00
|
|
|
*/
|
2022-04-11 08:04:30 -04:00
|
|
|
function dismissTip(id) {
|
2021-05-20 08:20:04 -04:00
|
|
|
return {
|
|
|
|
type: 'DISMISS_TIP',
|
|
|
|
id
|
|
|
|
};
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2018-12-17 22:14:52 -05:00
|
|
|
/**
|
2021-05-20 08:20:04 -04:00
|
|
|
* Returns an action object that, when dispatched, prevents all tips from
|
|
|
|
* showing again.
|
2020-01-03 08:17:24 -05:00
|
|
|
*
|
2021-05-20 08:20:04 -04:00
|
|
|
* @return {Object} Action object.
|
2019-10-15 11:37:08 -04:00
|
|
|
*/
|
2022-04-11 08:04:30 -04:00
|
|
|
function disableTips() {
|
2021-05-20 08:20:04 -04:00
|
|
|
return {
|
|
|
|
type: 'DISABLE_TIPS'
|
|
|
|
};
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2019-10-15 11:37:08 -04:00
|
|
|
/**
|
2021-05-20 08:20:04 -04:00
|
|
|
* Returns an action object that, when dispatched, makes all tips show again.
|
2019-10-15 11:37:08 -04:00
|
|
|
*
|
2021-05-20 08:20:04 -04:00
|
|
|
* @return {Object} Action object.
|
2020-01-03 08:17:24 -05:00
|
|
|
*/
|
2021-05-20 08:20:04 -04:00
|
|
|
function enableTips() {
|
|
|
|
return {
|
|
|
|
type: 'ENABLE_TIPS'
|
|
|
|
};
|
2020-01-03 08:17:24 -05:00
|
|
|
}
|
2020-01-08 06:57:23 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/selectors.js
|
|
|
|
/**
|
2024-05-23 15:39:28 -04:00
|
|
|
* WordPress dependencies
|
2022-04-11 08:04:30 -04:00
|
|
|
*/
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2024-05-23 15:39:28 -04:00
|
|
|
const getAssociatedGuide = (0,external_wp_data_namespaceObject.createSelector)((state, tipId) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
for (const tipIds of state.guides) {
|
2022-09-20 11:43:29 -04:00
|
|
|
if (tipIds.includes(tipId)) {
|
|
|
|
const nonDismissedTips = tipIds.filter(tId => !Object.keys(state.preferences.dismissedTips).includes(tId));
|
2022-04-11 08:04:30 -04:00
|
|
|
const [currentTipId = null, nextTipId = null] = nonDismissedTips;
|
|
|
|
return {
|
|
|
|
tipIds,
|
|
|
|
currentTipId,
|
|
|
|
nextTipId
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}, state => [state.guides, state.preferences.dismissedTips]);
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
}
|
2023-07-18 03:20:48 -04:00
|
|
|
if (state.preferences.dismissedTips?.hasOwnProperty(tipId)) {
|
2022-04-11 08:04:30 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
const associatedGuide = getAssociatedGuide(state, tipId);
|
|
|
|
if (associatedGuide && associatedGuide.currentTipId !== tipId) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const STORE_NAME = 'core/nux';
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* Store definition for the nux namespace.
|
|
|
|
*
|
|
|
|
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
|
|
|
|
*
|
|
|
|
* @type {Object}
|
|
|
|
*/
|
|
|
|
const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
|
|
|
|
reducer: reducer,
|
|
|
|
actions: actions_namespaceObject,
|
|
|
|
selectors: selectors_namespaceObject,
|
|
|
|
persist: ['preferences']
|
2023-09-26 10:23:26 -04:00
|
|
|
});
|
2018-12-13 23:41:57 -05:00
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
// 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.
|
2022-04-11 08:04:30 -04:00
|
|
|
(0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, {
|
|
|
|
reducer: reducer,
|
|
|
|
actions: actions_namespaceObject,
|
|
|
|
selectors: selectors_namespaceObject,
|
|
|
|
persist: ['preferences']
|
|
|
|
});
|
2021-05-19 11:09:27 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: external ["wp","compose"]
|
2024-01-31 07:59:56 -05:00
|
|
|
const external_wp_compose_namespaceObject = window["wp"]["compose"];
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: external ["wp","components"]
|
2024-01-31 07:59:56 -05:00
|
|
|
const external_wp_components_namespaceObject = window["wp"]["components"];
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: external ["wp","i18n"]
|
2024-01-31 07:59:56 -05:00
|
|
|
const external_wp_i18n_namespaceObject = window["wp"]["i18n"];
|
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
|
|
|
;// CONCATENATED MODULE: external ["wp","element"]
|
2024-01-31 07:59:56 -05:00
|
|
|
const external_wp_element_namespaceObject = window["wp"]["element"];
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: external ["wp","primitives"]
|
2024-01-31 07:59:56 -05:00
|
|
|
const external_wp_primitives_namespaceObject = window["wp"]["primitives"];
|
2024-05-31 14:59:00 -04:00
|
|
|
;// CONCATENATED MODULE: external "ReactJSXRuntime"
|
|
|
|
const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
|
2020-01-22 17:06:21 -05:00
|
|
|
/**
|
|
|
|
* WordPress dependencies
|
|
|
|
*/
|
|
|
|
|
2024-05-31 14:59:00 -04:00
|
|
|
|
|
|
|
const close_close = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, {
|
2021-05-20 08:20:04 -04:00
|
|
|
xmlns: "http://www.w3.org/2000/svg",
|
2024-05-31 14:59:00 -04:00
|
|
|
viewBox: "0 0 24 24",
|
|
|
|
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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"
|
|
|
|
})
|
|
|
|
});
|
2024-01-31 07:59:56 -05:00
|
|
|
/* harmony default export */ const library_close = (close_close);
|
2020-01-22 17:06:21 -05:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
|
|
|
|
/**
|
|
|
|
* WordPress dependencies
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-26 10:23:26 -04:00
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
|
2024-05-31 14:59:00 -04:00
|
|
|
|
|
|
|
|
2022-04-11 08:04:30 -04:00
|
|
|
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();
|
|
|
|
}
|
2023-07-18 03:20:48 -04:00
|
|
|
function DotTip({
|
|
|
|
position = 'middle right',
|
|
|
|
children,
|
|
|
|
isVisible,
|
|
|
|
hasNextTip,
|
|
|
|
onDismiss,
|
|
|
|
onDisable
|
|
|
|
}) {
|
2022-04-11 08:04:30 -04:00
|
|
|
const anchorParent = (0,external_wp_element_namespaceObject.useRef)(null);
|
|
|
|
const onFocusOutsideCallback = (0,external_wp_element_namespaceObject.useCallback)(event => {
|
|
|
|
if (!anchorParent.current) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (anchorParent.current.contains(event.relatedTarget)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
onDisable();
|
|
|
|
}, [onDisable, anchorParent]);
|
|
|
|
if (!isVisible) {
|
|
|
|
return null;
|
|
|
|
}
|
2024-05-31 14:59:00 -04:00
|
|
|
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Popover, {
|
2022-04-11 08:04:30 -04:00
|
|
|
className: "nux-dot-tip",
|
|
|
|
position: position,
|
2022-09-20 11:43:29 -04:00
|
|
|
focusOnMount: true,
|
2022-04-11 08:04:30 -04:00
|
|
|
role: "dialog",
|
|
|
|
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Editor tips'),
|
|
|
|
onClick: onClick,
|
2024-05-31 14:59:00 -04:00
|
|
|
onFocusOutside: onFocusOutsideCallback,
|
|
|
|
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
|
|
|
children: children
|
|
|
|
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", {
|
|
|
|
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
|
|
|
variant: "link",
|
|
|
|
onClick: onDismiss,
|
|
|
|
children: hasNextTip ? (0,external_wp_i18n_namespaceObject.__)('See next tip') : (0,external_wp_i18n_namespaceObject.__)('Got it')
|
|
|
|
})
|
|
|
|
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
|
|
|
|
className: "nux-dot-tip__disable",
|
|
|
|
icon: library_close,
|
|
|
|
label: (0,external_wp_i18n_namespaceObject.__)('Disable tips'),
|
|
|
|
onClick: onDisable
|
|
|
|
})]
|
|
|
|
});
|
2022-04-11 08:04:30 -04:00
|
|
|
}
|
2024-01-31 07:59:56 -05:00
|
|
|
/* harmony default export */ const dot_tip = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, {
|
2023-07-18 03:20:48 -04:00
|
|
|
tipId
|
|
|
|
}) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
const {
|
|
|
|
isTipVisible,
|
|
|
|
getAssociatedGuide
|
|
|
|
} = select(store);
|
|
|
|
const associatedGuide = getAssociatedGuide(tipId);
|
|
|
|
return {
|
|
|
|
isVisible: isTipVisible(tipId),
|
|
|
|
hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
|
|
|
|
};
|
2023-07-18 03:20:48 -04:00
|
|
|
}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, {
|
|
|
|
tipId
|
|
|
|
}) => {
|
2022-04-11 08:04:30 -04:00
|
|
|
const {
|
|
|
|
dismissTip,
|
|
|
|
disableTips
|
|
|
|
} = dispatch(store);
|
|
|
|
return {
|
|
|
|
onDismiss() {
|
|
|
|
dismissTip(tipId);
|
|
|
|
},
|
|
|
|
onDisable() {
|
|
|
|
disableTips();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}))(DotTip));
|
|
|
|
|
|
|
|
;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/index.js
|
|
|
|
/**
|
|
|
|
* WordPress dependencies
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
external_wp_deprecated_default()('wp.nux', {
|
|
|
|
since: '5.4',
|
2022-04-12 11:12:47 -04:00
|
|
|
hint: 'wp.components.Guide can be used to show a user guide.',
|
|
|
|
version: '6.2'
|
2022-04-11 08:04:30 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
(window.wp = window.wp || {}).nux = __webpack_exports__;
|
|
|
|
/******/ })()
|
|
|
|
;
|