@wordpress/nux 8.4.6 → 8.5.1
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
|
@@ -5,11 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.DotTip = DotTip;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var
|
|
8
|
+
var _react = require("react");
|
|
9
9
|
var _compose = require("@wordpress/compose");
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _data = require("@wordpress/data");
|
|
13
|
+
var _element = require("@wordpress/element");
|
|
13
14
|
var _icons = require("@wordpress/icons");
|
|
14
15
|
var _store = require("../../store");
|
|
15
16
|
/**
|
|
@@ -46,7 +47,7 @@ function DotTip({
|
|
|
46
47
|
if (!isVisible) {
|
|
47
48
|
return null;
|
|
48
49
|
}
|
|
49
|
-
return (0,
|
|
50
|
+
return (0, _react.createElement)(_components.Popover, {
|
|
50
51
|
className: "nux-dot-tip",
|
|
51
52
|
position: position,
|
|
52
53
|
focusOnMount: true,
|
|
@@ -54,10 +55,10 @@ function DotTip({
|
|
|
54
55
|
"aria-label": (0, _i18n.__)('Editor tips'),
|
|
55
56
|
onClick: onClick,
|
|
56
57
|
onFocusOutside: onFocusOutsideCallback
|
|
57
|
-
}, (0,
|
|
58
|
+
}, (0, _react.createElement)("p", null, children), (0, _react.createElement)("p", null, (0, _react.createElement)(_components.Button, {
|
|
58
59
|
variant: "link",
|
|
59
60
|
onClick: onDismiss
|
|
60
|
-
}, hasNextTip ? (0, _i18n.__)('See next tip') : (0, _i18n.__)('Got it'))), (0,
|
|
61
|
+
}, hasNextTip ? (0, _i18n.__)('See next tip') : (0, _i18n.__)('Got it'))), (0, _react.createElement)(_components.Button, {
|
|
61
62
|
className: "nux-dot-tip__disable",
|
|
62
63
|
icon: _icons.close,
|
|
63
64
|
label: (0, _i18n.__)('Disable tips'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_compose","require","_components","_i18n","_data","_element","_icons","_store","onClick","event","stopPropagation","DotTip","position","children","isVisible","hasNextTip","onDismiss","onDisable","anchorParent","useRef","onFocusOutsideCallback","useCallback","current","contains","relatedTarget","_react","createElement","Popover","className","focusOnMount","role","__","onFocusOutside","Button","variant","icon","close","label","_default","compose","withSelect","select","tipId","isTipVisible","getAssociatedGuide","nuxStore","associatedGuide","nextTipId","withDispatch","dispatch","dismissTip","disableTips","exports","default"],"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 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"],"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;AAbA;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASO,OAAOA,CAAEC,KAAK,EAAG;EACzB;EACA;EACAA,KAAK,CAACC,eAAe,CAAC,CAAC;AACxB;AAEO,SAASC,MAAMA,CAAE;EACvB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AAGS;EAAW,CACrB,CACO,CAAC;AAEZ;AAAC,IAAAqB,QAAA,GAEc,IAAAC,gBAAO,EACrB,IAAAC,gBAAU,EAAE,CAAEC,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;IACN5B,SAAS,EAAE6B,YAAY,CAAED,KAAM,CAAC;IAChC3B,UAAU,EAAE,CAAC,EAAI+B,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;IACN7B,SAASA,CAAA,EAAG;MACXkC,UAAU,CAAER,KAAM,CAAC;IACpB,CAAC;IACDzB,SAASA,CAAA,EAAG;MACXkC,WAAW,CAAC,CAAC;IACd;EACD,CAAC;AACF,CAAE,CACH,CAAC,CAAExC,MAAO,CAAC;AAAAyC,OAAA,CAAAC,OAAA,GAAAf,QAAA"}
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
--wp-block-synced-color: #7a00df;
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
99
|
}
|
|
100
|
-
@media (min-resolution: 192dpi) {
|
|
100
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
101
101
|
:root {
|
|
102
102
|
--wp-admin-border-width-focus: 1.5px;
|
|
103
103
|
}
|
package/build-style/style.css
CHANGED
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
--wp-block-synced-color: #7a00df;
|
|
98
98
|
--wp-block-synced-color--rgb: 122, 0, 223;
|
|
99
99
|
}
|
|
100
|
-
@media (min-resolution: 192dpi) {
|
|
100
|
+
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
101
101
|
:root {
|
|
102
102
|
--wp-admin-border-width-focus: 1.5px;
|
|
103
103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/nux",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.1",
|
|
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,13 +31,13 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/components": "^25.
|
|
35
|
-
"@wordpress/compose": "^6.
|
|
36
|
-
"@wordpress/data": "^9.
|
|
37
|
-
"@wordpress/deprecated": "^3.
|
|
38
|
-
"@wordpress/element": "^5.
|
|
39
|
-
"@wordpress/i18n": "^4.
|
|
40
|
-
"@wordpress/icons": "^9.
|
|
34
|
+
"@wordpress/components": "^25.9.1",
|
|
35
|
+
"@wordpress/compose": "^6.20.0",
|
|
36
|
+
"@wordpress/data": "^9.13.1",
|
|
37
|
+
"@wordpress/deprecated": "^3.43.0",
|
|
38
|
+
"@wordpress/element": "^5.20.0",
|
|
39
|
+
"@wordpress/i18n": "^4.43.0",
|
|
40
|
+
"@wordpress/icons": "^9.34.0",
|
|
41
41
|
"rememo": "^4.0.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "e17f760ed0dc11cce78157d7c2f2086b1b3c09d8"
|
|
51
51
|
}
|