@wordpress/interface 9.16.1-next.f56bd8138.0 → 9.17.1-next.47f435fc9.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 +2 -0
- package/build/components/action-item/index.js +68 -66
- package/build/components/action-item/index.js.map +7 -1
- package/build/components/complementary-area/index.js +215 -194
- package/build/components/complementary-area/index.js.map +7 -1
- package/build/components/complementary-area-header/index.js +53 -33
- package/build/components/complementary-area-header/index.js.map +7 -1
- package/build/components/complementary-area-more-menu-item/index.js +60 -39
- package/build/components/complementary-area-more-menu-item/index.js.map +7 -1
- package/build/components/complementary-area-toggle/index.js +61 -50
- package/build/components/complementary-area-toggle/index.js.map +7 -1
- package/build/components/fullscreen-mode/index.js +33 -27
- package/build/components/fullscreen-mode/index.js.map +7 -1
- package/build/components/index.js +52 -55
- package/build/components/index.js.map +7 -1
- package/build/components/interface-skeleton/index.js +156 -132
- package/build/components/interface-skeleton/index.js.map +7 -1
- package/build/components/pinned-items/index.js +48 -39
- package/build/components/pinned-items/index.js.map +7 -1
- package/build/index.js +27 -24
- package/build/index.js.map +7 -1
- package/build/store/actions.js +94 -165
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -12
- package/build/store/constants.js.map +7 -1
- package/build/store/deprecated.js +55 -29
- package/build/store/deprecated.js.map +7 -1
- package/build/store/index.js +44 -32
- package/build/store/index.js.map +7 -1
- package/build/store/reducer.js +49 -51
- package/build/store/reducer.js.map +7 -1
- package/build/store/selectors.js +96 -93
- package/build/store/selectors.js.map +7 -1
- package/build-module/components/action-item/index.js +49 -59
- package/build-module/components/action-item/index.js.map +7 -1
- package/build-module/components/complementary-area/index.js +185 -174
- package/build-module/components/complementary-area/index.js.map +7 -1
- package/build-module/components/complementary-area-header/index.js +25 -26
- package/build-module/components/complementary-area-header/index.js.map +7 -1
- package/build-module/components/complementary-area-more-menu-item/index.js +33 -33
- package/build-module/components/complementary-area-more-menu-item/index.js.map +7 -1
- package/build-module/components/complementary-area-toggle/index.js +41 -44
- package/build-module/components/complementary-area-toggle/index.js.map +7 -1
- package/build-module/components/fullscreen-mode/index.js +13 -19
- package/build-module/components/fullscreen-mode/index.js.map +7 -1
- package/build-module/components/index.js +15 -8
- package/build-module/components/index.js.map +7 -1
- package/build-module/components/interface-skeleton/index.js +132 -122
- package/build-module/components/interface-skeleton/index.js.map +7 -1
- package/build-module/components/pinned-items/index.js +20 -32
- package/build-module/components/pinned-items/index.js.map +7 -1
- package/build-module/index.js +6 -3
- package/build-module/index.js.map +7 -1
- package/build-module/store/actions.js +47 -138
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -7
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/deprecated.js +21 -20
- package/build-module/store/deprecated.js.map +7 -1
- package/build-module/store/index.js +10 -22
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/reducer.js +28 -45
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/selectors.js +64 -87
- package/build-module/store/selectors.js.map +7 -1
- package/build-style/style-rtl.css +87 -85
- package/build-style/style.css +87 -85
- package/package.json +21 -15
- package/src/components/complementary-area/style.scss +5 -0
- package/src/components/complementary-area-header/style.scss +3 -0
- package/src/components/fullscreen-mode/style.scss +3 -0
- package/src/components/index.js +0 -1
- package/src/components/interface-skeleton/index.js +1 -5
- package/src/components/interface-skeleton/style.scss +6 -0
- package/src/components/pinned-items/style.scss +3 -0
- package/src/style.scss +6 -5
- package/build/components/index.native.js +0 -21
- package/build/components/index.native.js.map +0 -1
- package/build/components/navigable-region/index.js +0 -38
- package/build/components/navigable-region/index.js.map +0 -1
- package/build-module/components/index.native.js +0 -3
- package/build-module/components/index.native.js.map +0 -1
- package/build-module/components/navigable-region/index.js +0 -30
- package/build-module/components/navigable-region/index.js.map +0 -1
- package/src/components/navigable-region/README.md +0 -36
- package/src/components/navigable-region/index.js +0 -29
|
@@ -1,40 +1,60 @@
|
|
|
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 complementary_area_header_exports = {};
|
|
29
|
+
__export(complementary_area_header_exports, {
|
|
30
|
+
default: () => complementary_area_header_default
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
/**
|
|
13
|
-
* External dependencies
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
32
|
+
module.exports = __toCommonJS(complementary_area_header_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_clsx = __toESM(require("clsx"));
|
|
35
|
+
var import_icons = require("@wordpress/icons");
|
|
36
|
+
var import_complementary_area_toggle = __toESM(require("../complementary-area-toggle"));
|
|
24
37
|
const ComplementaryAreaHeader = ({
|
|
25
38
|
children,
|
|
26
39
|
className,
|
|
27
40
|
toggleButtonProps
|
|
28
41
|
}) => {
|
|
29
|
-
const toggleButton =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
const toggleButton = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_complementary_area_toggle.default, { icon: import_icons.closeSmall, ...toggleButtonProps });
|
|
43
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: (0, import_clsx.default)(
|
|
47
|
+
"components-panel__header",
|
|
48
|
+
"interface-complementary-area-header",
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
tabIndex: -1,
|
|
52
|
+
children: [
|
|
53
|
+
children,
|
|
54
|
+
toggleButton
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
);
|
|
38
58
|
};
|
|
39
|
-
var
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
|
59
|
+
var complementary_area_header_default = ComplementaryAreaHeader;
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/complementary-area-header/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\n\nconst ComplementaryAreaHeader = ( {\n\tchildren,\n\tclassName,\n\ttoggleButtonProps,\n} ) => {\n\tconst toggleButton = (\n\t\t<ComplementaryAreaToggle icon={ closeSmall } { ...toggleButtonProps } />\n\t);\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'components-panel__header',\n\t\t\t\t'interface-complementary-area-header',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\ttabIndex={ -1 }\n\t\t>\n\t\t\t{ children }\n\t\t\t{ toggleButton }\n\t\t</div>\n\t);\n};\n\nexport default ComplementaryAreaHeader;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBE;AAlBF,kBAAiB;AAKjB,mBAA2B;AAK3B,uCAAoC;AAEpC,MAAM,0BAA0B,CAAE;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM,eACL,4CAAC,iCAAAA,SAAA,EAAwB,MAAO,yBAAe,GAAG,mBAAoB;AAEvE,SACC;AAAA,IAAC;AAAA;AAAA,MACA,eAAY,YAAAC;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MACA,UAAW;AAAA,MAET;AAAA;AAAA,QACA;AAAA;AAAA;AAAA,EACH;AAEF;AAEA,IAAO,oCAAQ;",
|
|
6
|
+
"names": ["ComplementaryAreaToggle", "clsx"]
|
|
7
|
+
}
|
|
@@ -1,23 +1,40 @@
|
|
|
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 complementary_area_more_menu_item_exports = {};
|
|
29
|
+
__export(complementary_area_more_menu_item_exports, {
|
|
30
|
+
default: () => ComplementaryAreaMoreMenuItem
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
/**
|
|
14
|
-
* WordPress dependencies
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Internal dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
32
|
+
module.exports = __toCommonJS(complementary_area_more_menu_item_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_icons = require("@wordpress/icons");
|
|
35
|
+
var import_components = require("@wordpress/components");
|
|
36
|
+
var import_complementary_area_toggle = __toESM(require("../complementary-area-toggle"));
|
|
37
|
+
var import_action_item = __toESM(require("../action-item"));
|
|
21
38
|
const PluginsMenuItem = ({
|
|
22
39
|
// Menu item is marked with unstable prop for backward compatibility.
|
|
23
40
|
// They are removed so they don't leak to DOM elements.
|
|
@@ -25,30 +42,34 @@ const PluginsMenuItem = ({
|
|
|
25
42
|
__unstableExplicitMenuItem,
|
|
26
43
|
__unstableTarget,
|
|
27
44
|
...restProps
|
|
28
|
-
}) =>
|
|
29
|
-
...restProps
|
|
30
|
-
});
|
|
45
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.MenuItem, { ...restProps });
|
|
31
46
|
function ComplementaryAreaMoreMenuItem({
|
|
32
47
|
scope,
|
|
33
48
|
target,
|
|
34
49
|
__unstableExplicitMenuItem,
|
|
35
50
|
...props
|
|
36
51
|
}) {
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
53
|
+
import_complementary_area_toggle.default,
|
|
54
|
+
{
|
|
55
|
+
as: (toggleProps) => {
|
|
56
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
57
|
+
import_action_item.default,
|
|
58
|
+
{
|
|
59
|
+
__unstableExplicitMenuItem,
|
|
60
|
+
__unstableTarget: `${scope}/${target}`,
|
|
61
|
+
as: PluginsMenuItem,
|
|
62
|
+
name: `${scope}/plugin-more-menu`,
|
|
63
|
+
...toggleProps
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
},
|
|
67
|
+
role: "menuitemcheckbox",
|
|
68
|
+
selectedIcon: import_icons.check,
|
|
69
|
+
name: target,
|
|
70
|
+
scope,
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
);
|
|
53
74
|
}
|
|
54
|
-
//# sourceMappingURL=index.js.map
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/complementary-area-more-menu-item/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { check } from '@wordpress/icons';\nimport { MenuItem } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ComplementaryAreaToggle from '../complementary-area-toggle';\nimport ActionItem from '../action-item';\n\nconst PluginsMenuItem = ( {\n\t// Menu item is marked with unstable prop for backward compatibility.\n\t// They are removed so they don't leak to DOM elements.\n\t// @see https://github.com/WordPress/gutenberg/issues/14457\n\t__unstableExplicitMenuItem,\n\t__unstableTarget,\n\t...restProps\n} ) => <MenuItem { ...restProps } />;\n\nexport default function ComplementaryAreaMoreMenuItem( {\n\tscope,\n\ttarget,\n\t__unstableExplicitMenuItem,\n\t...props\n} ) {\n\treturn (\n\t\t<ComplementaryAreaToggle\n\t\t\tas={ ( toggleProps ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ActionItem\n\t\t\t\t\t\t__unstableExplicitMenuItem={\n\t\t\t\t\t\t\t__unstableExplicitMenuItem\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__unstableTarget={ `${ scope }/${ target }` }\n\t\t\t\t\t\tas={ PluginsMenuItem }\n\t\t\t\t\t\tname={ `${ scope }/plugin-more-menu` }\n\t\t\t\t\t\t{ ...toggleProps }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trole=\"menuitemcheckbox\"\n\t\t\tselectedIcon={ check }\n\t\t\tname={ target }\n\t\t\tscope={ scope }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBO;AAhBP,mBAAsB;AACtB,wBAAyB;AAKzB,uCAAoC;AACpC,yBAAuB;AAEvB,MAAM,kBAAkB,CAAE;AAAA;AAAA;AAAA;AAAA,EAIzB;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAO,4CAAC,8BAAW,GAAG,WAAY;AAEnB,SAAR,8BAAgD;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,SACC;AAAA,IAAC,iCAAAA;AAAA,IAAA;AAAA,MACA,IAAK,CAAE,gBAAiB;AACvB,eACC;AAAA,UAAC,mBAAAC;AAAA,UAAA;AAAA,YACA;AAAA,YAGA,kBAAmB,GAAI,KAAM,IAAK,MAAO;AAAA,YACzC,IAAK;AAAA,YACL,MAAO,GAAI,KAAM;AAAA,YACf,GAAG;AAAA;AAAA,QACN;AAAA,MAEF;AAAA,MACA,MAAK;AAAA,MACL,cAAe;AAAA,MACf,MAAO;AAAA,MACP;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;",
|
|
6
|
+
"names": ["ComplementaryAreaToggle", "ActionItem"]
|
|
7
|
+
}
|
|
@@ -1,33 +1,43 @@
|
|
|
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 complementary_area_toggle_exports = {};
|
|
19
|
+
__export(complementary_area_toggle_exports, {
|
|
20
|
+
default: () => ComplementaryAreaToggle
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*
|
|
23
|
-
* @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked
|
|
24
|
-
* @param {import('react').AriaRole} role Role.
|
|
25
|
-
* @return {boolean} Whether the role supports checked state.
|
|
26
|
-
*/function roleSupportsCheckedState(role) {
|
|
27
|
-
return ['checkbox', 'option', 'radio', 'switch', 'menuitemcheckbox', 'menuitemradio', 'treeitem'].includes(role);
|
|
22
|
+
module.exports = __toCommonJS(complementary_area_toggle_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_components = require("@wordpress/components");
|
|
25
|
+
var import_data = require("@wordpress/data");
|
|
26
|
+
var import_plugins = require("@wordpress/plugins");
|
|
27
|
+
var import_store = require("../../store");
|
|
28
|
+
function roleSupportsCheckedState(role) {
|
|
29
|
+
return [
|
|
30
|
+
"checkbox",
|
|
31
|
+
"option",
|
|
32
|
+
"radio",
|
|
33
|
+
"switch",
|
|
34
|
+
"menuitemcheckbox",
|
|
35
|
+
"menuitemradio",
|
|
36
|
+
"treeitem"
|
|
37
|
+
].includes(role);
|
|
28
38
|
}
|
|
29
39
|
function ComplementaryAreaToggle({
|
|
30
|
-
as =
|
|
40
|
+
as = import_components.Button,
|
|
31
41
|
scope,
|
|
32
42
|
identifier: identifierProp,
|
|
33
43
|
icon: iconProp,
|
|
@@ -37,29 +47,30 @@ function ComplementaryAreaToggle({
|
|
|
37
47
|
...props
|
|
38
48
|
}) {
|
|
39
49
|
const ComponentToUse = as;
|
|
40
|
-
const context = (0,
|
|
50
|
+
const context = (0, import_plugins.usePluginContext)();
|
|
41
51
|
const icon = iconProp || context.icon;
|
|
42
52
|
const identifier = identifierProp || `${context.name}/${name}`;
|
|
43
|
-
const isSelected = (0,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
} = (0,
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
const isSelected = (0, import_data.useSelect)(
|
|
54
|
+
(select) => select(import_store.store).getActiveComplementaryArea(scope) === identifier,
|
|
55
|
+
[identifier, scope]
|
|
56
|
+
);
|
|
57
|
+
const { enableComplementaryArea, disableComplementaryArea } = (0, import_data.useDispatch)(import_store.store);
|
|
58
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
ComponentToUse,
|
|
60
|
+
{
|
|
61
|
+
icon: selectedIcon && isSelected ? selectedIcon : icon,
|
|
62
|
+
"aria-controls": identifier.replace("/", ":"),
|
|
63
|
+
"aria-checked": roleSupportsCheckedState(props.role) ? isSelected : void 0,
|
|
64
|
+
onClick: () => {
|
|
65
|
+
if (isSelected) {
|
|
66
|
+
disableComplementaryArea(scope);
|
|
67
|
+
} else {
|
|
68
|
+
enableComplementaryArea(scope, identifier);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
shortcut,
|
|
72
|
+
...props
|
|
73
|
+
}
|
|
74
|
+
);
|
|
64
75
|
}
|
|
65
|
-
//# sourceMappingURL=index.js.map
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/complementary-area-toggle/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { usePluginContext } from '@wordpress/plugins';\n\n/**\n * Internal dependencies\n */\nimport { store as interfaceStore } from '../../store';\n\n/**\n * Whether the role supports checked state.\n *\n * @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n * @param {import('react').AriaRole} role Role.\n * @return {boolean} Whether the role supports checked state.\n */\nfunction roleSupportsCheckedState( role ) {\n\treturn [\n\t\t'checkbox',\n\t\t'option',\n\t\t'radio',\n\t\t'switch',\n\t\t'menuitemcheckbox',\n\t\t'menuitemradio',\n\t\t'treeitem',\n\t].includes( role );\n}\n\nexport default function ComplementaryAreaToggle( {\n\tas = Button,\n\tscope,\n\tidentifier: identifierProp,\n\ticon: iconProp,\n\tselectedIcon,\n\tname,\n\tshortcut,\n\t...props\n} ) {\n\tconst ComponentToUse = as;\n\tconst context = usePluginContext();\n\tconst icon = iconProp || context.icon;\n\tconst identifier = identifierProp || `${ context.name }/${ name }`;\n\tconst isSelected = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( scope ) ===\n\t\t\tidentifier,\n\t\t[ identifier, scope ]\n\t);\n\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\n\treturn (\n\t\t<ComponentToUse\n\t\t\ticon={ selectedIcon && isSelected ? selectedIcon : icon }\n\t\t\taria-controls={ identifier.replace( '/', ':' ) }\n\t\t\t// Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked\n\t\t\taria-checked={\n\t\t\t\troleSupportsCheckedState( props.role ) ? isSelected : undefined\n\t\t\t}\n\t\t\tonClick={ () => {\n\t\t\t\tif ( isSelected ) {\n\t\t\t\t\tdisableComplementaryArea( scope );\n\t\t\t\t} else {\n\t\t\t\t\tenableComplementaryArea( scope, identifier );\n\t\t\t\t}\n\t\t\t} }\n\t\t\tshortcut={ shortcut }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwDE;AArDF,wBAAuB;AACvB,kBAAuC;AACvC,qBAAiC;AAKjC,mBAAwC;AASxC,SAAS,yBAA0B,MAAO;AACzC,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,EAAE,SAAU,IAAK;AAClB;AAEe,SAAR,wBAA0C;AAAA,EAChD,KAAK;AAAA,EACL;AAAA,EACA,YAAY;AAAA,EACZ,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,GAAI;AACH,QAAM,iBAAiB;AACvB,QAAM,cAAU,iCAAiB;AACjC,QAAM,OAAO,YAAY,QAAQ;AACjC,QAAM,aAAa,kBAAkB,GAAI,QAAQ,IAAK,IAAK,IAAK;AAChE,QAAM,iBAAa;AAAA,IAClB,CAAE,WACD,OAAQ,aAAAA,KAAe,EAAE,2BAA4B,KAAM,MAC3D;AAAA,IACD,CAAE,YAAY,KAAM;AAAA,EACrB;AAEA,QAAM,EAAE,yBAAyB,yBAAyB,QACzD,yBAAa,aAAAA,KAAe;AAE7B,SACC;AAAA,IAAC;AAAA;AAAA,MACA,MAAO,gBAAgB,aAAa,eAAe;AAAA,MACnD,iBAAgB,WAAW,QAAS,KAAK,GAAI;AAAA,MAE7C,gBACC,yBAA0B,MAAM,IAAK,IAAI,aAAa;AAAA,MAEvD,SAAU,MAAM;AACf,YAAK,YAAa;AACjB,mCAA0B,KAAM;AAAA,QACjC,OAAO;AACN,kCAAyB,OAAO,UAAW;AAAA,QAC5C;AAAA,MACD;AAAA,MACA;AAAA,MACE,GAAG;AAAA;AAAA,EACN;AAEF;",
|
|
6
|
+
"names": ["interfaceStore"]
|
|
7
|
+
}
|
|
@@ -1,46 +1,52 @@
|
|
|
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 fullscreen_mode_exports = {};
|
|
19
|
+
__export(fullscreen_mode_exports, {
|
|
20
|
+
default: () => fullscreen_mode_default
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
const FullscreenMode = ({
|
|
13
|
-
isActive
|
|
14
|
-
}) => {
|
|
15
|
-
(0, _element.useEffect)(() => {
|
|
22
|
+
module.exports = __toCommonJS(fullscreen_mode_exports);
|
|
23
|
+
var import_element = require("@wordpress/element");
|
|
24
|
+
const FullscreenMode = ({ isActive }) => {
|
|
25
|
+
(0, import_element.useEffect)(() => {
|
|
16
26
|
let isSticky = false;
|
|
17
|
-
|
|
18
|
-
// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled
|
|
19
|
-
// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as
|
|
20
|
-
// a consequence of the FullscreenMode setup.
|
|
21
|
-
if (document.body.classList.contains('sticky-menu')) {
|
|
27
|
+
if (document.body.classList.contains("sticky-menu")) {
|
|
22
28
|
isSticky = true;
|
|
23
|
-
document.body.classList.remove(
|
|
29
|
+
document.body.classList.remove("sticky-menu");
|
|
24
30
|
}
|
|
25
31
|
return () => {
|
|
26
32
|
if (isSticky) {
|
|
27
|
-
document.body.classList.add(
|
|
33
|
+
document.body.classList.add("sticky-menu");
|
|
28
34
|
}
|
|
29
35
|
};
|
|
30
36
|
}, []);
|
|
31
|
-
(0,
|
|
37
|
+
(0, import_element.useEffect)(() => {
|
|
32
38
|
if (isActive) {
|
|
33
|
-
document.body.classList.add(
|
|
39
|
+
document.body.classList.add("is-fullscreen-mode");
|
|
34
40
|
} else {
|
|
35
|
-
document.body.classList.remove(
|
|
41
|
+
document.body.classList.remove("is-fullscreen-mode");
|
|
36
42
|
}
|
|
37
43
|
return () => {
|
|
38
44
|
if (isActive) {
|
|
39
|
-
document.body.classList.remove(
|
|
45
|
+
document.body.classList.remove("is-fullscreen-mode");
|
|
40
46
|
}
|
|
41
47
|
};
|
|
42
48
|
}, [isActive]);
|
|
43
49
|
return null;
|
|
44
50
|
};
|
|
45
|
-
var
|
|
46
|
-
//# sourceMappingURL=index.js.map
|
|
51
|
+
var fullscreen_mode_default = FullscreenMode;
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/fullscreen-mode/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\n\nconst FullscreenMode = ( { isActive } ) => {\n\tuseEffect( () => {\n\t\tlet isSticky = false;\n\t\t// `is-fullscreen-mode` is set in PHP as a body class by Gutenberg, and this causes\n\t\t// `sticky-menu` to be applied by WordPress and prevents the admin menu being scrolled\n\t\t// even if `is-fullscreen-mode` is then removed. Let's remove `sticky-menu` here as\n\t\t// a consequence of the FullscreenMode setup.\n\t\tif ( document.body.classList.contains( 'sticky-menu' ) ) {\n\t\t\tisSticky = true;\n\t\t\tdocument.body.classList.remove( 'sticky-menu' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isSticky ) {\n\t\t\t\tdocument.body.classList.add( 'sticky-menu' );\n\t\t\t}\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isActive ) {\n\t\t\tdocument.body.classList.add( 'is-fullscreen-mode' );\n\t\t} else {\n\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( isActive ) {\n\t\t\t\tdocument.body.classList.remove( 'is-fullscreen-mode' );\n\t\t\t}\n\t\t};\n\t}, [ isActive ] );\n\n\treturn null;\n};\nexport default FullscreenMode;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAA0B;AAE1B,MAAM,iBAAiB,CAAE,EAAE,SAAS,MAAO;AAC1C,gCAAW,MAAM;AAChB,QAAI,WAAW;AAKf,QAAK,SAAS,KAAK,UAAU,SAAU,aAAc,GAAI;AACxD,iBAAW;AACX,eAAS,KAAK,UAAU,OAAQ,aAAc;AAAA,IAC/C;AAEA,WAAO,MAAM;AACZ,UAAK,UAAW;AACf,iBAAS,KAAK,UAAU,IAAK,aAAc;AAAA,MAC5C;AAAA,IACD;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,gCAAW,MAAM;AAChB,QAAK,UAAW;AACf,eAAS,KAAK,UAAU,IAAK,oBAAqB;AAAA,IACnD,OAAO;AACN,eAAS,KAAK,UAAU,OAAQ,oBAAqB;AAAA,IACtD;AAEA,WAAO,MAAM;AACZ,UAAK,UAAW;AACf,iBAAS,KAAK,UAAU,OAAQ,oBAAqB;AAAA,MACtD;AAAA,IACD;AAAA,EACD,GAAG,CAAE,QAAS,CAAE;AAEhB,SAAO;AACR;AACA,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,56 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return _complementaryArea.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "ComplementaryAreaMoreMenuItem", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _complementaryAreaMoreMenuItem.default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "FullscreenMode", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _fullscreenMode.default;
|
|
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 });
|
|
29
16
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
|
|
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 components_exports = {};
|
|
29
|
+
__export(components_exports, {
|
|
30
|
+
ActionItem: () => import_action_item.default,
|
|
31
|
+
ComplementaryArea: () => import_complementary_area.default,
|
|
32
|
+
ComplementaryAreaMoreMenuItem: () => import_complementary_area_more_menu_item.default,
|
|
33
|
+
FullscreenMode: () => import_fullscreen_mode.default,
|
|
34
|
+
InterfaceSkeleton: () => import_interface_skeleton.default,
|
|
35
|
+
PinnedItems: () => import_pinned_items.default
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(components_exports);
|
|
38
|
+
var import_complementary_area = __toESM(require("./complementary-area"));
|
|
39
|
+
var import_complementary_area_more_menu_item = __toESM(require("./complementary-area-more-menu-item"));
|
|
40
|
+
var import_fullscreen_mode = __toESM(require("./fullscreen-mode"));
|
|
41
|
+
var import_interface_skeleton = __toESM(require("./interface-skeleton"));
|
|
42
|
+
var import_pinned_items = __toESM(require("./pinned-items"));
|
|
43
|
+
var import_action_item = __toESM(require("./action-item"));
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
ActionItem,
|
|
47
|
+
ComplementaryArea,
|
|
48
|
+
ComplementaryAreaMoreMenuItem,
|
|
49
|
+
FullscreenMode,
|
|
50
|
+
InterfaceSkeleton,
|
|
51
|
+
PinnedItems
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/index.js"],
|
|
4
|
+
"sourcesContent": ["export { default as ComplementaryArea } from './complementary-area';\nexport { default as ComplementaryAreaMoreMenuItem } from './complementary-area-more-menu-item';\nexport { default as FullscreenMode } from './fullscreen-mode';\nexport { default as InterfaceSkeleton } from './interface-skeleton';\nexport { default as PinnedItems } from './pinned-items';\nexport { default as ActionItem } from './action-item';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAA6C;AAC7C,+CAAyD;AACzD,6BAA0C;AAC1C,gCAA6C;AAC7C,0BAAuC;AACvC,yBAAsC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|