@wordpress/edit-widgets 6.32.0 → 6.32.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/build/blocks/widget-area/block.json +26 -0
- package/build/blocks/widget-area/edit/index.js +94 -87
- package/build/blocks/widget-area/edit/index.js.map +7 -1
- package/build/blocks/widget-area/edit/inner-blocks.js +68 -50
- package/build/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build/blocks/widget-area/edit/use-is-dragging-within.js +34 -40
- package/build/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build/blocks/widget-area/index.js +49 -52
- package/build/blocks/widget-area/index.js.map +7 -1
- package/build/components/error-boundary/index.js +49 -51
- package/build/components/error-boundary/index.js.map +7 -1
- package/build/components/header/document-tools/index.js +104 -74
- package/build/components/header/document-tools/index.js.map +7 -1
- package/build/components/header/index.js +81 -62
- package/build/components/header/index.js.map +7 -1
- package/build/components/header/undo-redo/redo.js +50 -38
- package/build/components/header/undo-redo/redo.js.map +7 -1
- package/build/components/header/undo-redo/undo.js +49 -37
- package/build/components/header/undo-redo/undo.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +74 -71
- package/build/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +61 -44
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +154 -103
- package/build/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +74 -56
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build/components/keyboard-shortcuts/index.js +89 -82
- package/build/components/keyboard-shortcuts/index.js.map +7 -1
- package/build/components/layout/index.js +75 -49
- package/build/components/layout/index.js.map +7 -1
- package/build/components/layout/interface.js +89 -75
- package/build/components/layout/interface.js.map +7 -1
- package/build/components/layout/unsaved-changes-warning.js +35 -42
- package/build/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build/components/more-menu/index.js +189 -108
- package/build/components/more-menu/index.js.map +7 -1
- package/build/components/more-menu/tools-more-menu-group.js +29 -23
- package/build/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build/components/notices/index.js +62 -48
- package/build/components/notices/index.js.map +7 -1
- package/build/components/save-button/index.js +55 -47
- package/build/components/save-button/index.js.map +7 -1
- package/build/components/secondary-sidebar/index.js +41 -34
- package/build/components/secondary-sidebar/index.js.map +7 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +55 -46
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +76 -67
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build/components/sidebar/index.js +149 -138
- package/build/components/sidebar/index.js.map +7 -1
- package/build/components/sidebar/widget-areas.js +73 -57
- package/build/components/sidebar/widget-areas.js.map +7 -1
- package/build/components/welcome-guide/index.js +182 -137
- package/build/components/welcome-guide/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-content/index.js +64 -43
- package/build/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build/components/widget-areas-block-editor-provider/index.js +115 -92
- package/build/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build/constants.js +30 -8
- package/build/constants.js.map +7 -1
- package/build/filters/index.js +3 -5
- package/build/filters/index.js.map +7 -1
- package/build/filters/move-to-widget-area.js +52 -59
- package/build/filters/move-to-widget-area.js.map +7 -1
- package/build/filters/replace-media-upload.js +9 -11
- package/build/filters/replace-media-upload.js.map +7 -1
- package/build/hooks/use-last-selected-widget-area.js +38 -44
- package/build/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build/hooks/use-widget-library-insertion-point.js +60 -55
- package/build/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build/index.js +86 -93
- package/build/index.js.map +7 -1
- package/build/lock-unlock.js +31 -15
- package/build/lock-unlock.js.map +7 -1
- package/build/store/actions.js +181 -313
- package/build/store/actions.js.map +7 -1
- package/build/store/constants.js +27 -10
- package/build/store/constants.js.map +7 -1
- package/build/store/index.js +51 -51
- package/build/store/index.js.map +7 -1
- package/build/store/private-selectors.js +28 -7
- package/build/store/private-selectors.js.map +7 -1
- package/build/store/reducer.js +65 -118
- package/build/store/reducer.js.map +7 -1
- package/build/store/resolvers.js +64 -63
- package/build/store/resolvers.js.map +7 -1
- package/build/store/selectors.js +194 -231
- package/build/store/selectors.js.map +7 -1
- package/build/store/transformers.js +47 -41
- package/build/store/transformers.js.map +7 -1
- package/build/store/utils.js +47 -70
- package/build/store/utils.js.map +7 -1
- package/build-module/blocks/widget-area/block.json +26 -0
- package/build-module/blocks/widget-area/edit/index.js +63 -75
- package/build-module/blocks/widget-area/edit/index.js.map +7 -1
- package/build-module/blocks/widget-area/edit/inner-blocks.js +38 -41
- package/build-module/blocks/widget-area/edit/inner-blocks.js.map +7 -1
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js +14 -33
- package/build-module/blocks/widget-area/edit/use-is-dragging-within.js.map +7 -1
- package/build-module/blocks/widget-area/index.js +14 -46
- package/build-module/blocks/widget-area/index.js.map +7 -1
- package/build-module/components/error-boundary/index.js +30 -43
- package/build-module/components/error-boundary/index.js.map +7 -1
- package/build-module/components/header/document-tools/index.js +75 -66
- package/build-module/components/header/document-tools/index.js.map +7 -1
- package/build-module/components/header/index.js +52 -54
- package/build-module/components/header/index.js.map +7 -1
- package/build-module/components/header/undo-redo/redo.js +32 -32
- package/build-module/components/header/undo-redo/redo.js.map +7 -1
- package/build-module/components/header/undo-redo/undo.js +31 -31
- package/build-module/components/header/undo-redo/undo.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +62 -75
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +33 -37
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +130 -97
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +7 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +56 -50
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +7 -1
- package/build-module/components/keyboard-shortcuts/index.js +73 -75
- package/build-module/components/keyboard-shortcuts/index.js.map +7 -1
- package/build-module/components/layout/index.js +46 -41
- package/build-module/components/layout/index.js.map +7 -1
- package/build-module/components/layout/interface.js +63 -66
- package/build-module/components/layout/interface.js.map +7 -1
- package/build-module/components/layout/unsaved-changes-warning.js +17 -37
- package/build-module/components/layout/unsaved-changes-warning.js.map +7 -1
- package/build-module/components/more-menu/index.js +167 -102
- package/build-module/components/more-menu/index.js.map +7 -1
- package/build-module/components/more-menu/tools-more-menu-group.js +11 -17
- package/build-module/components/more-menu/tools-more-menu-group.js.map +7 -1
- package/build-module/components/notices/index.js +43 -42
- package/build-module/components/notices/index.js.map +7 -1
- package/build-module/components/save-button/index.js +37 -41
- package/build-module/components/save-button/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/index.js +14 -27
- package/build-module/components/secondary-sidebar/index.js.map +7 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +26 -38
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +7 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +57 -60
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +7 -1
- package/build-module/components/sidebar/index.js +129 -127
- package/build-module/components/sidebar/index.js.map +7 -1
- package/build-module/components/sidebar/widget-areas.js +53 -49
- package/build-module/components/sidebar/widget-areas.js.map +7 -1
- package/build-module/components/welcome-guide/index.js +165 -132
- package/build-module/components/welcome-guide/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-content/index.js +43 -36
- package/build-module/components/widget-areas-block-editor-content/index.js.map +7 -1
- package/build-module/components/widget-areas-block-editor-provider/index.js +85 -83
- package/build-module/components/widget-areas-block-editor-provider/index.js.map +7 -1
- package/build-module/constants.js +7 -3
- package/build-module/constants.js.map +7 -1
- package/build-module/filters/index.js +3 -6
- package/build-module/filters/index.js.map +7 -1
- package/build-module/filters/move-to-widget-area.js +52 -57
- package/build-module/filters/move-to-widget-area.js.map +7 -1
- package/build-module/filters/replace-media-upload.js +8 -7
- package/build-module/filters/replace-media-upload.js.map +7 -1
- package/build-module/hooks/use-last-selected-widget-area.js +20 -39
- package/build-module/hooks/use-last-selected-widget-area.js.map +7 -1
- package/build-module/hooks/use-widget-library-insertion-point.js +42 -49
- package/build-module/hooks/use-widget-library-insertion-point.js.map +7 -1
- package/build-module/index.js +60 -72
- package/build-module/index.js.map +7 -1
- package/build-module/lock-unlock.js +8 -7
- package/build-module/lock-unlock.js.map +7 -1
- package/build-module/store/actions.js +153 -293
- package/build-module/store/actions.js.map +7 -1
- package/build-module/store/constants.js +5 -5
- package/build-module/store/constants.js.map +7 -1
- package/build-module/store/index.js +16 -40
- package/build-module/store/index.js.map +7 -1
- package/build-module/store/private-selectors.js +7 -3
- package/build-module/store/private-selectors.js.map +7 -1
- package/build-module/store/reducer.js +42 -111
- package/build-module/store/reducer.js.map +7 -1
- package/build-module/store/resolvers.js +43 -51
- package/build-module/store/resolvers.js.map +7 -1
- package/build-module/store/selectors.js +171 -224
- package/build-module/store/selectors.js.map +7 -1
- package/build-module/store/transformers.js +23 -34
- package/build-module/store/transformers.js.map +7 -1
- package/build-module/store/utils.js +22 -63
- package/build-module/store/utils.js.map +7 -1
- package/build-style/style-rtl.css +216 -88
- package/build-style/style.css +216 -88
- package/package.json +36 -29
- package/src/blocks/widget-area/editor.scss +3 -0
- package/src/components/customizer-edit-widgets-initializer/style.scss +3 -0
- package/src/components/error-boundary/style.scss +2 -0
- package/src/components/header/style.scss +5 -0
- package/src/components/keyboard-shortcut-help-modal/style.scss +2 -0
- package/src/components/layout/style.scss +3 -0
- package/src/components/more-menu/style.scss +2 -0
- package/src/components/notices/style.scss +3 -0
- package/src/components/secondary-sidebar/style.scss +4 -0
- package/src/components/sidebar/style.scss +2 -0
- package/src/components/welcome-guide/style.scss +2 -0
- package/src/components/widget-areas-block-editor-content/style.scss +2 -0
- package/src/style.scss +16 -13
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blocks/widget-area/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ttitle: __( 'Widget Area' ),\n\tdescription: __( 'A widget area container.' ),\n\t__experimentalLabel: ( { name: label } ) => label,\n\tedit,\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AAKnB,mBAAqB;AACrB,kBAAiB;AAEjB,MAAM,EAAE,KAAK,IAAI,aAAAA;AAGV,MAAM,WAAW;AAAA,EACvB,WAAO,gBAAI,aAAc;AAAA,EACzB,iBAAa,gBAAI,0BAA2B;AAAA,EAC5C,qBAAqB,CAAE,EAAE,MAAM,MAAM,MAAO;AAAA,EAC5C,kBAAAC;AACD;",
|
|
6
|
+
"names": ["metadata", "edit"]
|
|
7
|
+
}
|
|
@@ -1,47 +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 error_boundary_exports = {};
|
|
19
|
+
__export(error_boundary_exports, {
|
|
20
|
+
default: () => ErrorBoundary
|
|
5
21
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
function CopyButton({
|
|
19
|
-
text,
|
|
20
|
-
children
|
|
21
|
-
}) {
|
|
22
|
-
const ref = (0, _compose.useCopyToClipboard)(text);
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
24
|
-
__next40pxDefaultSize: true,
|
|
25
|
-
variant: "secondary",
|
|
26
|
-
ref: ref,
|
|
27
|
-
children: children
|
|
28
|
-
});
|
|
22
|
+
module.exports = __toCommonJS(error_boundary_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
var import_element = require("@wordpress/element");
|
|
25
|
+
var import_i18n = require("@wordpress/i18n");
|
|
26
|
+
var import_components = require("@wordpress/components");
|
|
27
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
28
|
+
var import_compose = require("@wordpress/compose");
|
|
29
|
+
var import_hooks = require("@wordpress/hooks");
|
|
30
|
+
function CopyButton({ text, children }) {
|
|
31
|
+
const ref = (0, import_compose.useCopyToClipboard)(text);
|
|
32
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Button, { __next40pxDefaultSize: true, variant: "secondary", ref, children });
|
|
29
33
|
}
|
|
30
|
-
function ErrorBoundaryWarning({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
text: error.stack,
|
|
36
|
-
children: (0, _i18n.__)('Copy Error')
|
|
37
|
-
}, "copy-error")];
|
|
38
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.Warning, {
|
|
39
|
-
className: "edit-widgets-error-boundary",
|
|
40
|
-
actions: actions,
|
|
41
|
-
children: message
|
|
42
|
-
});
|
|
34
|
+
function ErrorBoundaryWarning({ message, error }) {
|
|
35
|
+
const actions = [
|
|
36
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: error.stack, children: (0, import_i18n.__)("Copy Error") }, "copy-error")
|
|
37
|
+
];
|
|
38
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.Warning, { className: "edit-widgets-error-boundary", actions, children: message });
|
|
43
39
|
}
|
|
44
|
-
class ErrorBoundary extends
|
|
40
|
+
class ErrorBoundary extends import_element.Component {
|
|
45
41
|
constructor() {
|
|
46
42
|
super(...arguments);
|
|
47
43
|
this.state = {
|
|
@@ -49,22 +45,24 @@ class ErrorBoundary extends _element.Component {
|
|
|
49
45
|
};
|
|
50
46
|
}
|
|
51
47
|
componentDidCatch(error) {
|
|
52
|
-
(0,
|
|
48
|
+
(0, import_hooks.doAction)("editor.ErrorBoundary.errorLogged", error);
|
|
53
49
|
}
|
|
54
50
|
static getDerivedStateFromError(error) {
|
|
55
|
-
return {
|
|
56
|
-
error
|
|
57
|
-
};
|
|
51
|
+
return { error };
|
|
58
52
|
}
|
|
59
53
|
render() {
|
|
60
54
|
if (!this.state.error) {
|
|
61
55
|
return this.props.children;
|
|
62
56
|
}
|
|
63
|
-
return
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
|
+
ErrorBoundaryWarning,
|
|
59
|
+
{
|
|
60
|
+
message: (0, import_i18n.__)(
|
|
61
|
+
"The editor has encountered an unexpected error."
|
|
62
|
+
),
|
|
63
|
+
error: this.state.error
|
|
64
|
+
}
|
|
65
|
+
);
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
//# sourceMappingURL=index.js.map
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/error-boundary/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { Warning } from '@wordpress/block-editor';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { doAction } from '@wordpress/hooks';\n\nfunction CopyButton( { text, children } ) {\n\tconst ref = useCopyToClipboard( text );\n\treturn (\n\t\t<Button __next40pxDefaultSize variant=\"secondary\" ref={ ref }>\n\t\t\t{ children }\n\t\t</Button>\n\t);\n}\n\nfunction ErrorBoundaryWarning( { message, error } ) {\n\tconst actions = [\n\t\t<CopyButton key=\"copy-error\" text={ error.stack }>\n\t\t\t{ __( 'Copy Error' ) }\n\t\t</CopyButton>,\n\t];\n\n\treturn (\n\t\t<Warning className=\"edit-widgets-error-boundary\" actions={ actions }>\n\t\t\t{ message }\n\t\t</Warning>\n\t);\n}\n\nexport default class ErrorBoundary extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\n\t\tthis.state = {\n\t\t\terror: null,\n\t\t};\n\t}\n\n\tcomponentDidCatch( error ) {\n\t\tdoAction( 'editor.ErrorBoundary.errorLogged', error );\n\t}\n\n\tstatic getDerivedStateFromError( error ) {\n\t\treturn { error };\n\t}\n\n\trender() {\n\t\tif ( ! this.state.error ) {\n\t\t\treturn this.props.children;\n\t\t}\n\n\t\treturn (\n\t\t\t<ErrorBoundaryWarning\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'The editor has encountered an unexpected error.'\n\t\t\t\t) }\n\t\t\t\terror={ this.state.error }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaE;AAVF,qBAA0B;AAC1B,kBAAmB;AACnB,wBAAuB;AACvB,0BAAwB;AACxB,qBAAmC;AACnC,mBAAyB;AAEzB,SAAS,WAAY,EAAE,MAAM,SAAS,GAAI;AACzC,QAAM,UAAM,mCAAoB,IAAK;AACrC,SACC,4CAAC,4BAAO,uBAAqB,MAAC,SAAQ,aAAY,KAC/C,UACH;AAEF;AAEA,SAAS,qBAAsB,EAAE,SAAS,MAAM,GAAI;AACnD,QAAM,UAAU;AAAA,IACf,4CAAC,cAA4B,MAAO,MAAM,OACvC,8BAAI,YAAa,KADJ,YAEhB;AAAA,EACD;AAEA,SACC,4CAAC,+BAAQ,WAAU,+BAA8B,SAC9C,mBACH;AAEF;AAEA,MAAO,sBAAoC,yBAAU;AAAA,EACpD,cAAc;AACb,UAAO,GAAG,SAAU;AAEpB,SAAK,QAAQ;AAAA,MACZ,OAAO;AAAA,IACR;AAAA,EACD;AAAA,EAEA,kBAAmB,OAAQ;AAC1B,+BAAU,oCAAoC,KAAM;AAAA,EACrD;AAAA,EAEA,OAAO,yBAA0B,OAAQ;AACxC,WAAO,EAAE,MAAM;AAAA,EAChB;AAAA,EAEA,SAAS;AACR,QAAK,CAAE,KAAK,MAAM,OAAQ;AACzB,aAAO,KAAK,MAAM;AAAA,IACnB;AAEA,WACC;AAAA,MAAC;AAAA;AAAA,QACA,aAAU;AAAA,UACT;AAAA,QACD;AAAA,QACA,OAAQ,KAAK,MAAM;AAAA;AAAA,IACpB;AAAA,EAEF;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,44 +1,61 @@
|
|
|
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 document_tools_exports = {};
|
|
29
|
+
__export(document_tools_exports, {
|
|
30
|
+
default: () => document_tools_default
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
/**
|
|
21
|
-
* WordPress dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Internal dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
32
|
+
module.exports = __toCommonJS(document_tools_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_data = require("@wordpress/data");
|
|
35
|
+
var import_i18n = require("@wordpress/i18n");
|
|
36
|
+
var import_components = require("@wordpress/components");
|
|
37
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
38
|
+
var import_icons = require("@wordpress/icons");
|
|
39
|
+
var import_element = require("@wordpress/element");
|
|
40
|
+
var import_compose = require("@wordpress/compose");
|
|
41
|
+
var import_undo = __toESM(require("../undo-redo/undo"));
|
|
42
|
+
var import_redo = __toESM(require("../undo-redo/redo"));
|
|
43
|
+
var import_store = require("../../../store");
|
|
44
|
+
var import_lock_unlock = require("../../../lock-unlock");
|
|
28
45
|
function DocumentTools() {
|
|
29
|
-
const isMediumViewport = (0,
|
|
46
|
+
const isMediumViewport = (0, import_compose.useViewportMatch)("medium");
|
|
30
47
|
const {
|
|
31
48
|
isInserterOpen,
|
|
32
49
|
isListViewOpen,
|
|
33
50
|
inserterSidebarToggleRef,
|
|
34
51
|
listViewToggleRef
|
|
35
|
-
} = (0,
|
|
52
|
+
} = (0, import_data.useSelect)((select) => {
|
|
36
53
|
const {
|
|
37
54
|
isInserterOpened,
|
|
38
55
|
getInserterSidebarToggleRef,
|
|
39
56
|
isListViewOpened,
|
|
40
57
|
getListViewToggleRef
|
|
41
|
-
} = (0,
|
|
58
|
+
} = (0, import_lock_unlock.unlock)(select(import_store.store));
|
|
42
59
|
return {
|
|
43
60
|
isInserterOpen: isInserterOpened(),
|
|
44
61
|
isListViewOpen: isListViewOpened(),
|
|
@@ -46,49 +63,62 @@ function DocumentTools() {
|
|
|
46
63
|
listViewToggleRef: getListViewToggleRef()
|
|
47
64
|
};
|
|
48
65
|
}, []);
|
|
49
|
-
const {
|
|
50
|
-
|
|
51
|
-
setIsListViewOpened
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const toggleInserterSidebar = (0,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
variant: "
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
66
|
+
const { setIsInserterOpened, setIsListViewOpened } = (0, import_data.useDispatch)(import_store.store);
|
|
67
|
+
const toggleListView = (0, import_element.useCallback)(
|
|
68
|
+
() => setIsListViewOpened(!isListViewOpen),
|
|
69
|
+
[setIsListViewOpened, isListViewOpen]
|
|
70
|
+
);
|
|
71
|
+
const toggleInserterSidebar = (0, import_element.useCallback)(
|
|
72
|
+
() => setIsInserterOpened(!isInserterOpen),
|
|
73
|
+
[setIsInserterOpened, isInserterOpen]
|
|
74
|
+
);
|
|
75
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
76
|
+
import_block_editor.NavigableToolbar,
|
|
77
|
+
{
|
|
78
|
+
className: "edit-widgets-header-toolbar",
|
|
79
|
+
"aria-label": (0, import_i18n.__)("Document tools"),
|
|
80
|
+
variant: "unstyled",
|
|
81
|
+
children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
83
|
+
import_components.ToolbarItem,
|
|
84
|
+
{
|
|
85
|
+
ref: inserterSidebarToggleRef,
|
|
86
|
+
as: import_components.Button,
|
|
87
|
+
className: "edit-widgets-header-toolbar__inserter-toggle",
|
|
88
|
+
variant: "primary",
|
|
89
|
+
isPressed: isInserterOpen,
|
|
90
|
+
onMouseDown: (event) => {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
},
|
|
93
|
+
onClick: toggleInserterSidebar,
|
|
94
|
+
icon: import_icons.plus,
|
|
95
|
+
label: (0, import_i18n._x)(
|
|
96
|
+
"Block Inserter",
|
|
97
|
+
"Generic label for block inserter button"
|
|
98
|
+
),
|
|
99
|
+
size: "compact"
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
isMediumViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ToolbarItem, { as: import_undo.default }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ToolbarItem, { as: import_redo.default }),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
106
|
+
import_components.ToolbarItem,
|
|
107
|
+
{
|
|
108
|
+
as: import_components.Button,
|
|
109
|
+
className: "edit-widgets-header-toolbar__list-view-toggle",
|
|
110
|
+
icon: import_icons.listView,
|
|
111
|
+
isPressed: isListViewOpen,
|
|
112
|
+
label: (0, import_i18n.__)("List View"),
|
|
113
|
+
onClick: toggleListView,
|
|
114
|
+
ref: listViewToggleRef,
|
|
115
|
+
size: "compact"
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] })
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
);
|
|
92
122
|
}
|
|
93
|
-
var
|
|
94
|
-
//# sourceMappingURL=index.js.map
|
|
123
|
+
var document_tools_default = DocumentTools;
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/header/document-tools/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { NavigableToolbar } from '@wordpress/block-editor';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport UndoButton from '../undo-redo/undo';\nimport RedoButton from '../undo-redo/redo';\nimport { store as editWidgetsStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nfunction DocumentTools() {\n\tconst isMediumViewport = useViewportMatch( 'medium' );\n\n\tconst {\n\t\tisInserterOpen,\n\t\tisListViewOpen,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tisInserterOpened,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tisListViewOpened,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editWidgetsStore ) );\n\t\treturn {\n\t\t\tisInserterOpen: isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editWidgetsStore );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserterSidebar = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpen ),\n\t\t[ setIsInserterOpened, isInserterOpen ]\n\t);\n\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-widgets-header-toolbar\"\n\t\t\taria-label={ __( 'Document tools' ) }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<ToolbarItem\n\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-widgets-header-toolbar__inserter-toggle\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tisPressed={ isInserterOpen }\n\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t} }\n\t\t\t\tonClick={ toggleInserterSidebar }\n\t\t\t\ticon={ plus }\n\t\t\t\t/* translators: button label text should, if possible, be under 16\n\t\t\t\t\tcharacters. */\n\t\t\t\tlabel={ _x(\n\t\t\t\t\t'Block Inserter',\n\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t) }\n\t\t\t\tsize=\"compact\"\n\t\t\t/>\n\t\t\t{ isMediumViewport && (\n\t\t\t\t<>\n\t\t\t\t\t<ToolbarItem as={ UndoButton } />\n\t\t\t\t\t<ToolbarItem as={ RedoButton } />\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"edit-widgets-header-toolbar__list-view-toggle\"\n\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4DG;AAzDH,kBAAuC;AACvC,kBAAuB;AACvB,wBAAoC;AACpC,0BAAiC;AACjC,mBAA+B;AAC/B,qBAA4B;AAC5B,qBAAiC;AAKjC,kBAAuB;AACvB,kBAAuB;AACvB,mBAA0C;AAC1C,yBAAuB;AAEvB,SAAS,gBAAgB;AACxB,QAAM,uBAAmB,iCAAkB,QAAS;AAEpD,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,CAAE,WAAY;AAC5B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,QAAI,2BAAQ,OAAQ,aAAAA,KAAiB,CAAE;AACvC,WAAO;AAAA,MACN,gBAAgB,iBAAiB;AAAA,MACjC,gBAAgB,iBAAiB;AAAA,MACjC,0BAA0B,4BAA4B;AAAA,MACtD,mBAAmB,qBAAqB;AAAA,IACzC;AAAA,EACD,GAAG,CAAC,CAAE;AACN,QAAM,EAAE,qBAAqB,oBAAoB,QAChD,yBAAa,aAAAA,KAAiB;AAE/B,QAAM,qBAAiB;AAAA,IACtB,MAAM,oBAAqB,CAAE,cAAe;AAAA,IAC5C,CAAE,qBAAqB,cAAe;AAAA,EACvC;AAEA,QAAM,4BAAwB;AAAA,IAC7B,MAAM,oBAAqB,CAAE,cAAe;AAAA,IAC5C,CAAE,qBAAqB,cAAe;AAAA,EACvC;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,kBAAa,gBAAI,gBAAiB;AAAA,MAClC,SAAQ;AAAA,MAER;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,KAAM;AAAA,YACN,IAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAQ;AAAA,YACR,WAAY;AAAA,YACZ,aAAc,CAAE,UAAW;AAC1B,oBAAM,eAAe;AAAA,YACtB;AAAA,YACA,SAAU;AAAA,YACV,MAAO;AAAA,YAGP,WAAQ;AAAA,cACP;AAAA,cACA;AAAA,YACD;AAAA,YACA,MAAK;AAAA;AAAA,QACN;AAAA,QACE,oBACD,4EACC;AAAA,sDAAC,iCAAY,IAAK,YAAAC,SAAa;AAAA,UAC/B,4CAAC,iCAAY,IAAK,YAAAC,SAAa;AAAA,UAC/B;AAAA,YAAC;AAAA;AAAA,cACA,IAAK;AAAA,cACL,WAAU;AAAA,cACV,MAAO;AAAA,cACP,WAAY;AAAA,cAEZ,WAAQ,gBAAI,WAAY;AAAA,cACxB,SAAU;AAAA,cACV,KAAM;AAAA,cACN,MAAK;AAAA;AAAA,UACN;AAAA,WACD;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,yBAAQ;",
|
|
6
|
+
"names": ["editWidgetsStore", "UndoButton", "RedoButton"]
|
|
7
|
+
}
|
|
@@ -1,69 +1,88 @@
|
|
|
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 header_exports = {};
|
|
29
|
+
__export(header_exports, {
|
|
30
|
+
default: () => header_default
|
|
6
31
|
});
|
|
7
|
-
exports
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
/**
|
|
21
|
-
* WordPress dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Internal dependencies
|
|
26
|
-
*/
|
|
27
|
-
|
|
32
|
+
module.exports = __toCommonJS(header_exports);
|
|
33
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
34
|
+
var import_block_editor = require("@wordpress/block-editor");
|
|
35
|
+
var import_data = require("@wordpress/data");
|
|
36
|
+
var import_element = require("@wordpress/element");
|
|
37
|
+
var import_i18n = require("@wordpress/i18n");
|
|
38
|
+
var import_components = require("@wordpress/components");
|
|
39
|
+
var import_interface = require("@wordpress/interface");
|
|
40
|
+
var import_compose = require("@wordpress/compose");
|
|
41
|
+
var import_preferences = require("@wordpress/preferences");
|
|
42
|
+
var import_document_tools = __toESM(require("./document-tools"));
|
|
43
|
+
var import_save_button = __toESM(require("../save-button"));
|
|
44
|
+
var import_more_menu = __toESM(require("../more-menu"));
|
|
28
45
|
function Header() {
|
|
29
|
-
const isLargeViewport = (0,
|
|
30
|
-
const blockToolbarRef = (0,
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
const isLargeViewport = (0, import_compose.useViewportMatch)("medium");
|
|
47
|
+
const blockToolbarRef = (0, import_element.useRef)();
|
|
48
|
+
const { hasFixedToolbar } = (0, import_data.useSelect)(
|
|
49
|
+
(select) => ({
|
|
50
|
+
hasFixedToolbar: !!select(import_preferences.store).get(
|
|
51
|
+
"core/edit-widgets",
|
|
52
|
+
"fixedToolbar"
|
|
53
|
+
)
|
|
54
|
+
}),
|
|
55
|
+
[]
|
|
56
|
+
);
|
|
57
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "edit-widgets-header", children: [
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "edit-widgets-header__navigable-toolbar-wrapper", children: [
|
|
59
|
+
isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "edit-widgets-header__title", children: (0, import_i18n.__)("Widgets") }),
|
|
60
|
+
!isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
61
|
+
import_components.VisuallyHidden,
|
|
62
|
+
{
|
|
45
63
|
as: "h1",
|
|
46
64
|
className: "edit-widgets-header__title",
|
|
47
|
-
children: (0,
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
65
|
+
children: (0, import_i18n.__)("Widgets")
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_document_tools.default, {}),
|
|
69
|
+
hasFixedToolbar && isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "selected-block-tools-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockToolbar, { hideDragHandle: true }) }),
|
|
71
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
|
+
import_components.Popover.Slot,
|
|
73
|
+
{
|
|
55
74
|
ref: blockToolbarRef,
|
|
56
75
|
name: "block-toolbar"
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
})
|
|
65
|
-
})
|
|
66
|
-
});
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
] })
|
|
79
|
+
] }),
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "edit-widgets-header__actions", children: [
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_interface.PinnedItems.Slot, { scope: "core/edit-widgets" }),
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_save_button.default, {}),
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_more_menu.default, {})
|
|
84
|
+
] })
|
|
85
|
+
] }) });
|
|
67
86
|
}
|
|
68
|
-
var
|
|
69
|
-
//# sourceMappingURL=index.js.map
|
|
87
|
+
var header_default = Header;
|
|
88
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/header/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { BlockToolbar } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Popover, VisuallyHidden } from '@wordpress/components';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport DocumentTools from './document-tools';\nimport SaveButton from '../save-button';\nimport MoreMenu from '../more-menu';\n\nfunction Header() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst blockToolbarRef = useRef();\n\tconst { hasFixedToolbar } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasFixedToolbar: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t} ),\n\t\t[]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-header\">\n\t\t\t\t<div className=\"edit-widgets-header__navigable-toolbar-wrapper\">\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<h1 className=\"edit-widgets-header__title\">\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isLargeViewport && (\n\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\tclassName=\"edit-widgets-header__title\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Widgets' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t) }\n\t\t\t\t\t<DocumentTools />\n\t\t\t\t\t{ hasFixedToolbar && isLargeViewport && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div className=\"selected-block-tools-wrapper\">\n\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"edit-widgets-header__actions\">\n\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-widgets\" />\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t<MoreMenu />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Header;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCM;AAlCN,0BAA6B;AAC7B,kBAA0B;AAC1B,qBAAuB;AACvB,kBAAmB;AACnB,wBAAwC;AACxC,uBAA4B;AAC5B,qBAAiC;AACjC,yBAA0C;AAK1C,4BAA0B;AAC1B,yBAAuB;AACvB,uBAAqB;AAErB,SAAS,SAAS;AACjB,QAAM,sBAAkB,iCAAkB,QAAS;AACnD,QAAM,sBAAkB,uBAAO;AAC/B,QAAM,EAAE,gBAAgB,QAAI;AAAA,IAC3B,CAAE,YAAc;AAAA,MACf,iBAAiB,CAAC,CAAE,OAAQ,mBAAAA,KAAiB,EAAE;AAAA,QAC9C;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,SACC,2EACC,uDAAC,SAAI,WAAU,uBACd;AAAA,iDAAC,SAAI,WAAU,kDACZ;AAAA,yBACD,4CAAC,QAAG,WAAU,8BACX,8BAAI,SAAU,GACjB;AAAA,MAEC,CAAE,mBACH;AAAA,QAAC;AAAA;AAAA,UACA,IAAG;AAAA,UACH,WAAU;AAAA,UAER,8BAAI,SAAU;AAAA;AAAA,MACjB;AAAA,MAED,4CAAC,sBAAAC,SAAA,EAAc;AAAA,MACb,mBAAmB,mBACpB,4EACC;AAAA,oDAAC,SAAI,WAAU,gCACd,sDAAC,oCAAa,gBAAc,MAAC,GAC9B;AAAA,QACA;AAAA,UAAC,0BAAQ;AAAA,UAAR;AAAA,YACA,KAAM;AAAA,YACN,MAAK;AAAA;AAAA,QACN;AAAA,SACD;AAAA,OAEF;AAAA,IACA,6CAAC,SAAI,WAAU,gCACd;AAAA,kDAAC,6BAAY,MAAZ,EAAiB,OAAM,qBAAoB;AAAA,MAC5C,4CAAC,mBAAAC,SAAA,EAAW;AAAA,MACZ,4CAAC,iBAAAC,SAAA,EAAS;AAAA,OACX;AAAA,KACD,GACD;AAEF;AAEA,IAAO,iBAAQ;",
|
|
6
|
+
"names": ["preferencesStore", "DocumentTools", "SaveButton", "MoreMenu"]
|
|
7
|
+
}
|