nux.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776
  1. /******/ (function() { // webpackBootstrap
  2. /******/ "use strict";
  3. /******/ // The require scope
  4. /******/ var __webpack_require__ = {};
  5. /******/
  6. /************************************************************************/
  7. /******/ /* webpack/runtime/compat get default export */
  8. /******/ !function() {
  9. /******/ // getDefaultExport function for compatibility with non-harmony modules
  10. /******/ __webpack_require__.n = function(module) {
  11. /******/ var getter = module && module.__esModule ?
  12. /******/ function() { return module['default']; } :
  13. /******/ function() { return module; };
  14. /******/ __webpack_require__.d(getter, { a: getter });
  15. /******/ return getter;
  16. /******/ };
  17. /******/ }();
  18. /******/
  19. /******/ /* webpack/runtime/define property getters */
  20. /******/ !function() {
  21. /******/ // define getter functions for harmony exports
  22. /******/ __webpack_require__.d = function(exports, definition) {
  23. /******/ for(var key in definition) {
  24. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  25. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  26. /******/ }
  27. /******/ }
  28. /******/ };
  29. /******/ }();
  30. /******/
  31. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  32. /******/ !function() {
  33. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  34. /******/ }();
  35. /******/
  36. /******/ /* webpack/runtime/make namespace object */
  37. /******/ !function() {
  38. /******/ // define __esModule on exports
  39. /******/ __webpack_require__.r = function(exports) {
  40. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  41. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  42. /******/ }
  43. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  44. /******/ };
  45. /******/ }();
  46. /******/
  47. /************************************************************************/
  48. var __webpack_exports__ = {};
  49. // ESM COMPAT FLAG
  50. __webpack_require__.r(__webpack_exports__);
  51. // EXPORTS
  52. __webpack_require__.d(__webpack_exports__, {
  53. "DotTip": function() { return /* reexport */ dot_tip; },
  54. "store": function() { return /* reexport */ store; }
  55. });
  56. // NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js
  57. var actions_namespaceObject = {};
  58. __webpack_require__.r(actions_namespaceObject);
  59. __webpack_require__.d(actions_namespaceObject, {
  60. "disableTips": function() { return disableTips; },
  61. "dismissTip": function() { return dismissTip; },
  62. "enableTips": function() { return enableTips; },
  63. "triggerGuide": function() { return triggerGuide; }
  64. });
  65. // NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js
  66. var selectors_namespaceObject = {};
  67. __webpack_require__.r(selectors_namespaceObject);
  68. __webpack_require__.d(selectors_namespaceObject, {
  69. "areTipsEnabled": function() { return selectors_areTipsEnabled; },
  70. "getAssociatedGuide": function() { return getAssociatedGuide; },
  71. "isTipVisible": function() { return isTipVisible; }
  72. });
  73. ;// CONCATENATED MODULE: external ["wp","deprecated"]
  74. var external_wp_deprecated_namespaceObject = window["wp"]["deprecated"];
  75. var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject);
  76. ;// CONCATENATED MODULE: external ["wp","data"]
  77. var external_wp_data_namespaceObject = window["wp"]["data"];
  78. ;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/reducer.js
  79. /**
  80. * WordPress dependencies
  81. */
  82. /**
  83. * Reducer that tracks which tips are in a guide. Each guide is represented by
  84. * an array which contains the tip identifiers contained within that guide.
  85. *
  86. * @param {Array} state Current state.
  87. * @param {Object} action Dispatched action.
  88. *
  89. * @return {Array} Updated state.
  90. */
  91. function guides() {
  92. let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  93. let action = arguments.length > 1 ? arguments[1] : undefined;
  94. switch (action.type) {
  95. case 'TRIGGER_GUIDE':
  96. return [...state, action.tipIds];
  97. }
  98. return state;
  99. }
  100. /**
  101. * Reducer that tracks whether or not tips are globally enabled.
  102. *
  103. * @param {boolean} state Current state.
  104. * @param {Object} action Dispatched action.
  105. *
  106. * @return {boolean} Updated state.
  107. */
  108. function areTipsEnabled() {
  109. let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  110. let action = arguments.length > 1 ? arguments[1] : undefined;
  111. switch (action.type) {
  112. case 'DISABLE_TIPS':
  113. return false;
  114. case 'ENABLE_TIPS':
  115. return true;
  116. }
  117. return state;
  118. }
  119. /**
  120. * Reducer that tracks which tips have been dismissed. If the state object
  121. * contains a tip identifier, then that tip is dismissed.
  122. *
  123. * @param {Object} state Current state.
  124. * @param {Object} action Dispatched action.
  125. *
  126. * @return {Object} Updated state.
  127. */
  128. function dismissedTips() {
  129. let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  130. let action = arguments.length > 1 ? arguments[1] : undefined;
  131. switch (action.type) {
  132. case 'DISMISS_TIP':
  133. return { ...state,
  134. [action.id]: true
  135. };
  136. case 'ENABLE_TIPS':
  137. return {};
  138. }
  139. return state;
  140. }
  141. const preferences = (0,external_wp_data_namespaceObject.combineReducers)({
  142. areTipsEnabled,
  143. dismissedTips
  144. });
  145. /* harmony default export */ var reducer = ((0,external_wp_data_namespaceObject.combineReducers)({
  146. guides,
  147. preferences
  148. }));
  149. ;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/actions.js
  150. /**
  151. * Returns an action object that, when dispatched, presents a guide that takes
  152. * the user through a series of tips step by step.
  153. *
  154. * @param {string[]} tipIds Which tips to show in the guide.
  155. *
  156. * @return {Object} Action object.
  157. */
  158. function triggerGuide(tipIds) {
  159. return {
  160. type: 'TRIGGER_GUIDE',
  161. tipIds
  162. };
  163. }
  164. /**
  165. * Returns an action object that, when dispatched, dismisses the given tip. A
  166. * dismissed tip will not show again.
  167. *
  168. * @param {string} id The tip to dismiss.
  169. *
  170. * @return {Object} Action object.
  171. */
  172. function dismissTip(id) {
  173. return {
  174. type: 'DISMISS_TIP',
  175. id
  176. };
  177. }
  178. /**
  179. * Returns an action object that, when dispatched, prevents all tips from
  180. * showing again.
  181. *
  182. * @return {Object} Action object.
  183. */
  184. function disableTips() {
  185. return {
  186. type: 'DISABLE_TIPS'
  187. };
  188. }
  189. /**
  190. * Returns an action object that, when dispatched, makes all tips show again.
  191. *
  192. * @return {Object} Action object.
  193. */
  194. function enableTips() {
  195. return {
  196. type: 'ENABLE_TIPS'
  197. };
  198. }
  199. ;// CONCATENATED MODULE: ./node_modules/rememo/rememo.js
  200. /** @typedef {(...args: any[]) => *[]} GetDependants */
  201. /** @typedef {() => void} Clear */
  202. /**
  203. * @typedef {{
  204. * getDependants: GetDependants,
  205. * clear: Clear
  206. * }} EnhancedSelector
  207. */
  208. /**
  209. * Internal cache entry.
  210. *
  211. * @typedef CacheNode
  212. *
  213. * @property {?CacheNode|undefined} [prev] Previous node.
  214. * @property {?CacheNode|undefined} [next] Next node.
  215. * @property {*[]} args Function arguments for cache entry.
  216. * @property {*} val Function result.
  217. */
  218. /**
  219. * @typedef Cache
  220. *
  221. * @property {Clear} clear Function to clear cache.
  222. * @property {boolean} [isUniqueByDependants] Whether dependants are valid in
  223. * considering cache uniqueness. A cache is unique if dependents are all arrays
  224. * or objects.
  225. * @property {CacheNode?} [head] Cache head.
  226. * @property {*[]} [lastDependants] Dependants from previous invocation.
  227. */
  228. /**
  229. * Arbitrary value used as key for referencing cache object in WeakMap tree.
  230. *
  231. * @type {{}}
  232. */
  233. var LEAF_KEY = {};
  234. /**
  235. * Returns the first argument as the sole entry in an array.
  236. *
  237. * @template T
  238. *
  239. * @param {T} value Value to return.
  240. *
  241. * @return {[T]} Value returned as entry in array.
  242. */
  243. function arrayOf(value) {
  244. return [value];
  245. }
  246. /**
  247. * Returns true if the value passed is object-like, or false otherwise. A value
  248. * is object-like if it can support property assignment, e.g. object or array.
  249. *
  250. * @param {*} value Value to test.
  251. *
  252. * @return {boolean} Whether value is object-like.
  253. */
  254. function isObjectLike(value) {
  255. return !!value && 'object' === typeof value;
  256. }
  257. /**
  258. * Creates and returns a new cache object.
  259. *
  260. * @return {Cache} Cache object.
  261. */
  262. function createCache() {
  263. /** @type {Cache} */
  264. var cache = {
  265. clear: function () {
  266. cache.head = null;
  267. },
  268. };
  269. return cache;
  270. }
  271. /**
  272. * Returns true if entries within the two arrays are strictly equal by
  273. * reference from a starting index.
  274. *
  275. * @param {*[]} a First array.
  276. * @param {*[]} b Second array.
  277. * @param {number} fromIndex Index from which to start comparison.
  278. *
  279. * @return {boolean} Whether arrays are shallowly equal.
  280. */
  281. function isShallowEqual(a, b, fromIndex) {
  282. var i;
  283. if (a.length !== b.length) {
  284. return false;
  285. }
  286. for (i = fromIndex; i < a.length; i++) {
  287. if (a[i] !== b[i]) {
  288. return false;
  289. }
  290. }
  291. return true;
  292. }
  293. /**
  294. * Returns a memoized selector function. The getDependants function argument is
  295. * called before the memoized selector and is expected to return an immutable
  296. * reference or array of references on which the selector depends for computing
  297. * its own return value. The memoize cache is preserved only as long as those
  298. * dependant references remain the same. If getDependants returns a different
  299. * reference(s), the cache is cleared and the selector value regenerated.
  300. *
  301. * @template {(...args: *[]) => *} S
  302. *
  303. * @param {S} selector Selector function.
  304. * @param {GetDependants=} getDependants Dependant getter returning an array of
  305. * references used in cache bust consideration.
  306. */
  307. /* harmony default export */ function rememo(selector, getDependants) {
  308. /** @type {WeakMap<*,*>} */
  309. var rootCache;
  310. /** @type {GetDependants} */
  311. var normalizedGetDependants = getDependants ? getDependants : arrayOf;
  312. /**
  313. * Returns the cache for a given dependants array. When possible, a WeakMap
  314. * will be used to create a unique cache for each set of dependants. This
  315. * is feasible due to the nature of WeakMap in allowing garbage collection
  316. * to occur on entries where the key object is no longer referenced. Since
  317. * WeakMap requires the key to be an object, this is only possible when the
  318. * dependant is object-like. The root cache is created as a hierarchy where
  319. * each top-level key is the first entry in a dependants set, the value a
  320. * WeakMap where each key is the next dependant, and so on. This continues
  321. * so long as the dependants are object-like. If no dependants are object-
  322. * like, then the cache is shared across all invocations.
  323. *
  324. * @see isObjectLike
  325. *
  326. * @param {*[]} dependants Selector dependants.
  327. *
  328. * @return {Cache} Cache object.
  329. */
  330. function getCache(dependants) {
  331. var caches = rootCache,
  332. isUniqueByDependants = true,
  333. i,
  334. dependant,
  335. map,
  336. cache;
  337. for (i = 0; i < dependants.length; i++) {
  338. dependant = dependants[i];
  339. // Can only compose WeakMap from object-like key.
  340. if (!isObjectLike(dependant)) {
  341. isUniqueByDependants = false;
  342. break;
  343. }
  344. // Does current segment of cache already have a WeakMap?
  345. if (caches.has(dependant)) {
  346. // Traverse into nested WeakMap.
  347. caches = caches.get(dependant);
  348. } else {
  349. // Create, set, and traverse into a new one.
  350. map = new WeakMap();
  351. caches.set(dependant, map);
  352. caches = map;
  353. }
  354. }
  355. // We use an arbitrary (but consistent) object as key for the last item
  356. // in the WeakMap to serve as our running cache.
  357. if (!caches.has(LEAF_KEY)) {
  358. cache = createCache();
  359. cache.isUniqueByDependants = isUniqueByDependants;
  360. caches.set(LEAF_KEY, cache);
  361. }
  362. return caches.get(LEAF_KEY);
  363. }
  364. /**
  365. * Resets root memoization cache.
  366. */
  367. function clear() {
  368. rootCache = new WeakMap();
  369. }
  370. /* eslint-disable jsdoc/check-param-names */
  371. /**
  372. * The augmented selector call, considering first whether dependants have
  373. * changed before passing it to underlying memoize function.
  374. *
  375. * @param {*} source Source object for derivation.
  376. * @param {...*} extraArgs Additional arguments to pass to selector.
  377. *
  378. * @return {*} Selector result.
  379. */
  380. /* eslint-enable jsdoc/check-param-names */
  381. function callSelector(/* source, ...extraArgs */) {
  382. var len = arguments.length,
  383. cache,
  384. node,
  385. i,
  386. args,
  387. dependants;
  388. // Create copy of arguments (avoid leaking deoptimization).
  389. args = new Array(len);
  390. for (i = 0; i < len; i++) {
  391. args[i] = arguments[i];
  392. }
  393. dependants = normalizedGetDependants.apply(null, args);
  394. cache = getCache(dependants);
  395. // If not guaranteed uniqueness by dependants (primitive type), shallow
  396. // compare against last dependants and, if references have changed,
  397. // destroy cache to recalculate result.
  398. if (!cache.isUniqueByDependants) {
  399. if (
  400. cache.lastDependants &&
  401. !isShallowEqual(dependants, cache.lastDependants, 0)
  402. ) {
  403. cache.clear();
  404. }
  405. cache.lastDependants = dependants;
  406. }
  407. node = cache.head;
  408. while (node) {
  409. // Check whether node arguments match arguments
  410. if (!isShallowEqual(node.args, args, 1)) {
  411. node = node.next;
  412. continue;
  413. }
  414. // At this point we can assume we've found a match
  415. // Surface matched node to head if not already
  416. if (node !== cache.head) {
  417. // Adjust siblings to point to each other.
  418. /** @type {CacheNode} */ (node.prev).next = node.next;
  419. if (node.next) {
  420. node.next.prev = node.prev;
  421. }
  422. node.next = cache.head;
  423. node.prev = null;
  424. /** @type {CacheNode} */ (cache.head).prev = node;
  425. cache.head = node;
  426. }
  427. // Return immediately
  428. return node.val;
  429. }
  430. // No cached value found. Continue to insertion phase:
  431. node = /** @type {CacheNode} */ ({
  432. // Generate the result from original function
  433. val: selector.apply(null, args),
  434. });
  435. // Avoid including the source object in the cache.
  436. args[0] = null;
  437. node.args = args;
  438. // Don't need to check whether node is already head, since it would
  439. // have been returned above already if it was
  440. // Shift existing head down list
  441. if (cache.head) {
  442. cache.head.prev = node;
  443. node.next = cache.head;
  444. }
  445. cache.head = node;
  446. return node.val;
  447. }
  448. callSelector.getDependants = normalizedGetDependants;
  449. callSelector.clear = clear;
  450. clear();
  451. return /** @type {S & EnhancedSelector} */ (callSelector);
  452. }
  453. ;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/selectors.js
  454. /**
  455. * External dependencies
  456. */
  457. /**
  458. * An object containing information about a guide.
  459. *
  460. * @typedef {Object} NUXGuideInfo
  461. * @property {string[]} tipIds Which tips the guide contains.
  462. * @property {?string} currentTipId The guide's currently showing tip.
  463. * @property {?string} nextTipId The guide's next tip to show.
  464. */
  465. /**
  466. * Returns an object describing the guide, if any, that the given tip is a part
  467. * of.
  468. *
  469. * @param {Object} state Global application state.
  470. * @param {string} tipId The tip to query.
  471. *
  472. * @return {?NUXGuideInfo} Information about the associated guide.
  473. */
  474. const getAssociatedGuide = rememo((state, tipId) => {
  475. for (const tipIds of state.guides) {
  476. if (tipIds.includes(tipId)) {
  477. const nonDismissedTips = tipIds.filter(tId => !Object.keys(state.preferences.dismissedTips).includes(tId));
  478. const [currentTipId = null, nextTipId = null] = nonDismissedTips;
  479. return {
  480. tipIds,
  481. currentTipId,
  482. nextTipId
  483. };
  484. }
  485. }
  486. return null;
  487. }, state => [state.guides, state.preferences.dismissedTips]);
  488. /**
  489. * Determines whether or not the given tip is showing. Tips are hidden if they
  490. * are disabled, have been dismissed, or are not the current tip in any
  491. * guide that they have been added to.
  492. *
  493. * @param {Object} state Global application state.
  494. * @param {string} tipId The tip to query.
  495. *
  496. * @return {boolean} Whether or not the given tip is showing.
  497. */
  498. function isTipVisible(state, tipId) {
  499. var _state$preferences$di;
  500. if (!state.preferences.areTipsEnabled) {
  501. return false;
  502. }
  503. if ((_state$preferences$di = state.preferences.dismissedTips) !== null && _state$preferences$di !== void 0 && _state$preferences$di.hasOwnProperty(tipId)) {
  504. return false;
  505. }
  506. const associatedGuide = getAssociatedGuide(state, tipId);
  507. if (associatedGuide && associatedGuide.currentTipId !== tipId) {
  508. return false;
  509. }
  510. return true;
  511. }
  512. /**
  513. * Returns whether or not tips are globally enabled.
  514. *
  515. * @param {Object} state Global application state.
  516. *
  517. * @return {boolean} Whether tips are globally enabled.
  518. */
  519. function selectors_areTipsEnabled(state) {
  520. return state.preferences.areTipsEnabled;
  521. }
  522. ;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/store/index.js
  523. /**
  524. * WordPress dependencies
  525. */
  526. /**
  527. * Internal dependencies
  528. */
  529. const STORE_NAME = 'core/nux';
  530. /**
  531. * Store definition for the nux namespace.
  532. *
  533. * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
  534. *
  535. * @type {Object}
  536. */
  537. const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, {
  538. reducer: reducer,
  539. actions: actions_namespaceObject,
  540. selectors: selectors_namespaceObject,
  541. persist: ['preferences']
  542. }); // Once we build a more generic persistence plugin that works across types of stores
  543. // we'd be able to replace this with a register call.
  544. (0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, {
  545. reducer: reducer,
  546. actions: actions_namespaceObject,
  547. selectors: selectors_namespaceObject,
  548. persist: ['preferences']
  549. });
  550. ;// CONCATENATED MODULE: external ["wp","element"]
  551. var external_wp_element_namespaceObject = window["wp"]["element"];
  552. ;// CONCATENATED MODULE: external ["wp","compose"]
  553. var external_wp_compose_namespaceObject = window["wp"]["compose"];
  554. ;// CONCATENATED MODULE: external ["wp","components"]
  555. var external_wp_components_namespaceObject = window["wp"]["components"];
  556. ;// CONCATENATED MODULE: external ["wp","i18n"]
  557. var external_wp_i18n_namespaceObject = window["wp"]["i18n"];
  558. ;// CONCATENATED MODULE: external ["wp","primitives"]
  559. var external_wp_primitives_namespaceObject = window["wp"]["primitives"];
  560. ;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js
  561. /**
  562. * WordPress dependencies
  563. */
  564. const close_close = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
  565. xmlns: "http://www.w3.org/2000/svg",
  566. viewBox: "0 0 24 24"
  567. }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
  568. 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"
  569. }));
  570. /* harmony default export */ var library_close = (close_close);
  571. ;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js
  572. /**
  573. * WordPress dependencies
  574. */
  575. /**
  576. * Internal dependencies
  577. */
  578. function onClick(event) {
  579. // Tips are often nested within buttons. We stop propagation so that clicking
  580. // on a tip doesn't result in the button being clicked.
  581. event.stopPropagation();
  582. }
  583. function DotTip(_ref) {
  584. let {
  585. position = 'middle right',
  586. children,
  587. isVisible,
  588. hasNextTip,
  589. onDismiss,
  590. onDisable
  591. } = _ref;
  592. const anchorParent = (0,external_wp_element_namespaceObject.useRef)(null);
  593. const onFocusOutsideCallback = (0,external_wp_element_namespaceObject.useCallback)(event => {
  594. if (!anchorParent.current) {
  595. return;
  596. }
  597. if (anchorParent.current.contains(event.relatedTarget)) {
  598. return;
  599. }
  600. onDisable();
  601. }, [onDisable, anchorParent]);
  602. if (!isVisible) {
  603. return null;
  604. }
  605. return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, {
  606. className: "nux-dot-tip",
  607. position: position,
  608. focusOnMount: true,
  609. role: "dialog",
  610. "aria-label": (0,external_wp_i18n_namespaceObject.__)('Editor tips'),
  611. onClick: onClick,
  612. onFocusOutside: onFocusOutsideCallback
  613. }, (0,external_wp_element_namespaceObject.createElement)("p", null, children), (0,external_wp_element_namespaceObject.createElement)("p", null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  614. variant: "link",
  615. onClick: onDismiss
  616. }, hasNextTip ? (0,external_wp_i18n_namespaceObject.__)('See next tip') : (0,external_wp_i18n_namespaceObject.__)('Got it'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
  617. className: "nux-dot-tip__disable",
  618. icon: library_close,
  619. label: (0,external_wp_i18n_namespaceObject.__)('Disable tips'),
  620. onClick: onDisable
  621. }));
  622. }
  623. /* harmony default export */ var dot_tip = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => {
  624. let {
  625. tipId
  626. } = _ref2;
  627. const {
  628. isTipVisible,
  629. getAssociatedGuide
  630. } = select(store);
  631. const associatedGuide = getAssociatedGuide(tipId);
  632. return {
  633. isVisible: isTipVisible(tipId),
  634. hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
  635. };
  636. }), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref3) => {
  637. let {
  638. tipId
  639. } = _ref3;
  640. const {
  641. dismissTip,
  642. disableTips
  643. } = dispatch(store);
  644. return {
  645. onDismiss() {
  646. dismissTip(tipId);
  647. },
  648. onDisable() {
  649. disableTips();
  650. }
  651. };
  652. }))(DotTip));
  653. ;// CONCATENATED MODULE: ./node_modules/@wordpress/nux/build-module/index.js
  654. /**
  655. * WordPress dependencies
  656. */
  657. external_wp_deprecated_default()('wp.nux', {
  658. since: '5.4',
  659. hint: 'wp.components.Guide can be used to show a user guide.',
  660. version: '6.2'
  661. });
  662. (window.wp = window.wp || {}).nux = __webpack_exports__;
  663. /******/ })()
  664. ;