@wordpress/nux 9.32.0 → 9.32.1-next.ff1cebbba.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/build/components/dot-tip/index.js +104 -89
- package/build/components/dot-tip/index.js.map +7 -1
- package/build/index.js +43 -27
- package/build/index.js.map +7 -1
- package/build/store/actions.js +36 -43
- package/build/store/actions.js.map +7 -1
- package/build/store/index.js +47 -39
- package/build/store/index.js.map +7 -1
- package/build/store/reducer.js +37 -53
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +47 -63
- package/build/store/selectors.js.map +7 -1
- package/build-module/components/dot-tip/index.js +82 -82
- package/build-module/components/dot-tip/index.js.map +7 -1
- package/build-module/index.js +12 -11
- package/build-module/index.js.map +7 -1
- package/build-module/store/actions.js +15 -39
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/index.js +12 -27
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/reducer.js +17 -49
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +25 -58
- package/build-module/store/selectors.js.map +7 -1
- package/build-style/style-rtl.css +0 -154
- package/build-style/style.css +0 -154
- package/package.json +18 -10
- package/src/components/dot-tip/style.scss +5 -0
- package/src/style.scss +1 -1
|
@@ -1,104 +1,119 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var dot_tip_exports = {};
|
|
19
|
+
__export(dot_tip_exports, {
|
|
20
|
+
DotTip: () => DotTip,
|
|
21
|
+
default: () => dot_tip_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
23
|
+
module.exports = __toCommonJS(dot_tip_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_compose = require("@wordpress/compose");
|
|
26
|
+
var import_components = require("@wordpress/components");
|
|
27
|
+
var import_i18n = require("@wordpress/i18n");
|
|
28
|
+
var import_data = require("@wordpress/data");
|
|
29
|
+
var import_element = require("@wordpress/element");
|
|
30
|
+
var import_icons = require("@wordpress/icons");
|
|
31
|
+
var import_store = require("../../store");
|
|
24
32
|
function onClick(event) {
|
|
25
|
-
// Tips are often nested within buttons. We stop propagation so that clicking
|
|
26
|
-
// on a tip doesn't result in the button being clicked.
|
|
27
33
|
event.stopPropagation();
|
|
28
34
|
}
|
|
29
35
|
function DotTip({
|
|
30
|
-
position =
|
|
36
|
+
position = "middle right",
|
|
31
37
|
children,
|
|
32
38
|
isVisible,
|
|
33
39
|
hasNextTip,
|
|
34
40
|
onDismiss,
|
|
35
41
|
onDisable
|
|
36
42
|
}) {
|
|
37
|
-
const anchorParent = (0,
|
|
38
|
-
const onFocusOutsideCallback = (0,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const anchorParent = (0, import_element.useRef)(null);
|
|
44
|
+
const onFocusOutsideCallback = (0, import_element.useCallback)(
|
|
45
|
+
(event) => {
|
|
46
|
+
if (!anchorParent.current) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (anchorParent.current.contains(event.relatedTarget)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
onDisable();
|
|
53
|
+
},
|
|
54
|
+
[onDisable, anchorParent]
|
|
55
|
+
);
|
|
47
56
|
if (!isVisible) {
|
|
48
57
|
return null;
|
|
49
58
|
}
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
} = select(_store.store);
|
|
83
|
-
const associatedGuide = getAssociatedGuide(tipId);
|
|
84
|
-
return {
|
|
85
|
-
isVisible: isTipVisible(tipId),
|
|
86
|
-
hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
|
|
87
|
-
};
|
|
88
|
-
}), (0, _data.withDispatch)((dispatch, {
|
|
89
|
-
tipId
|
|
90
|
-
}) => {
|
|
91
|
-
const {
|
|
92
|
-
dismissTip,
|
|
93
|
-
disableTips
|
|
94
|
-
} = dispatch(_store.store);
|
|
95
|
-
return {
|
|
96
|
-
onDismiss() {
|
|
97
|
-
dismissTip(tipId);
|
|
98
|
-
},
|
|
99
|
-
onDisable() {
|
|
100
|
-
disableTips();
|
|
59
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
60
|
+
import_components.Popover,
|
|
61
|
+
{
|
|
62
|
+
className: "nux-dot-tip",
|
|
63
|
+
position,
|
|
64
|
+
focusOnMount: true,
|
|
65
|
+
role: "dialog",
|
|
66
|
+
"aria-label": (0, import_i18n.__)("Editor tips"),
|
|
67
|
+
onClick,
|
|
68
|
+
onFocusOutside: onFocusOutsideCallback,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
|
+
import_components.Button,
|
|
73
|
+
{
|
|
74
|
+
__next40pxDefaultSize: true,
|
|
75
|
+
variant: "link",
|
|
76
|
+
onClick: onDismiss,
|
|
77
|
+
children: hasNextTip ? (0, import_i18n.__)("See next tip") : (0, import_i18n.__)("Got it")
|
|
78
|
+
}
|
|
79
|
+
) }),
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
81
|
+
import_components.Button,
|
|
82
|
+
{
|
|
83
|
+
size: "small",
|
|
84
|
+
className: "nux-dot-tip__disable",
|
|
85
|
+
icon: import_icons.close,
|
|
86
|
+
label: (0, import_i18n.__)("Disable tips"),
|
|
87
|
+
onClick: onDisable
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
]
|
|
101
91
|
}
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
var dot_tip_default = (0, import_compose.compose)(
|
|
95
|
+
(0, import_data.withSelect)((select, { tipId }) => {
|
|
96
|
+
const { isTipVisible, getAssociatedGuide } = select(import_store.store);
|
|
97
|
+
const associatedGuide = getAssociatedGuide(tipId);
|
|
98
|
+
return {
|
|
99
|
+
isVisible: isTipVisible(tipId),
|
|
100
|
+
hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
|
|
101
|
+
};
|
|
102
|
+
}),
|
|
103
|
+
(0, import_data.withDispatch)((dispatch, { tipId }) => {
|
|
104
|
+
const { dismissTip, disableTips } = dispatch(import_store.store);
|
|
105
|
+
return {
|
|
106
|
+
onDismiss() {
|
|
107
|
+
dismissTip(tipId);
|
|
108
|
+
},
|
|
109
|
+
onDisable() {
|
|
110
|
+
disableTips();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
})
|
|
114
|
+
)(DotTip);
|
|
115
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
+
0 && (module.exports = {
|
|
117
|
+
DotTip
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/dot-tip/index.js"],
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CE;AA5CF,qBAAwB;AACxB,wBAAgC;AAChC,kBAAmB;AACnB,kBAAyC;AACzC,qBAAoC;AACpC,mBAAsB;AAKtB,mBAAkC;AAElC,SAAS,QAAS,OAAQ;AAGzB,QAAM,gBAAgB;AACvB;AAEO,SAAS,OAAQ;AAAA,EACvB,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,mBAAe,uBAAQ,IAAK;AAClC,QAAM,6BAAyB;AAAA,IAC9B,CAAE,UAAW;AACZ,UAAK,CAAE,aAAa,SAAU;AAC7B;AAAA,MACD;AACA,UAAK,aAAa,QAAQ,SAAU,MAAM,aAAc,GAAI;AAC3D;AAAA,MACD;AACA,gBAAU;AAAA,IACX;AAAA,IACA,CAAE,WAAW,YAAa;AAAA,EAC3B;AACA,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV;AAAA,MACA,cAAY;AAAA,MACZ,MAAK;AAAA,MACL,kBAAa,gBAAI,aAAc;AAAA,MAC/B;AAAA,MACA,gBAAiB;AAAA,MAEjB;AAAA,oDAAC,OAAI,UAAU;AAAA,QACf,4CAAC,OACA;AAAA,UAAC;AAAA;AAAA,YACA,uBAAqB;AAAA,YACrB,SAAQ;AAAA,YACR,SAAU;AAAA,YAER,2BAAa,gBAAI,cAAe,QAAI,gBAAI,QAAS;AAAA;AAAA,QACpD,GACD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,MAAK;AAAA,YACL,WAAU;AAAA,YACV,MAAO;AAAA,YACP,WAAQ,gBAAI,cAAe;AAAA,YAC3B,SAAU;AAAA;AAAA,QACX;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,sBAAQ;AAAA,MACd,wBAAY,CAAE,QAAQ,EAAE,MAAM,MAAO;AACpC,UAAM,EAAE,cAAc,mBAAmB,IAAI,OAAQ,aAAAA,KAAS;AAC9D,UAAM,kBAAkB,mBAAoB,KAAM;AAClD,WAAO;AAAA,MACN,WAAW,aAAc,KAAM;AAAA,MAC/B,YAAY,CAAC,EAAI,mBAAmB,gBAAgB;AAAA,IACrD;AAAA,EACD,CAAE;AAAA,MACF,0BAAc,CAAE,UAAU,EAAE,MAAM,MAAO;AACxC,UAAM,EAAE,YAAY,YAAY,IAAI,SAAU,aAAAA,KAAS;AACvD,WAAO;AAAA,MACN,YAAY;AACX,mBAAY,KAAM;AAAA,MACnB;AAAA,MACA,YAAY;AACX,oBAAY;AAAA,MACb;AAAA,IACD;AAAA,EACD,CAAE;AACH,EAAG,MAAO;",
|
|
6
|
+
"names": ["nuxStore"]
|
|
7
|
+
}
|
package/build/index.js
CHANGED
|
@@ -1,31 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
16
|
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var index_exports = {};
|
|
29
|
+
__export(index_exports, {
|
|
30
|
+
DotTip: () => import_dot_tip.default,
|
|
31
|
+
store: () => import_store.store
|
|
12
32
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
module.exports = __toCommonJS(index_exports);
|
|
34
|
+
var import_deprecated = __toESM(require("@wordpress/deprecated"));
|
|
35
|
+
var import_store = require("./store");
|
|
36
|
+
var import_dot_tip = __toESM(require("./components/dot-tip"));
|
|
37
|
+
(0, import_deprecated.default)("wp.nux", {
|
|
38
|
+
since: "5.4",
|
|
39
|
+
hint: "wp.components.Guide can be used to show a user guide.",
|
|
40
|
+
version: "6.2"
|
|
18
41
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* WordPress dependencies
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
(0, _deprecated.default)('wp.nux', {
|
|
27
|
-
since: '5.4',
|
|
28
|
-
hint: 'wp.components.Guide can be used to show a user guide.',
|
|
29
|
-
version: '6.2'
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
DotTip,
|
|
45
|
+
store
|
|
30
46
|
});
|
|
31
|
-
//# sourceMappingURL=index.js.map
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\nexport { store } from './store';\nexport { default as DotTip } from './components/dot-tip';\n\ndeprecated( 'wp.nux', {\n\tsince: '5.4',\n\thint: 'wp.components.Guide can be used to show a user guide.',\n\tversion: '6.2',\n} );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuB;AAEvB,mBAAsB;AACtB,qBAAkC;AAAA,IAElC,kBAAAA,SAAY,UAAU;AAAA,EACrB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AACV,CAAE;",
|
|
6
|
+
"names": ["deprecated"]
|
|
7
|
+
}
|
package/build/store/actions.js
CHANGED
|
@@ -1,62 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var actions_exports = {};
|
|
19
|
+
__export(actions_exports, {
|
|
20
|
+
disableTips: () => disableTips,
|
|
21
|
+
dismissTip: () => dismissTip,
|
|
22
|
+
enableTips: () => enableTips,
|
|
23
|
+
triggerGuide: () => triggerGuide
|
|
5
24
|
});
|
|
6
|
-
exports
|
|
7
|
-
exports.dismissTip = dismissTip;
|
|
8
|
-
exports.enableTips = enableTips;
|
|
9
|
-
exports.triggerGuide = triggerGuide;
|
|
10
|
-
/**
|
|
11
|
-
* Returns an action object that, when dispatched, presents a guide that takes
|
|
12
|
-
* the user through a series of tips step by step.
|
|
13
|
-
*
|
|
14
|
-
* @param {string[]} tipIds Which tips to show in the guide.
|
|
15
|
-
*
|
|
16
|
-
* @return {Object} Action object.
|
|
17
|
-
*/
|
|
25
|
+
module.exports = __toCommonJS(actions_exports);
|
|
18
26
|
function triggerGuide(tipIds) {
|
|
19
27
|
return {
|
|
20
|
-
type:
|
|
28
|
+
type: "TRIGGER_GUIDE",
|
|
21
29
|
tipIds
|
|
22
30
|
};
|
|
23
31
|
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Returns an action object that, when dispatched, dismisses the given tip. A
|
|
27
|
-
* dismissed tip will not show again.
|
|
28
|
-
*
|
|
29
|
-
* @param {string} id The tip to dismiss.
|
|
30
|
-
*
|
|
31
|
-
* @return {Object} Action object.
|
|
32
|
-
*/
|
|
33
32
|
function dismissTip(id) {
|
|
34
33
|
return {
|
|
35
|
-
type:
|
|
34
|
+
type: "DISMISS_TIP",
|
|
36
35
|
id
|
|
37
36
|
};
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Returns an action object that, when dispatched, prevents all tips from
|
|
42
|
-
* showing again.
|
|
43
|
-
*
|
|
44
|
-
* @return {Object} Action object.
|
|
45
|
-
*/
|
|
46
38
|
function disableTips() {
|
|
47
39
|
return {
|
|
48
|
-
type:
|
|
40
|
+
type: "DISABLE_TIPS"
|
|
49
41
|
};
|
|
50
42
|
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Returns an action object that, when dispatched, makes all tips show again.
|
|
54
|
-
*
|
|
55
|
-
* @return {Object} Action object.
|
|
56
|
-
*/
|
|
57
43
|
function enableTips() {
|
|
58
44
|
return {
|
|
59
|
-
type:
|
|
45
|
+
type: "ENABLE_TIPS"
|
|
60
46
|
};
|
|
61
47
|
}
|
|
62
|
-
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
disableTips,
|
|
51
|
+
dismissTip,
|
|
52
|
+
enableTips,
|
|
53
|
+
triggerGuide
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/actions.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Returns an action object that, when dispatched, presents a guide that takes\n * the user through a series of tips step by step.\n *\n * @param {string[]} tipIds Which tips to show in the guide.\n *\n * @return {Object} Action object.\n */\nexport function triggerGuide( tipIds ) {\n\treturn {\n\t\ttype: 'TRIGGER_GUIDE',\n\t\ttipIds,\n\t};\n}\n\n/**\n * Returns an action object that, when dispatched, dismisses the given tip. A\n * dismissed tip will not show again.\n *\n * @param {string} id The tip to dismiss.\n *\n * @return {Object} Action object.\n */\nexport function dismissTip( id ) {\n\treturn {\n\t\ttype: 'DISMISS_TIP',\n\t\tid,\n\t};\n}\n\n/**\n * Returns an action object that, when dispatched, prevents all tips from\n * showing again.\n *\n * @return {Object} Action object.\n */\nexport function disableTips() {\n\treturn {\n\t\ttype: 'DISABLE_TIPS',\n\t};\n}\n\n/**\n * Returns an action object that, when dispatched, makes all tips show again.\n *\n * @return {Object} Action object.\n */\nexport function enableTips() {\n\treturn {\n\t\ttype: 'ENABLE_TIPS',\n\t};\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,aAAc,QAAS;AACtC,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAUO,SAAS,WAAY,IAAK;AAChC,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAQO,SAAS,cAAc;AAC7B,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;AAOO,SAAS,aAAa;AAC5B,SAAO;AAAA,IACN,MAAM;AAAA,EACP;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/store/index.js
CHANGED
|
@@ -1,46 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var store_exports = {};
|
|
29
|
+
__export(store_exports, {
|
|
30
|
+
store: () => store
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var actions =
|
|
11
|
-
var selectors =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal dependencies
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
const STORE_NAME = 'core/nux';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Store definition for the nux namespace.
|
|
26
|
-
*
|
|
27
|
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
|
|
28
|
-
*
|
|
29
|
-
* @type {Object}
|
|
30
|
-
*/
|
|
31
|
-
const store = exports.store = (0, _data.createReduxStore)(STORE_NAME, {
|
|
32
|
-
reducer: _reducer.default,
|
|
32
|
+
module.exports = __toCommonJS(store_exports);
|
|
33
|
+
var import_data = require("@wordpress/data");
|
|
34
|
+
var import_reducer = __toESM(require("./reducer"));
|
|
35
|
+
var actions = __toESM(require("./actions"));
|
|
36
|
+
var selectors = __toESM(require("./selectors"));
|
|
37
|
+
const STORE_NAME = "core/nux";
|
|
38
|
+
const store = (0, import_data.createReduxStore)(STORE_NAME, {
|
|
39
|
+
reducer: import_reducer.default,
|
|
33
40
|
actions,
|
|
34
41
|
selectors,
|
|
35
|
-
persist: [
|
|
42
|
+
persist: ["preferences"]
|
|
36
43
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// we'd be able to replace this with a register call.
|
|
40
|
-
(0, _data.registerStore)(STORE_NAME, {
|
|
41
|
-
reducer: _reducer.default,
|
|
44
|
+
(0, import_data.registerStore)(STORE_NAME, {
|
|
45
|
+
reducer: import_reducer.default,
|
|
42
46
|
actions,
|
|
43
47
|
selectors,
|
|
44
|
-
persist: [
|
|
48
|
+
persist: ["preferences"]
|
|
45
49
|
});
|
|
46
|
-
|
|
50
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
51
|
+
0 && (module.exports = {
|
|
52
|
+
store
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
package/build/store/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/store/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createReduxStore, registerStore } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\n\nconst STORE_NAME = 'core/nux';\n\n/**\n * Store definition for the nux namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n\tpersist: [ 'preferences' ],\n} );\n\n// Once we build a more generic persistence plugin that works across types of stores\n// we'd be able to replace this with a register call.\nregisterStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n\tpersist: [ 'preferences' ],\n} );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAgD;AAKhD,qBAAoB;AACpB,cAAyB;AACzB,gBAA2B;AAE3B,MAAM,aAAa;AASZ,MAAM,YAAQ,8BAAkB,YAAY;AAAA,EAClD,wBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,CAAE,aAAc;AAC1B,CAAE;AAAA,IAIF,2BAAe,YAAY;AAAA,EAC1B,wBAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS,CAAE,aAAc;AAC1B,CAAE;",
|
|
6
|
+
"names": ["reducer"]
|
|
7
|
+
}
|