@wordpress/nux 5.6.0 → 5.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.9.0 (2022-06-15)
6
+
7
+ ## 5.8.0 (2022-06-01)
8
+
9
+ ## 5.7.0 (2022-05-18)
10
+
5
11
  ## 5.6.0 (2022-05-04)
6
12
 
7
13
  ## 5.5.0 (2022-04-21)
@@ -62,7 +62,6 @@ function DotTip(_ref) {
62
62
  return (0, _element.createElement)(_components.Popover, {
63
63
  className: "nux-dot-tip",
64
64
  position: position,
65
- noArrow: true,
66
65
  focusOnMount: "container",
67
66
  role: "dialog",
68
67
  "aria-label": (0, _i18n.__)('Editor tips'),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/nux/src/components/dot-tip/index.js"],"names":["onClick","event","stopPropagation","DotTip","position","children","isVisible","hasNextTip","onDismiss","onDisable","anchorParent","onFocusOutsideCallback","current","contains","relatedTarget","close","select","tipId","isTipVisible","getAssociatedGuide","nuxStore","associatedGuide","nextTipId","dispatch","dismissTip","disableTips"],"mappings":";;;;;;;;AAOA;;AAJA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,SAASA,OAAT,CAAkBC,KAAlB,EAA0B;AACzB;AACA;AACAA,EAAAA,KAAK,CAACC,eAAN;AACA;;AAEM,SAASC,MAAT,OAOH;AAAA,MAPoB;AACvBC,IAAAA,QAAQ,GAAG,cADY;AAEvBC,IAAAA,QAFuB;AAGvBC,IAAAA,SAHuB;AAIvBC,IAAAA,UAJuB;AAKvBC,IAAAA,SALuB;AAMvBC,IAAAA;AANuB,GAOpB;AACH,QAAMC,YAAY,GAAG,qBAAQ,IAAR,CAArB;AACA,QAAMC,sBAAsB,GAAG,0BAC5BV,KAAF,IAAa;AACZ,QAAK,CAAES,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,eAAe,IAAIA,eAAe,CAACC,SAAvC;AAFP,GAAP;AAIA,CAPD,CADc,EASd,wBAAc,CAAEC,QAAF,YAA2B;AAAA,MAAf;AAAEN,IAAAA;AAAF,GAAe;AACxC,QAAM;AAAEO,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA8BF,QAAQ,CAAEH,YAAF,CAA5C;AACA,SAAO;AACNZ,IAAAA,SAAS,GAAG;AACXgB,MAAAA,UAAU,CAAEP,KAAF,CAAV;AACA,KAHK;;AAINR,IAAAA,SAAS,GAAG;AACXgB,MAAAA,WAAW;AACX;;AANK,GAAP;AAQA,CAVD,CATc,EAoBZtB,MApBY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { Popover, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as nuxStore } from '../../store';\n\nfunction onClick( event ) {\n\t// Tips are often nested within buttons. We stop propagation so that clicking\n\t// on a tip doesn't result in the button being clicked.\n\tevent.stopPropagation();\n}\n\nexport function DotTip( {\n\tposition = 'middle right',\n\tchildren,\n\tisVisible,\n\thasNextTip,\n\tonDismiss,\n\tonDisable,\n} ) {\n\tconst anchorParent = useRef( null );\n\tconst onFocusOutsideCallback = useCallback(\n\t\t( event ) => {\n\t\t\tif ( ! anchorParent.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( anchorParent.current.contains( event.relatedTarget ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonDisable();\n\t\t},\n\t\t[ onDisable, anchorParent ]\n\t);\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tclassName=\"nux-dot-tip\"\n\t\t\tposition={ position }\n\t\t\tnoArrow\n\t\t\tfocusOnMount=\"container\"\n\t\t\trole=\"dialog\"\n\t\t\taria-label={ __( 'Editor tips' ) }\n\t\t\tonClick={ onClick }\n\t\t\tonFocusOutside={ onFocusOutsideCallback }\n\t\t>\n\t\t\t<p>{ children }</p>\n\t\t\t<p>\n\t\t\t\t<Button variant=\"link\" onClick={ onDismiss }>\n\t\t\t\t\t{ hasNextTip ? __( 'See next tip' ) : __( 'Got it' ) }\n\t\t\t\t</Button>\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"nux-dot-tip__disable\"\n\t\t\t\ticon={ close }\n\t\t\t\tlabel={ __( 'Disable tips' ) }\n\t\t\t\tonClick={ onDisable }\n\t\t\t/>\n\t\t</Popover>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select, { tipId } ) => {\n\t\tconst { isTipVisible, getAssociatedGuide } = select( nuxStore );\n\t\tconst associatedGuide = getAssociatedGuide( tipId );\n\t\treturn {\n\t\t\tisVisible: isTipVisible( tipId ),\n\t\t\thasNextTip: !! ( associatedGuide && associatedGuide.nextTipId ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { tipId } ) => {\n\t\tconst { dismissTip, disableTips } = dispatch( nuxStore );\n\t\treturn {\n\t\t\tonDismiss() {\n\t\t\t\tdismissTip( tipId );\n\t\t\t},\n\t\t\tonDisable() {\n\t\t\t\tdisableTips();\n\t\t\t},\n\t\t};\n\t} )\n)( DotTip );\n"]}
1
+ {"version":3,"sources":["@wordpress/nux/src/components/dot-tip/index.js"],"names":["onClick","event","stopPropagation","DotTip","position","children","isVisible","hasNextTip","onDismiss","onDisable","anchorParent","onFocusOutsideCallback","current","contains","relatedTarget","close","select","tipId","isTipVisible","getAssociatedGuide","nuxStore","associatedGuide","nextTipId","dispatch","dismissTip","disableTips"],"mappings":";;;;;;;;AAOA;;AAJA;;AACA;;AACA;;AACA;;AAEA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGA,SAASA,OAAT,CAAkBC,KAAlB,EAA0B;AACzB;AACA;AACAA,EAAAA,K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MAAF,YAAyB;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACpC,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA;AAAhB,MAAuCH,MAAM,CAAEI,YAAF,CAAnD;AACA,QAAMC,eAAe,GAAGF,kBAAkB,CAAEF,KAAF,CAA1C;AACA,SAAO;AACNX,IAAAA,SAAS,EAAEY,YAAY,CAAED,KAAF,CADjB;AAENV,IAAAA,UAAU,EAAE,CAAC,EAAIc,eAAe,IAAIA,eAAe,CAACC,SAAvC;AAFP,GAAP;AAIA,CAPD,CADc,EASd,wBAAc,CAAEC,QAAF,YAA2B;AAAA,MAAf;AAAEN,IAAAA;AAAF,GAAe;AACxC,QAAM;AAAEO,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA8BF,QAAQ,CAAEH,YAAF,CAA5C;AACA,SAAO;AACNZ,IAAAA,SAAS,GAAG;AACXgB,MAAAA,UAAU,CAAEP,KAAF,CAAV;AACA,KAHK;;AAINR,IAAAA,SAAS,GAAG;AACXgB,MAAAA,WAAW;AACX;;AANK,GAAP;AAQA,CAVD,CATc,EAoBZtB,MApBY,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { Popover, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as nuxStore } from '../../store';\n\nfunction onClick( event ) {\n\t// Tips are often nested within buttons. We stop propagation so that clicking\n\t// on a tip doesn't result in the button being clicked.\n\tevent.stopPropagation();\n}\n\nexport function DotTip( {\n\tposition = 'middle right',\n\tchildren,\n\tisVisible,\n\thasNextTip,\n\tonDismiss,\n\tonDisable,\n} ) {\n\tconst anchorParent = useRef( null );\n\tconst onFocusOutsideCallback = useCallback(\n\t\t( event ) => {\n\t\t\tif ( ! anchorParent.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( anchorParent.current.contains( event.relatedTarget ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonDisable();\n\t\t},\n\t\t[ onDisable, anchorParent ]\n\t);\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tclassName=\"nux-dot-tip\"\n\t\t\tposition={ position }\n\t\t\tfocusOnMount=\"container\"\n\t\t\trole=\"dialog\"\n\t\t\taria-label={ __( 'Editor tips' ) }\n\t\t\tonClick={ onClick }\n\t\t\tonFocusOutside={ onFocusOutsideCallback }\n\t\t>\n\t\t\t<p>{ children }</p>\n\t\t\t<p>\n\t\t\t\t<Button variant=\"link\" onClick={ onDismiss }>\n\t\t\t\t\t{ hasNextTip ? __( 'See next tip' ) : __( 'Got it' ) }\n\t\t\t\t</Button>\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"nux-dot-tip__disable\"\n\t\t\t\ticon={ close }\n\t\t\t\tlabel={ __( 'Disable tips' ) }\n\t\t\t\tonClick={ onDisable }\n\t\t\t/>\n\t\t</Popover>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select, { tipId } ) => {\n\t\tconst { isTipVisible, getAssociatedGuide } = select( nuxStore );\n\t\tconst associatedGuide = getAssociatedGuide( tipId );\n\t\treturn {\n\t\t\tisVisible: isTipVisible( tipId ),\n\t\t\thasNextTip: !! ( associatedGuide && associatedGuide.nextTipId ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { tipId } ) => {\n\t\tconst { dismissTip, disableTips } = dispatch( nuxStore );\n\t\treturn {\n\t\t\tonDismiss() {\n\t\t\t\tdismissTip( tipId );\n\t\t\t},\n\t\t\tonDisable() {\n\t\t\t\tdisableTips();\n\t\t\t},\n\t\t};\n\t} )\n)( DotTip );\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/nux/src/store/selectors.js"],"names":["getAssociatedGuide","state","tipId","tipIds","guides","nonDismissedTips","preferences","dismissedTips","currentTipId","nextTipId","isTipVisible","areTipsEnabled","associatedGuide"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,kBAAkB,GAAG,qBACjC,CAAEC,KAAF,EAASC,KAAT,KAAoB;AACnB,OAAM,MAAMC,MAAZ,IAAsBF,KAAK,CAACG,MAA5B,EAAqC;AACpC,QAAK,sBAAUD,MAAV,EAAkBD,KAAlB,CAAL,EAAiC;AAChC,YAAMG,gBAAgB,GAAG,wBACxBF,MADwB,EAExB,kBAAMF,KAAK,CAACK,WAAN,CAAkBC,aAAxB,CAFwB,CAAzB;AAIA,YAAM,CACLC,YAAY,GAAG,IADV,EAELC,SAAS,GAAG,IAFP,IAGFJ,gBAHJ;AAIA,aAAO;AAAEF,QAAAA,MAAF;AAAUK,QAAAA,YAAV;AAAwBC,QAAAA;AAAxB,OAAP;AACA;AACD;;AAED,SAAO,IAAP;AACA,CAjBgC,EAkB/BR,KAAF,IAAa,CAAEA,KAAK,CAACG,MAAR,EAAgBH,KAAK,CAACK,WAAN,CAAkBC,aAAlC,CAlBoB,CAA3B;AAqBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACO,SAASG,YAAT,CAAuBT,KAAvB,EAA8BC,KAA9B,EAAsC;AAC5C,MAAK,CAAED,KAAK,CAACK,WAAN,CAAkBK,cAAzB,EAA0C;AACzC,WAAO,KAAP;AACA;;AAED,MAAK,iBAAKV,KAAK,CAACK,WAAN,CAAkBC,aAAvB,EAAsC,CAAEL,KAAF,CAAtC,CAAL,EAAyD;AACxD,WAAO,KAAP;AACA;;AAED,QAAMU,eAAe,GAAGZ,kBAAkB,CAAEC,KAAF,EAASC,KAAT,CAA1C;;AACA,MAAKU,eAAe,IAAIA,eAAe,CAACJ,YAAhB,KAAiCN,KAAzD,EAAiE;AAChE,WAAO,KAAP;AACA;;AAED,SAAO,IAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASS,cAAT,CAAyBV,KAAzB,EAAiC;AACvC,SAAOA,KAAK,CAACK,WAAN,CAAkBK,cAAzB;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { includes, difference, keys, has } from 'lodash';\n\n/**\n * An object containing information about a guide.\n *\n * @typedef {Object} NUXGuideInfo\n * @property {string[]} tipIds Which tips the guide contains.\n * @property {?string} currentTipId The guide's currently showing tip.\n * @property {?string} nextTipId The guide's next tip to show.\n */\n\n/**\n * Returns an object describing the guide, if any, that the given tip is a part\n * of.\n *\n * @param {Object} state Global application state.\n * @param {string} tipId The tip to query.\n *\n * @return {?NUXGuideInfo} Information about the associated guide.\n */\nexport const getAssociatedGuide = createSelector(\n\t( state, tipId ) => {\n\t\tfor ( const tipIds of state.guides ) {\n\t\t\tif ( includes( tipIds, tipId ) ) {\n\t\t\t\tconst nonDismissedTips = difference(\n\t\t\t\t\ttipIds,\n\t\t\t\t\tkeys( state.preferences.dismissedTips )\n\t\t\t\t);\n\t\t\t\tconst [\n\t\t\t\t\tcurrentTipId = null,\n\t\t\t\t\tnextTipId = null,\n\t\t\t\t] = nonDismissedTips;\n\t\t\t\treturn { tipIds, currentTipId, nextTipId };\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\t( state ) => [ state.guides, state.preferences.dismissedTips ]\n);\n\n/**\n * Determines whether or not the given tip is showing. Tips are hidden if they\n * are disabled, have been dismissed, or are not the current tip in any\n * guide that they have been added to.\n *\n * @param {Object} state Global application state.\n * @param {string} tipId The tip to query.\n *\n * @return {boolean} Whether or not the given tip is showing.\n */\nexport function isTipVisible( state, tipId ) {\n\tif ( ! state.preferences.areTipsEnabled ) {\n\t\treturn false;\n\t}\n\n\tif ( has( state.preferences.dismissedTips, [ tipId ] ) ) {\n\t\treturn false;\n\t}\n\n\tconst associatedGuide = getAssociatedGuide( state, tipId );\n\tif ( associatedGuide && associatedGuide.currentTipId !== tipId ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns whether or not tips are globally enabled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether tips are globally enabled.\n */\nexport function areTipsEnabled( state ) {\n\treturn state.preferences.areTipsEnabled;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/nux/src/store/selectors.js"],"names":["getAssociatedGuide","state","tipId","tipIds","guides","nonDismissedTips","preferences","dismissedTips","currentTipId","nextTipId","isTipVisible","areTipsEnabled","associatedGuide"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,kBAAkB,GAAG,qBACjC,CAAEC,KAAF,EAASC,KAAT,KAAoB;AACnB,OAAM,MAAMC,MAAZ,IAAsBF,KAAK,CAACG,MAA5B,EAAqC;AACpC,QAAK,sBAAUD,MAAV,EAAkBD,KAAlB,CAAL,EAAiC;AAChC,YAAMG,gBAAgB,GAAG,wBACxBF,MADwB,EAExB,kBAAMF,KAAK,CAACK,WAAN,CAAkBC,aAAxB,CAFwB,CAAzB;AAIA,YAAM,CAAEC,YAAY,GAAG,IAAjB,EAAuBC,SAAS,GAAG,IAAnC,IACLJ,gBADD;AAEA,aAAO;AAAEF,QAAAA,MAAF;AAAUK,QAAAA,YAAV;AAAwBC,QAAAA;AAAxB,OAAP;AACA;AACD;;AAED,SAAO,IAAP;AACA,CAfgC,EAgB/BR,KAAF,IAAa,CAAEA,KAAK,CAACG,MAAR,EAAgBH,KAAK,CAACK,WAAN,CAAkBC,aAAlC,CAhBoB,CAA3B;AAmBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACO,SAASG,YAAT,CAAuBT,KAAvB,EAA8BC,KAA9B,EAAsC;AAC5C,MAAK,CAAED,KAAK,CAACK,WAAN,CAAkBK,cAAzB,EAA0C;AACzC,WAAO,KAAP;AACA;;AAED,MAAK,iBAAKV,KAAK,CAACK,WAAN,CAAkBC,aAAvB,EAAsC,CAAEL,KAAF,CAAtC,CAAL,EAAyD;AACxD,WAAO,KAAP;AACA;;AAED,QAAMU,eAAe,GAAGZ,kBAAkB,CAAEC,KAAF,EAASC,KAAT,CAA1C;;AACA,MAAKU,eAAe,IAAIA,eAAe,CAACJ,YAAhB,KAAiCN,KAAzD,EAAiE;AAChE,WAAO,KAAP;AACA;;AAED,SAAO,IAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASS,cAAT,CAAyBV,KAAzB,EAAiC;AACvC,SAAOA,KAAK,CAACK,WAAN,CAAkBK,cAAzB;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { includes, difference, keys, has } from 'lodash';\n\n/**\n * An object containing information about a guide.\n *\n * @typedef {Object} NUXGuideInfo\n * @property {string[]} tipIds Which tips the guide contains.\n * @property {?string} currentTipId The guide's currently showing tip.\n * @property {?string} nextTipId The guide's next tip to show.\n */\n\n/**\n * Returns an object describing the guide, if any, that the given tip is a part\n * of.\n *\n * @param {Object} state Global application state.\n * @param {string} tipId The tip to query.\n *\n * @return {?NUXGuideInfo} Information about the associated guide.\n */\nexport const getAssociatedGuide = createSelector(\n\t( state, tipId ) => {\n\t\tfor ( const tipIds of state.guides ) {\n\t\t\tif ( includes( tipIds, tipId ) ) {\n\t\t\t\tconst nonDismissedTips = difference(\n\t\t\t\t\ttipIds,\n\t\t\t\t\tkeys( state.preferences.dismissedTips )\n\t\t\t\t);\n\t\t\t\tconst [ currentTipId = null, nextTipId = null ] =\n\t\t\t\t\tnonDismissedTips;\n\t\t\t\treturn { tipIds, currentTipId, nextTipId };\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\t( state ) => [ state.guides, state.preferences.dismissedTips ]\n);\n\n/**\n * Determines whether or not the given tip is showing. Tips are hidden if they\n * are disabled, have been dismissed, or are not the current tip in any\n * guide that they have been added to.\n *\n * @param {Object} state Global application state.\n * @param {string} tipId The tip to query.\n *\n * @return {boolean} Whether or not the given tip is showing.\n */\nexport function isTipVisible( state, tipId ) {\n\tif ( ! state.preferences.areTipsEnabled ) {\n\t\treturn false;\n\t}\n\n\tif ( has( state.preferences.dismissedTips, [ tipId ] ) ) {\n\t\treturn false;\n\t}\n\n\tconst associatedGuide = getAssociatedGuide( state, tipId );\n\tif ( associatedGuide && associatedGuide.currentTipId !== tipId ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns whether or not tips are globally enabled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether tips are globally enabled.\n */\nexport function areTipsEnabled( state ) {\n\treturn state.preferences.areTipsEnabled;\n}\n"]}
@@ -50,7 +50,6 @@ export function DotTip(_ref) {
50
50
  return createElement(Popover, {
51
51
  className: "nux-dot-tip",
52
52
  position: position,
53
- noArrow: true,
54
53
  focusOnMount: "container",
55
54
  role: "dialog",
56
55
  "aria-label": __('Editor tips'),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/nux/src/components/dot-tip/index.js"],"names":["compose","Popover","Button","__","withSelect","withDispatch","useCallback","useRef","close","store","nuxStore","onClick","event","stopPropagation","DotTip","position","children","isVisible","hasNextTip","onDismiss","onDisable","anchorParent","onFocusOutsideCallback","current","contains","relatedTarget","select","tipId","isTipVisible","getAssociatedGuide","associatedGuide","nextTipId","dispatch","dismissTip","disableTips"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,OAAT,EAAkBC,MAAlB,QAAgC,uBAAhC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,WAAT,EAAsBC,MAAtB,QAAoC,oBAApC;AACA,SAASC,KAAT,QAAsB,kBAAtB;AAEA;AACA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AAA,SAAS,EAAC,sBADX;AAEC,IAAA,IAAI,EAAGK,KAFR;AAGC,IAAA,KAAK,EAAGL,EAAE,CAAE,cAAF,CAHX;AAIC,IAAA,OAAO,EAAGiB;AAJX,IAhBD,CADD;AAyBA;AAED,eAAepB,OAAO,CACrBI,UAAU,CAAE,CAAEsB,MAAF,YAAyB;AAAA,MAAf;AAAEC,IAAAA;AAAF,GAAe;AACpC,QAAM;AAAEC,IAAAA,YAAF;AAAgBC,IAAAA;AAAhB,MAAuCH,MAAM,CAAEhB,QAAF,CAAnD;AACA,QAAMoB,eAAe,GAAGD,kBAAkB,CAAEF,KAAF,CAA1C;AACA,SAAO;AACNV,IAAAA,SAAS,EAAEW,YAAY,CAAED,KAAF,CADjB;AAENT,IAAAA,UAAU,EAAE,CAAC,EAAIY,eAAe,IAAIA,eAAe,CAACC,SAAvC;AAFP,GAAP;AAIA,CAPS,CADW,EASrB1B,YAAY,CAAE,CAAE2B,QAAF,YAA2B;AAAA,MAAf;AAAEL,IAAAA;AAAF,GAAe;AACxC,QAAM;AAAEM,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA8BF,QAAQ,CAAEtB,QAAF,CAA5C;AACA,SAAO;AACNS,IAAAA,SAAS,GAAG;AACXc,MAAAA,UAAU,CAAEN,KAAF,CAAV;AACA,KAHK;;AAINP,IAAAA,SAAS,GAAG;AACXc,MAAAA,WAAW;AACX;;AANK,GAAP;AAQA,CAVW,CATS,CAAP,CAoBZpB,MApBY,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { Popover, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as nuxStore } from '../../store';\n\nfunction onClick( event ) {\n\t// Tips are often nested within buttons. We stop propagation so that clicking\n\t// on a tip doesn't result in the button being clicked.\n\tevent.stopPropagation();\n}\n\nexport function DotTip( {\n\tposition = 'middle right',\n\tchildren,\n\tisVisible,\n\thasNextTip,\n\tonDismiss,\n\tonDisable,\n} ) {\n\tconst anchorParent = useRef( null );\n\tconst onFocusOutsideCallback = useCallback(\n\t\t( event ) => {\n\t\t\tif ( ! anchorParent.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( anchorParent.current.contains( event.relatedTarget ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonDisable();\n\t\t},\n\t\t[ onDisable, anchorParent ]\n\t);\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tclassName=\"nux-dot-tip\"\n\t\t\tposition={ position }\n\t\t\tnoArrow\n\t\t\tfocusOnMount=\"container\"\n\t\t\trole=\"dialog\"\n\t\t\taria-label={ __( 'Editor tips' ) }\n\t\t\tonClick={ onClick }\n\t\t\tonFocusOutside={ onFocusOutsideCallback }\n\t\t>\n\t\t\t<p>{ children }</p>\n\t\t\t<p>\n\t\t\t\t<Button variant=\"link\" onClick={ onDismiss }>\n\t\t\t\t\t{ hasNextTip ? __( 'See next tip' ) : __( 'Got it' ) }\n\t\t\t\t</Button>\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"nux-dot-tip__disable\"\n\t\t\t\ticon={ close }\n\t\t\t\tlabel={ __( 'Disable tips' ) }\n\t\t\t\tonClick={ onDisable }\n\t\t\t/>\n\t\t</Popover>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select, { tipId } ) => {\n\t\tconst { isTipVisible, getAssociatedGuide } = select( nuxStore );\n\t\tconst associatedGuide = getAssociatedGuide( tipId );\n\t\treturn {\n\t\t\tisVisible: isTipVisible( tipId ),\n\t\t\thasNextTip: !! ( associatedGuide && associatedGuide.nextTipId ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { tipId } ) => {\n\t\tconst { dismissTip, disableTips } = dispatch( nuxStore );\n\t\treturn {\n\t\t\tonDismiss() {\n\t\t\t\tdismissTip( tipId );\n\t\t\t},\n\t\t\tonDisable() {\n\t\t\t\tdisableTips();\n\t\t\t},\n\t\t};\n\t} )\n)( DotTip );\n"]}
1
+ {"version":3,"sources":["@wordpress/nux/src/components/dot-tip/index.js"],"names":["compose","Popover","Button","__","withSelect","withDispatch","useCallback","useRef","close","store","nuxStore","onClick","event","stopPropagation","DotTip","position","children","isVisible","hasNextTip","onDismiss","onDisable","anchorParent","onFocusOutsideCallback","current","contains","relatedTarget","select","tipId","isTipVisible","getAssociatedGuide","associatedGuide","nextTipId","dispatch","dismissTip","disableTips"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,oBAAxB;AACA,SAASC,OAAT,EAAkBC,MAAlB,QAAgC,uBAAhC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,WAAT,EAAsBC,MAAtB,QAAoC,oBAApC;AACA,SAASC,KAAT,QAAsB,kBAAtB;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,QAAlB,QAAkC,aAAlC;;AAEA,SAASC,OAAT,CAAkBC,KAAlB,EAA0B;AACzB;AACA;AACAA,EAAAA,KAAK,CAACC,eAAN;AACA;;AAED,OAAO,SAASC,MAAT,OAOH;AAAA,MAPoB;AACvBC,IAAAA,QAAQ,GAAG,cADY;AAEvBC,IAAAA,QAFuB;AAGvBC,IAAAA,SAHuB;AAIvBC,IAAAA,UAJuB;AAKvBC,IAAAA,SALuB;AAMvBC,IAAAA;AANuB,GAOpB;AACH,QAAMC,YAAY,GAAGd,MAAM,CAAE,IAAF,CAA3B;AACA,QAAMe,sBAAsB,GAAGhB,WAAW,CACvCM,KAAF,IAAa;AACZ,QAAK,CAAES,YAAY,CAACE,OAApB,EAA8B;AAC7B;AACA;;AACD,QAAKF,YAAY,CAACE,OAAb,CAAqBC,QAArB,CAA+BZ,KAAK,CAACa,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AF,YAA2B;AAAA,MAAf;AAAEL,IAAAA;AAAF,GAAe;AACxC,QAAM;AAAEM,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA8BF,QAAQ,CAAEtB,QAAF,CAA5C;AACA,SAAO;AACNS,IAAAA,SAAS,GAAG;AACXc,MAAAA,UAAU,CAAEN,KAAF,CAAV;AACA,KAHK;;AAINP,IAAAA,SAAS,GAAG;AACXc,MAAAA,WAAW;AACX;;AANK,GAAP;AAQA,CAVW,CATS,CAAP,CAoBZpB,MApBY,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { Popover, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { useCallback, useRef } from '@wordpress/element';\nimport { close } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as nuxStore } from '../../store';\n\nfunction onClick( event ) {\n\t// Tips are often nested within buttons. We stop propagation so that clicking\n\t// on a tip doesn't result in the button being clicked.\n\tevent.stopPropagation();\n}\n\nexport function DotTip( {\n\tposition = 'middle right',\n\tchildren,\n\tisVisible,\n\thasNextTip,\n\tonDismiss,\n\tonDisable,\n} ) {\n\tconst anchorParent = useRef( null );\n\tconst onFocusOutsideCallback = useCallback(\n\t\t( event ) => {\n\t\t\tif ( ! anchorParent.current ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( anchorParent.current.contains( event.relatedTarget ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonDisable();\n\t\t},\n\t\t[ onDisable, anchorParent ]\n\t);\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tclassName=\"nux-dot-tip\"\n\t\t\tposition={ position }\n\t\t\tfocusOnMount=\"container\"\n\t\t\trole=\"dialog\"\n\t\t\taria-label={ __( 'Editor tips' ) }\n\t\t\tonClick={ onClick }\n\t\t\tonFocusOutside={ onFocusOutsideCallback }\n\t\t>\n\t\t\t<p>{ children }</p>\n\t\t\t<p>\n\t\t\t\t<Button variant=\"link\" onClick={ onDismiss }>\n\t\t\t\t\t{ hasNextTip ? __( 'See next tip' ) : __( 'Got it' ) }\n\t\t\t\t</Button>\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"nux-dot-tip__disable\"\n\t\t\t\ticon={ close }\n\t\t\t\tlabel={ __( 'Disable tips' ) }\n\t\t\t\tonClick={ onDisable }\n\t\t\t/>\n\t\t</Popover>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select, { tipId } ) => {\n\t\tconst { isTipVisible, getAssociatedGuide } = select( nuxStore );\n\t\tconst associatedGuide = getAssociatedGuide( tipId );\n\t\treturn {\n\t\t\tisVisible: isTipVisible( tipId ),\n\t\t\thasNextTip: !! ( associatedGuide && associatedGuide.nextTipId ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { tipId } ) => {\n\t\tconst { dismissTip, disableTips } = dispatch( nuxStore );\n\t\treturn {\n\t\t\tonDismiss() {\n\t\t\t\tdismissTip( tipId );\n\t\t\t},\n\t\t\tonDisable() {\n\t\t\t\tdisableTips();\n\t\t\t},\n\t\t};\n\t} )\n)( DotTip );\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/nux/src/store/selectors.js"],"names":["createSelector","includes","difference","keys","has","getAssociatedGuide","state","tipId","tipIds","guides","nonDismissedTips","preferences","dismissedTips","currentTipId","nextTipId","isTipVisible","areTipsEnabled","associatedGuide"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AACA,SAASC,QAAT,EAAmBC,UAAnB,EAA+BC,IAA/B,EAAqCC,GAArC,QAAgD,QAAhD;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,kBAAkB,GAAGL,cAAc,CAC/C,CAAEM,KAAF,EAASC,KAAT,KAAoB;AACnB,OAAM,MAAMC,MAAZ,IAAsBF,KAAK,CAACG,MAA5B,EAAqC;AACpC,QAAKR,QAAQ,CAAEO,MAAF,EAAUD,KAAV,CAAb,EAAiC;AAChC,YAAMG,gBAAgB,GAAGR,UAAU,CAClCM,MADkC,EAElCL,IAAI,CAAEG,KAAK,CAACK,WAAN,CAAkBC,aAApB,CAF8B,CAAnC;AAIA,YAAM,CACLC,YAAY,GAAG,IADV,EAELC,SAAS,GAAG,IAFP,IAGFJ,gBAHJ;AAIA,aAAO;AAAEF,QAAAA,MAAF;AAAUK,QAAAA,YAAV;AAAwBC,QAAAA;AAAxB,OAAP;AACA;AACD;;AAED,SAAO,IAAP;AACA,CAjB8C,EAkB7CR,KAAF,IAAa,CAAEA,KAAK,CAACG,MAAR,EAAgBH,KAAK,CAACK,WAAN,CAAkBC,aAAlC,CAlBkC,CAAzC;AAqBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,YAAT,CAAuBT,KAAvB,EAA8BC,KAA9B,EAAsC;AAC5C,MAAK,CAAED,KAAK,CAACK,WAAN,CAAkBK,cAAzB,EAA0C;AACzC,WAAO,KAAP;AACA;;AAED,MAAKZ,GAAG,CAAEE,KAAK,CAACK,WAAN,CAAkBC,aAApB,EAAmC,CAAEL,KAAF,CAAnC,CAAR,EAAyD;AACxD,WAAO,KAAP;AACA;;AAED,QAAMU,eAAe,GAAGZ,kBAAkB,CAAEC,KAAF,EAASC,KAAT,CAA1C;;AACA,MAAKU,eAAe,IAAIA,eAAe,CAACJ,YAAhB,KAAiCN,KAAzD,EAAiE;AAChE,WAAO,KAAP;AACA;;AAED,SAAO,IAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASS,cAAT,CAAyBV,KAAzB,EAAiC;AACvC,SAAOA,KAAK,CAACK,WAAN,CAAkBK,cAAzB;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { includes, difference, keys, has } from 'lodash';\n\n/**\n * An object containing information about a guide.\n *\n * @typedef {Object} NUXGuideInfo\n * @property {string[]} tipIds Which tips the guide contains.\n * @property {?string} currentTipId The guide's currently showing tip.\n * @property {?string} nextTipId The guide's next tip to show.\n */\n\n/**\n * Returns an object describing the guide, if any, that the given tip is a part\n * of.\n *\n * @param {Object} state Global application state.\n * @param {string} tipId The tip to query.\n *\n * @return {?NUXGuideInfo} Information about the associated guide.\n */\nexport const getAssociatedGuide = createSelector(\n\t( state, tipId ) => {\n\t\tfor ( const tipIds of state.guides ) {\n\t\t\tif ( includes( tipIds, tipId ) ) {\n\t\t\t\tconst nonDismissedTips = difference(\n\t\t\t\t\ttipIds,\n\t\t\t\t\tkeys( state.preferences.dismissedTips )\n\t\t\t\t);\n\t\t\t\tconst [\n\t\t\t\t\tcurrentTipId = null,\n\t\t\t\t\tnextTipId = null,\n\t\t\t\t] = nonDismissedTips;\n\t\t\t\treturn { tipIds, currentTipId, nextTipId };\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\t( state ) => [ state.guides, state.preferences.dismissedTips ]\n);\n\n/**\n * Determines whether or not the given tip is showing. Tips are hidden if they\n * are disabled, have been dismissed, or are not the current tip in any\n * guide that they have been added to.\n *\n * @param {Object} state Global application state.\n * @param {string} tipId The tip to query.\n *\n * @return {boolean} Whether or not the given tip is showing.\n */\nexport function isTipVisible( state, tipId ) {\n\tif ( ! state.preferences.areTipsEnabled ) {\n\t\treturn false;\n\t}\n\n\tif ( has( state.preferences.dismissedTips, [ tipId ] ) ) {\n\t\treturn false;\n\t}\n\n\tconst associatedGuide = getAssociatedGuide( state, tipId );\n\tif ( associatedGuide && associatedGuide.currentTipId !== tipId ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns whether or not tips are globally enabled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether tips are globally enabled.\n */\nexport function areTipsEnabled( state ) {\n\treturn state.preferences.areTipsEnabled;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/nux/src/store/selectors.js"],"names":["createSelector","includes","difference","keys","has","getAssociatedGuide","state","tipId","tipIds","guides","nonDismissedTips","preferences","dismissedTips","currentTipId","nextTipId","isTipVisible","areTipsEnabled","associatedGuide"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,cAAP,MAA2B,QAA3B;AACA,SAASC,QAAT,EAAmBC,UAAnB,EAA+BC,IAA/B,EAAqCC,GAArC,QAAgD,QAAhD;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,kBAAkB,GAAGL,cAAc,CAC/C,CAAEM,KAAF,EAASC,KAAT,KAAoB;AACnB,OAAM,MAAMC,MAAZ,IAAsBF,KAAK,CAACG,MAA5B,EAAqC;AACpC,QAAKR,QAAQ,CAAEO,MAAF,EAAUD,KAAV,CAAb,EAAiC;AAChC,YAAMG,gBAAgB,GAAGR,UAAU,CAClCM,MADkC,EAElCL,IAAI,CAAEG,KAAK,CAACK,WAAN,CAAkBC,aAApB,CAF8B,CAAnC;AAIA,YAAM,CAAEC,YAAY,GAAG,IAAjB,EAAuBC,SAAS,GAAG,IAAnC,IACLJ,gBADD;AAEA,aAAO;AAAEF,QAAAA,MAAF;AAAUK,QAAAA,YAAV;AAAwBC,QAAAA;AAAxB,OAAP;AACA;AACD;;AAED,SAAO,IAAP;AACA,CAf8C,EAgB7CR,KAAF,IAAa,CAAEA,KAAK,CAACG,MAAR,EAAgBH,KAAK,CAACK,WAAN,CAAkBC,aAAlC,CAhBkC,CAAzC;AAmBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,YAAT,CAAuBT,KAAvB,EAA8BC,KAA9B,EAAsC;AAC5C,MAAK,CAAED,KAAK,CAACK,WAAN,CAAkBK,cAAzB,EAA0C;AACzC,WAAO,KAAP;AACA;;AAED,MAAKZ,GAAG,CAAEE,KAAK,CAACK,WAAN,CAAkBC,aAApB,EAAmC,CAAEL,KAAF,CAAnC,CAAR,EAAyD;AACxD,WAAO,KAAP;AACA;;AAED,QAAMU,eAAe,GAAGZ,kBAAkB,CAAEC,KAAF,EAASC,KAAT,CAA1C;;AACA,MAAKU,eAAe,IAAIA,eAAe,CAACJ,YAAhB,KAAiCN,KAAzD,EAAiE;AAChE,WAAO,KAAP;AACA;;AAED,SAAO,IAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASS,cAAT,CAAyBV,KAAzB,EAAiC;AACvC,SAAOA,KAAK,CAACK,WAAN,CAAkBK,cAAzB;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\nimport { includes, difference, keys, has } from 'lodash';\n\n/**\n * An object containing information about a guide.\n *\n * @typedef {Object} NUXGuideInfo\n * @property {string[]} tipIds Which tips the guide contains.\n * @property {?string} currentTipId The guide's currently showing tip.\n * @property {?string} nextTipId The guide's next tip to show.\n */\n\n/**\n * Returns an object describing the guide, if any, that the given tip is a part\n * of.\n *\n * @param {Object} state Global application state.\n * @param {string} tipId The tip to query.\n *\n * @return {?NUXGuideInfo} Information about the associated guide.\n */\nexport const getAssociatedGuide = createSelector(\n\t( state, tipId ) => {\n\t\tfor ( const tipIds of state.guides ) {\n\t\t\tif ( includes( tipIds, tipId ) ) {\n\t\t\t\tconst nonDismissedTips = difference(\n\t\t\t\t\ttipIds,\n\t\t\t\t\tkeys( state.preferences.dismissedTips )\n\t\t\t\t);\n\t\t\t\tconst [ currentTipId = null, nextTipId = null ] =\n\t\t\t\t\tnonDismissedTips;\n\t\t\t\treturn { tipIds, currentTipId, nextTipId };\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t},\n\t( state ) => [ state.guides, state.preferences.dismissedTips ]\n);\n\n/**\n * Determines whether or not the given tip is showing. Tips are hidden if they\n * are disabled, have been dismissed, or are not the current tip in any\n * guide that they have been added to.\n *\n * @param {Object} state Global application state.\n * @param {string} tipId The tip to query.\n *\n * @return {boolean} Whether or not the given tip is showing.\n */\nexport function isTipVisible( state, tipId ) {\n\tif ( ! state.preferences.areTipsEnabled ) {\n\t\treturn false;\n\t}\n\n\tif ( has( state.preferences.dismissedTips, [ tipId ] ) ) {\n\t\treturn false;\n\t}\n\n\tconst associatedGuide = getAssociatedGuide( state, tipId );\n\tif ( associatedGuide && associatedGuide.currentTipId !== tipId ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Returns whether or not tips are globally enabled.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether tips are globally enabled.\n */\nexport function areTipsEnabled( state ) {\n\treturn state.preferences.areTipsEnabled;\n}\n"]}
@@ -120,8 +120,6 @@
120
120
  }
121
121
  .nux-dot-tip .components-popover__content {
122
122
  width: 350px;
123
- }
124
- .nux-dot-tip .components-popover__content > div {
125
123
  padding: 20px 18px;
126
124
  }
127
125
  @media (min-width: 600px) {
@@ -120,8 +120,6 @@
120
120
  }
121
121
  .nux-dot-tip .components-popover__content {
122
122
  width: 350px;
123
- }
124
- .nux-dot-tip .components-popover__content > div {
125
123
  padding: 20px 18px;
126
124
  }
127
125
  @media (min-width: 600px) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/nux",
3
- "version": "5.6.0",
3
+ "version": "5.9.0",
4
4
  "description": "NUX (New User eXperience) module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,15 +31,15 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.16.0",
34
- "@wordpress/components": "^19.10.0",
35
- "@wordpress/compose": "^5.6.0",
36
- "@wordpress/data": "^6.8.0",
37
- "@wordpress/deprecated": "^3.8.0",
38
- "@wordpress/element": "^4.6.0",
39
- "@wordpress/i18n": "^4.8.0",
40
- "@wordpress/icons": "^8.4.0",
34
+ "@wordpress/components": "^19.13.0",
35
+ "@wordpress/compose": "^5.9.0",
36
+ "@wordpress/data": "^6.11.0",
37
+ "@wordpress/deprecated": "^3.11.0",
38
+ "@wordpress/element": "^4.9.0",
39
+ "@wordpress/i18n": "^4.11.0",
40
+ "@wordpress/icons": "^9.2.0",
41
41
  "lodash": "^4.17.21",
42
- "rememo": "^3.0.0"
42
+ "rememo": "^4.0.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": "^17.0.0",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "4631d515033397fcfeda77e5755960253caef9bf"
51
+ "gitHead": "48d5f37dfb52d2e77c8eeb662f9874cf141b8c6b"
52
52
  }
@@ -48,7 +48,6 @@ export function DotTip( {
48
48
  <Popover
49
49
  className="nux-dot-tip"
50
50
  position={ position }
51
- noArrow
52
51
  focusOnMount="container"
53
52
  role="dialog"
54
53
  aria-label={ __( 'Editor tips' ) }
@@ -39,10 +39,7 @@ $dot-scale: 3; // How much the pulse animation should scale up by in size
39
39
 
40
40
  .components-popover__content {
41
41
  width: 350px;
42
-
43
- > div {
44
- padding: 20px 18px;
45
- }
42
+ padding: 20px 18px;
46
43
 
47
44
  @include break-small {
48
45
  width: 450px;
@@ -5,7 +5,6 @@ exports[`DotTip should render correctly 1`] = `
5
5
  aria-label="Editor tips"
6
6
  className="nux-dot-tip"
7
7
  focusOnMount="container"
8
- noArrow={true}
9
8
  onClick={[Function]}
10
9
  onFocusOutside={[Function]}
11
10
  position="middle right"
@@ -2,13 +2,14 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { shallow } from 'enzyme';
5
- import { noop } from 'lodash';
6
5
 
7
6
  /**
8
7
  * Internal dependencies
9
8
  */
10
9
  import { DotTip } from '..';
11
10
 
11
+ const noop = () => {};
12
+
12
13
  describe( 'DotTip', () => {
13
14
  it( 'should not render anything if invisible', () => {
14
15
  const wrapper = shallow(
@@ -30,10 +30,8 @@ export const getAssociatedGuide = createSelector(
30
30
  tipIds,
31
31
  keys( state.preferences.dismissedTips )
32
32
  );
33
- const [
34
- currentTipId = null,
35
- nextTipId = null,
36
- ] = nonDismissedTips;
33
+ const [ currentTipId = null, nextTipId = null ] =
34
+ nonDismissedTips;
37
35
  return { tipIds, currentTipId, nextTipId };
38
36
  }
39
37
  }