@wordpress/nux 9.8.3 → 9.8.5

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.
@@ -58,18 +58,14 @@ function DotTip({
58
58
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
59
59
  children: children
60
60
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
61
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
62
- // TODO: Switch to `true` (40px size) if possible
63
- , {
64
- __next40pxDefaultSize: false,
61
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
62
+ __next40pxDefaultSize: true,
65
63
  variant: "link",
66
64
  onClick: onDismiss,
67
65
  children: hasNextTip ? (0, _i18n.__)('See next tip') : (0, _i18n.__)('Got it')
68
66
  })
69
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button
70
- // TODO: Switch to `true` (40px size) if possible
71
- , {
72
- __next40pxDefaultSize: false,
67
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
68
+ size: "small",
73
69
  className: "nux-dot-tip__disable",
74
70
  icon: _icons.close,
75
71
  label: (0, _i18n.__)('Disable tips'),
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_components","_i18n","_data","_element","_icons","_store","_jsxRuntime","onClick","event","stopPropagation","DotTip","position","children","isVisible","hasNextTip","onDismiss","onDisable","anchorParent","useRef","onFocusOutsideCallback","useCallback","current","contains","relatedTarget","jsxs","Popover","className","focusOnMount","role","__","onFocusOutside","jsx","Button","__next40pxDefaultSize","variant","icon","close","label","_default","exports","default","compose","withSelect","select","tipId","isTipVisible","getAssociatedGuide","nuxStore","associatedGuide","nextTipId","withDispatch","dispatch","dismissTip","disableTips"],"sources":["@wordpress/nux/src/components/dot-tip/index.js"],"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\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\n\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\tonClick={ onDismiss }\n\t\t\t\t>\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\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t__next40pxDefaultSize={ false }\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"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAgD,IAAAO,WAAA,GAAAP,OAAA;AAbhD;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASQ,OAAOA,CAAEC,KAAK,EAAG;EACzB;EACA;EACAA,KAAK,CAACC,eAAe,CAAC,CAAC;AACxB;AAEO,SAASC,MAAMA,CAAE;EACvBC,QAAQ,GAAG,cAAc;EACzBC,QAAQ;EACRC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC;AACD,CAAC,EAAG;EACH,MAAMC,YAAY,GAAG,IAAAC,eAAM,EAAE,IAAK,CAAC;EACnC,MAAMC,sBAAsB,GAAG,IAAAC,oBAAW,EACvCZ,KAAK,IAAM;IACZ,IAAK,CAAES,YAAY,CAACI,OAAO,EAAG;MAC7B;IACD;IACA,IAAKJ,YAAY,CAACI,OAAO,C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,MAAM,EAAE;EAAEC;AAAM,CAAC,KAAM;EACpC,MAAM;IAAEC,YAAY;IAAEC;EAAmB,CAAC,GAAGH,MAAM,CAAEI,YAAS,CAAC;EAC/D,MAAMC,eAAe,GAAGF,kBAAkB,CAAEF,KAAM,CAAC;EACnD,OAAO;IACN/B,SAAS,EAAEgC,YAAY,CAAED,KAAM,CAAC;IAChC9B,UAAU,EAAE,CAAC,EAAIkC,eAAe,IAAIA,eAAe,CAACC,SAAS;EAC9D,CAAC;AACF,CAAE,CAAC,EACH,IAAAC,kBAAY,EAAE,CAAEC,QAAQ,EAAE;EAAEP;AAAM,CAAC,KAAM;EACxC,MAAM;IAAEQ,UAAU;IAAEC;EAAY,CAAC,GAAGF,QAAQ,CAAEJ,YAAS,CAAC;EACxD,OAAO;IACNhC,SAASA,CAAA,EAAG;MACXqC,UAAU,CAAER,KAAM,CAAC;IACpB,CAAC;IACD5B,SAASA,CAAA,EAAG;MACXqC,WAAW,CAAC,CAAC;IACd;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAE3C,MAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","_components","_i18n","_data","_element","_icons","_store","_jsxRuntime","onClick","event","stopPropagation","DotTip","position","children","isVisible","hasNextTip","onDismiss","onDisable","anchorParent","useRef","onFocusOutsideCallback","useCallback","current","contains","relatedTarget","jsxs","Popover","className","focusOnMount","role","__","onFocusOutside","jsx","Button","__next40pxDefaultSize","variant","size","icon","close","label","_default","exports","default","compose","withSelect","select","tipId","isTipVisible","getAssociatedGuide","nuxStore","associatedGuide","nextTipId","withDispatch","dispatch","dismissTip","disableTips"],"sources":["@wordpress/nux/src/components/dot-tip/index.js"],"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\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\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\tonClick={ onDismiss }\n\t\t\t\t>\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\tsize=\"small\"\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"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAgD,IAAAO,WAAA,GAAAP,OAAA;AAbhD;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASQ,OAAOA,CAAEC,KAAK,EAAG;EACzB;EACA;EACAA,KAAK,CAACC,eAAe,CAAC,CAAC;AACxB;AAEO,SAASC,MAAMA,CAAE;EACvBC,QAAQ,GAAG,cAAc;EACzBC,QAAQ;EACRC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC;AACD,CAAC,EAAG;EACH,MAAMC,YAAY,GAAG,IAAAC,eAAM,EAAE,IAAK,CAAC;EACnC,MAAMC,sBAAsB,GAAG,IAAAC,oBAAW,EACvCZ,KAAK,IAAM;IACZ,IAAK,CAAES,YAAY,CAACI,OAAO,EAAG;MAC7B;IACD;IACA,IAAKJ,YAAY,CAACI,OAAO,CAACC,QAAQ,CAAEd,KAAK,CAACe,aAAc,CAAC,EAAG;MAC3D;IACD;IACAP,SAAS,CAAC,CAAC;EACZ,CAAC,EACD,CAAEA,SAAS,EAAEC,YAAY,CAC1B,CAAC;EACD,IAAK,CAAEJ,SAAS,EAAG;IACl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,YAAY,CAAED,KAAM,CAAC;IAChC/B,UAAU,EAAE,CAAC,EAAImC,eAAe,IAAIA,eAAe,CAACC,SAAS;EAC9D,CAAC;AACF,CAAE,CAAC,EACH,IAAAC,kBAAY,EAAE,CAAEC,QAAQ,EAAE;EAAEP;AAAM,CAAC,KAAM;EACxC,MAAM;IAAEQ,UAAU;IAAEC;EAAY,CAAC,GAAGF,QAAQ,CAAEJ,YAAS,CAAC;EACxD,OAAO;IACNjC,SAASA,CAAA,EAAG;MACXsC,UAAU,CAAER,KAAM,CAAC;IACpB,CAAC;IACD7B,SAASA,CAAA,EAAG;MACXsC,WAAW,CAAC,CAAC;IACd;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAE5C,MAAO,CAAC","ignoreList":[]}
@@ -51,18 +51,14 @@ export function DotTip({
51
51
  children: [/*#__PURE__*/_jsx("p", {
52
52
  children: children
53
53
  }), /*#__PURE__*/_jsx("p", {
54
- children: /*#__PURE__*/_jsx(Button
55
- // TODO: Switch to `true` (40px size) if possible
56
- , {
57
- __next40pxDefaultSize: false,
54
+ children: /*#__PURE__*/_jsx(Button, {
55
+ __next40pxDefaultSize: true,
58
56
  variant: "link",
59
57
  onClick: onDismiss,
60
58
  children: hasNextTip ? __('See next tip') : __('Got it')
61
59
  })
62
- }), /*#__PURE__*/_jsx(Button
63
- // TODO: Switch to `true` (40px size) if possible
64
- , {
65
- __next40pxDefaultSize: false,
60
+ }), /*#__PURE__*/_jsx(Button, {
61
+ size: "small",
66
62
  className: "nux-dot-tip__disable",
67
63
  icon: close,
68
64
  label: __('Disable tips'),
@@ -1 +1 @@
1
- {"version":3,"names":["compose","Popover","Button","__","withSelect","withDispatch","useCallback","useRef","close","store","nuxStore","jsx","_jsx","jsxs","_jsxs","onClick","event","stopPropagation","DotTip","position","children","isVisible","hasNextTip","onDismiss","onDisable","anchorParent","onFocusOutsideCallback","current","contains","relatedTarget","className","focusOnMount","role","onFocusOutside","__next40pxDefaultSize","variant","icon","label","select","tipId","isTipVisible","getAssociatedGuide","associatedGuide","nextTipId","dispatch","dismissTip","disableTips"],"sources":["@wordpress/nux/src/components/dot-tip/index.js"],"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\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\n\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\tonClick={ onDismiss }\n\t\t\t\t>\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\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t__next40pxDefaultSize={ false }\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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,OAAO,EAAEC,MAAM,QAAQ,uBAAuB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;AACxD,SAASC,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,QAAQ,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEhD,SAASC,OAAOA,CAAEC,KAAK,EAAG;EACzB;EACA;EACAA,KAAK,CAACC,eAAe,CAAC,CAAC;AACxB;AAEA,OAAO,SAASC,MAAMA,CAAE;EACvBC,QAAQ,GAAG,cAA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AEA,eAAexB,OAAO,CACrBI,UAAU,CAAE,CAAEkC,MAAM,EAAE;EAAEC;AAAM,CAAC,KAAM;EACpC,MAAM;IAAEC,YAAY;IAAEC;EAAmB,CAAC,GAAGH,MAAM,CAAE5B,QAAS,CAAC;EAC/D,MAAMgC,eAAe,GAAGD,kBAAkB,CAAEF,KAAM,CAAC;EACnD,OAAO;IACNlB,SAAS,EAAEmB,YAAY,CAAED,KAAM,CAAC;IAChCjB,UAAU,EAAE,CAAC,EAAIoB,eAAe,IAAIA,eAAe,CAACC,SAAS;EAC9D,CAAC;AACF,CAAE,CAAC,EACHtC,YAAY,CAAE,CAAEuC,QAAQ,EAAE;EAAEL;AAAM,CAAC,KAAM;EACxC,MAAM;IAAEM,UAAU;IAAEC;EAAY,CAAC,GAAGF,QAAQ,CAAElC,QAAS,CAAC;EACxD,OAAO;IACNa,SAASA,CAAA,EAAG;MACXsB,UAAU,CAAEN,KAAM,CAAC;IACpB,CAAC;IACDf,SAASA,CAAA,EAAG;MACXsB,WAAW,CAAC,CAAC;IACd;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAE5B,MAAO,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["compose","Popover","Button","__","withSelect","withDispatch","useCallback","useRef","close","store","nuxStore","jsx","_jsx","jsxs","_jsxs","onClick","event","stopPropagation","DotTip","position","children","isVisible","hasNextTip","onDismiss","onDisable","anchorParent","onFocusOutsideCallback","current","contains","relatedTarget","className","focusOnMount","role","onFocusOutside","__next40pxDefaultSize","variant","size","icon","label","select","tipId","isTipVisible","getAssociatedGuide","associatedGuide","nextTipId","dispatch","dismissTip","disableTips"],"sources":["@wordpress/nux/src/components/dot-tip/index.js"],"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\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\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\tonClick={ onDismiss }\n\t\t\t\t>\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\tsize=\"small\"\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"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,OAAO,EAAEC,MAAM,QAAQ,uBAAuB;AACvD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,WAAW,EAAEC,MAAM,QAAQ,oBAAoB;AACxD,SAASC,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,QAAQ,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEhD,SAASC,OAAOA,CAAEC,KAAK,EAAG;EACzB;EACA;EACAA,KAAK,CAACC,eAAe,CAAC,CAAC;AACxB;AAEA,OAAO,SAASC,MAAMA,CAAE;EACvBC,QAAQ,GAAG,cAAc;EACzBC,QAAQ;EACRC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC;AACD,CAAC,EAAG;EACH,MAAMC,YAAY,GAAGlB,MAAM,CAAE,IAAK,CAAC;EACnC,MAAMmB,sBAAsB,GAAGpB,WAAW,CACvCU,KAAK,IAAM;IACZ,IAAK,CAAES,YAAY,CAACE,OAAO,EAAG;MAC7B;IACD;IACA,IAAKF,YAAY,CAACE,OAAO,CAACC,QAAQ,CAAEZ,KAAK,CAACa,aAAc,CAAC,EAAG;MAC3D;IACD;IACAL,SAAS,CAAC,CAAC;EACZ,CA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AAEwC,QAAQ,EAAE;EAAEL;AAAM,CAAC,KAAM;EACxC,MAAM;IAAEM,UAAU;IAAEC;EAAY,CAAC,GAAGF,QAAQ,CAAEnC,QAAS,CAAC;EACxD,OAAO;IACNa,SAASA,CAAA,EAAG;MACXuB,UAAU,CAAEN,KAAM,CAAC;IACpB,CAAC;IACDhB,SAASA,CAAA,EAAG;MACXuB,WAAW,CAAC,CAAC;IACd;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAE7B,MAAO,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/nux",
3
- "version": "9.8.3",
3
+ "version": "9.8.5",
4
4
  "description": "NUX (New User eXperience) module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,7 +32,7 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.16.0",
35
- "@wordpress/components": "^28.8.3",
35
+ "@wordpress/components": "^28.8.5",
36
36
  "@wordpress/compose": "^7.8.3",
37
37
  "@wordpress/data": "^10.8.3",
38
38
  "@wordpress/deprecated": "^4.8.2",
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "6187079697e13c3292eb098d6338523a6676c6e8"
50
+ "gitHead": "21b3c2e9abda74edab42455041edc6e82fccc388"
51
51
  }
@@ -57,8 +57,7 @@ export function DotTip( {
57
57
  <p>{ children }</p>
58
58
  <p>
59
59
  <Button
60
- // TODO: Switch to `true` (40px size) if possible
61
- __next40pxDefaultSize={ false }
60
+ __next40pxDefaultSize
62
61
  variant="link"
63
62
  onClick={ onDismiss }
64
63
  >
@@ -66,8 +65,7 @@ export function DotTip( {
66
65
  </Button>
67
66
  </p>
68
67
  <Button
69
- // TODO: Switch to `true` (40px size) if possible
70
- __next40pxDefaultSize={ false }
68
+ size="small"
71
69
  className="nux-dot-tip__disable"
72
70
  icon={ close }
73
71
  label={ __( 'Disable tips' ) }
@@ -19,7 +19,7 @@ exports[`DotTip should render correctly 1`] = `
19
19
  </p>
20
20
  <p>
21
21
  <button
22
- class="components-button is-link"
22
+ class="components-button is-next-40px-default-size is-link"
23
23
  type="button"
24
24
  >
25
25
  Got it
@@ -27,7 +27,7 @@ exports[`DotTip should render correctly 1`] = `
27
27
  </p>
28
28
  <button
29
29
  aria-label="Disable tips"
30
- class="components-button nux-dot-tip__disable has-icon"
30
+ class="components-button nux-dot-tip__disable is-small has-icon"
31
31
  type="button"
32
32
  >
33
33
  <svg