@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,105 +1,170 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {
|
|
3
|
+
MenuGroup,
|
|
4
|
+
MenuItem,
|
|
5
|
+
VisuallyHidden,
|
|
6
|
+
DropdownMenu
|
|
7
|
+
} from "@wordpress/components";
|
|
8
|
+
import { useState } from "@wordpress/element";
|
|
9
|
+
import { __, _x } from "@wordpress/i18n";
|
|
10
|
+
import { external, moreVertical } from "@wordpress/icons";
|
|
11
|
+
import { PreferenceToggleMenuItem } from "@wordpress/preferences";
|
|
12
|
+
import { displayShortcut } from "@wordpress/keycodes";
|
|
13
|
+
import { useShortcut } from "@wordpress/keyboard-shortcuts";
|
|
14
|
+
import { useViewportMatch } from "@wordpress/compose";
|
|
15
|
+
import KeyboardShortcutHelpModal from "../keyboard-shortcut-help-modal";
|
|
16
|
+
import ToolsMoreMenuGroup from "./tools-more-menu-group";
|
|
17
|
+
function MoreMenu() {
|
|
18
|
+
const [
|
|
19
|
+
isKeyboardShortcutsModalActive,
|
|
20
|
+
setIsKeyboardShortcutsModalVisible
|
|
21
|
+
] = useState(false);
|
|
21
22
|
const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive);
|
|
22
|
-
useShortcut(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
name: "welcomeGuide",
|
|
58
|
-
label: __('Welcome Guide')
|
|
59
|
-
}), /*#__PURE__*/_jsxs(MenuItem, {
|
|
60
|
-
role: "menuitem",
|
|
61
|
-
icon: external,
|
|
62
|
-
href: __('https://wordpress.org/documentation/article/block-based-widgets-editor/'),
|
|
63
|
-
target: "_blank",
|
|
64
|
-
rel: "noopener noreferrer",
|
|
65
|
-
children: [__('Help'), /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
66
|
-
as: "span",
|
|
67
|
-
children: /* translators: accessibility text */
|
|
68
|
-
__('(opens in a new tab)')
|
|
69
|
-
})]
|
|
70
|
-
}), /*#__PURE__*/_jsx(ToolsMoreMenuGroup.Slot, {
|
|
71
|
-
fillProps: {
|
|
72
|
-
onClose
|
|
23
|
+
useShortcut(
|
|
24
|
+
"core/edit-widgets/keyboard-shortcuts",
|
|
25
|
+
toggleKeyboardShortcutsModal
|
|
26
|
+
);
|
|
27
|
+
const isLargeViewport = useViewportMatch("medium");
|
|
28
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
DropdownMenu,
|
|
31
|
+
{
|
|
32
|
+
icon: moreVertical,
|
|
33
|
+
label: __("Options"),
|
|
34
|
+
popoverProps: {
|
|
35
|
+
placement: "bottom-end",
|
|
36
|
+
className: "more-menu-dropdown__content"
|
|
37
|
+
},
|
|
38
|
+
toggleProps: {
|
|
39
|
+
tooltipPosition: "bottom",
|
|
40
|
+
size: "compact"
|
|
41
|
+
},
|
|
42
|
+
children: (onClose) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
isLargeViewport && /* @__PURE__ */ jsx(MenuGroup, { label: _x("View", "noun"), children: /* @__PURE__ */ jsx(
|
|
44
|
+
PreferenceToggleMenuItem,
|
|
45
|
+
{
|
|
46
|
+
scope: "core/edit-widgets",
|
|
47
|
+
name: "fixedToolbar",
|
|
48
|
+
label: __("Top toolbar"),
|
|
49
|
+
info: __(
|
|
50
|
+
"Access all block and document tools in a single place"
|
|
51
|
+
),
|
|
52
|
+
messageActivated: __(
|
|
53
|
+
"Top toolbar activated"
|
|
54
|
+
),
|
|
55
|
+
messageDeactivated: __(
|
|
56
|
+
"Top toolbar deactivated"
|
|
57
|
+
)
|
|
73
58
|
}
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
59
|
+
) }),
|
|
60
|
+
/* @__PURE__ */ jsxs(MenuGroup, { label: __("Tools"), children: [
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
MenuItem,
|
|
63
|
+
{
|
|
64
|
+
onClick: () => {
|
|
65
|
+
setIsKeyboardShortcutsModalVisible(true);
|
|
66
|
+
},
|
|
67
|
+
shortcut: displayShortcut.access("h"),
|
|
68
|
+
children: __("Keyboard shortcuts")
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
PreferenceToggleMenuItem,
|
|
73
|
+
{
|
|
74
|
+
scope: "core/edit-widgets",
|
|
75
|
+
name: "welcomeGuide",
|
|
76
|
+
label: __("Welcome Guide")
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ jsxs(
|
|
80
|
+
MenuItem,
|
|
81
|
+
{
|
|
82
|
+
role: "menuitem",
|
|
83
|
+
icon: external,
|
|
84
|
+
href: __(
|
|
85
|
+
"https://wordpress.org/documentation/article/block-based-widgets-editor/"
|
|
86
|
+
),
|
|
87
|
+
target: "_blank",
|
|
88
|
+
rel: "noopener noreferrer",
|
|
89
|
+
children: [
|
|
90
|
+
__("Help"),
|
|
91
|
+
/* @__PURE__ */ jsx(VisuallyHidden, {
|
|
92
|
+
as: "span",
|
|
93
|
+
/* translators: accessibility text */
|
|
94
|
+
children: __("(opens in a new tab)")
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
ToolsMoreMenuGroup.Slot,
|
|
101
|
+
{
|
|
102
|
+
fillProps: { onClose }
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ jsxs(MenuGroup, { label: __("Preferences"), children: [
|
|
107
|
+
/* @__PURE__ */ jsx(
|
|
108
|
+
PreferenceToggleMenuItem,
|
|
109
|
+
{
|
|
110
|
+
scope: "core/edit-widgets",
|
|
111
|
+
name: "keepCaretInsideBlock",
|
|
112
|
+
label: __(
|
|
113
|
+
"Contain text cursor inside block"
|
|
114
|
+
),
|
|
115
|
+
info: __(
|
|
116
|
+
"Aids screen readers by stopping text caret from leaving blocks."
|
|
117
|
+
),
|
|
118
|
+
messageActivated: __(
|
|
119
|
+
"Contain text cursor inside block activated"
|
|
120
|
+
),
|
|
121
|
+
messageDeactivated: __(
|
|
122
|
+
"Contain text cursor inside block deactivated"
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
PreferenceToggleMenuItem,
|
|
128
|
+
{
|
|
129
|
+
scope: "core/edit-widgets",
|
|
130
|
+
name: "themeStyles",
|
|
131
|
+
info: __(
|
|
132
|
+
"Make the editor look like your theme."
|
|
133
|
+
),
|
|
134
|
+
label: __("Use theme styles")
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
isLargeViewport && /* @__PURE__ */ jsx(
|
|
138
|
+
PreferenceToggleMenuItem,
|
|
139
|
+
{
|
|
140
|
+
scope: "core/edit-widgets",
|
|
141
|
+
name: "showBlockBreadcrumbs",
|
|
142
|
+
label: __("Display block breadcrumbs"),
|
|
143
|
+
info: __(
|
|
144
|
+
"Shows block breadcrumbs at the bottom of the editor."
|
|
145
|
+
),
|
|
146
|
+
messageActivated: __(
|
|
147
|
+
"Display block breadcrumbs activated"
|
|
148
|
+
),
|
|
149
|
+
messageDeactivated: __(
|
|
150
|
+
"Display block breadcrumbs deactivated"
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
] })
|
|
155
|
+
] })
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ jsx(
|
|
159
|
+
KeyboardShortcutHelpModal,
|
|
160
|
+
{
|
|
161
|
+
isModalActive: isKeyboardShortcutsModalActive,
|
|
162
|
+
toggleModal: toggleKeyboardShortcutsModal
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] });
|
|
104
166
|
}
|
|
105
|
-
|
|
167
|
+
export {
|
|
168
|
+
MoreMenu as default
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/more-menu/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external, moreVertical } from '@wordpress/icons';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( onClose ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"welcomeGuide\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tname=\"themeStyles\"\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tname=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs deactivated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}) => /*#__PURE__*/_jsx(Slot, {
|
|
13
|
-
fillProps: fillProps,
|
|
14
|
-
children: fills => fills.length > 0 && fills
|
|
15
|
-
});
|
|
16
|
-
export default ToolsMoreMenuGroup;
|
|
17
|
-
//# sourceMappingURL=tools-more-menu-group.js.map
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createSlotFill } from "@wordpress/components";
|
|
3
|
+
const { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(
|
|
4
|
+
"EditWidgetsToolsMoreMenuGroup"
|
|
5
|
+
);
|
|
6
|
+
ToolsMoreMenuGroup.Slot = ({ fillProps }) => /* @__PURE__ */ jsx(Slot, { fillProps, children: (fills) => fills.length > 0 && fills });
|
|
7
|
+
var tools_more_menu_group_default = ToolsMoreMenuGroup;
|
|
8
|
+
export {
|
|
9
|
+
tools_more_menu_group_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=tools-more-menu-group.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/more-menu/tools-more-menu-group.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditWidgetsToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => fills.length > 0 && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"],
|
|
5
|
+
"mappings": "AAUC;AAPD,SAAS,sBAAsB;AAE/B,MAAM,EAAE,MAAM,oBAAoB,KAAK,IAAI;AAAA,EAC1C;AACD;AAEA,mBAAmB,OAAO,CAAE,EAAE,UAAU,MACvC,oBAAC,QAAK,WACH,WAAE,UAAW,MAAM,SAAS,KAAK,OACpC;AAGD,IAAO,gCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
7
|
-
|
|
8
|
-
// Last three notices. Slices from the tail end of the list.
|
|
9
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NoticeList, SnackbarList } from "@wordpress/components";
|
|
3
|
+
import { useSelect, useDispatch } from "@wordpress/data";
|
|
4
|
+
import { store as noticesStore } from "@wordpress/notices";
|
|
10
5
|
const MAX_VISIBLE_NOTICES = -3;
|
|
11
6
|
function Notices() {
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
} = useDispatch(noticesStore);
|
|
15
|
-
const {
|
|
16
|
-
notices
|
|
17
|
-
} = useSelect(select => {
|
|
7
|
+
const { removeNotice } = useDispatch(noticesStore);
|
|
8
|
+
const { notices } = useSelect((select) => {
|
|
18
9
|
return {
|
|
19
10
|
notices: select(noticesStore).getNotices()
|
|
20
11
|
};
|
|
21
12
|
}, []);
|
|
22
|
-
const dismissibleNotices = notices.filter(
|
|
23
|
-
isDismissible,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
13
|
+
const dismissibleNotices = notices.filter(
|
|
14
|
+
({ isDismissible, type }) => isDismissible && type === "default"
|
|
15
|
+
);
|
|
16
|
+
const nonDismissibleNotices = notices.filter(
|
|
17
|
+
({ isDismissible, type }) => !isDismissible && type === "default"
|
|
18
|
+
);
|
|
19
|
+
const snackbarNotices = notices.filter(({ type }) => type === "snackbar").slice(MAX_VISIBLE_NOTICES);
|
|
20
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
22
|
+
NoticeList,
|
|
23
|
+
{
|
|
24
|
+
notices: nonDismissibleNotices,
|
|
25
|
+
className: "edit-widgets-notices__pinned"
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
NoticeList,
|
|
30
|
+
{
|
|
31
|
+
notices: dismissibleNotices,
|
|
32
|
+
className: "edit-widgets-notices__dismissible",
|
|
33
|
+
onRemove: removeNotice
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
SnackbarList,
|
|
38
|
+
{
|
|
39
|
+
notices: snackbarNotices,
|
|
40
|
+
className: "edit-widgets-notices__snackbar",
|
|
41
|
+
onRemove: removeNotice
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] });
|
|
47
45
|
}
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
var notices_default = Notices;
|
|
47
|
+
export {
|
|
48
|
+
notices_default as default
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/notices/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { NoticeList, SnackbarList } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n// Last three notices. Slices from the tail end of the list.\nconst MAX_VISIBLE_NOTICES = -3;\n\nfunction Notices() {\n\tconst { removeNotice } = useDispatch( noticesStore );\n\tconst { notices } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tnotices: select( noticesStore ).getNotices(),\n\t\t};\n\t}, [] );\n\n\tconst dismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => isDismissible && type === 'default'\n\t);\n\tconst nonDismissibleNotices = notices.filter(\n\t\t( { isDismissible, type } ) => ! isDismissible && type === 'default'\n\t);\n\tconst snackbarNotices = notices\n\t\t.filter( ( { type } ) => type === 'snackbar' )\n\t\t.slice( MAX_VISIBLE_NOTICES );\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__dismissible\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t\t<SnackbarList\n\t\t\t\tnotices={ snackbarNotices }\n\t\t\t\tclassName=\"edit-widgets-notices__snackbar\"\n\t\t\t\tonRemove={ removeNotice }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default Notices;\n"],
|
|
5
|
+
"mappings": "AA6BE,mBACC,KADD;AA1BF,SAAS,YAAY,oBAAoB;AACzC,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,oBAAoB;AAGtC,MAAM,sBAAsB;AAE5B,SAAS,UAAU;AAClB,QAAM,EAAE,aAAa,IAAI,YAAa,YAAa;AACnD,QAAM,EAAE,QAAQ,IAAI,UAAW,CAAE,WAAY;AAC5C,WAAO;AAAA,MACN,SAAS,OAAQ,YAAa,EAAE,WAAW;AAAA,IAC5C;AAAA,EACD,GAAG,CAAC,CAAE;AAEN,QAAM,qBAAqB,QAAQ;AAAA,IAClC,CAAE,EAAE,eAAe,KAAK,MAAO,iBAAiB,SAAS;AAAA,EAC1D;AACA,QAAM,wBAAwB,QAAQ;AAAA,IACrC,CAAE,EAAE,eAAe,KAAK,MAAO,CAAE,iBAAiB,SAAS;AAAA,EAC5D;AACA,QAAM,kBAAkB,QACtB,OAAQ,CAAE,EAAE,KAAK,MAAO,SAAS,UAAW,EAC5C,MAAO,mBAAoB;AAE7B,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV,WAAU;AAAA;AAAA,IACX;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV,WAAU;AAAA,QACV,UAAW;AAAA;AAAA,IACZ;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,SAAU;AAAA,QACV,WAAU;AAAA,QACV,UAAW;AAAA;AAAA,IACZ;AAAA,KACD;AAEF;AAEA,IAAO,kBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,44 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import { store as editWidgetsStore } from '../../store';
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "@wordpress/components";
|
|
3
|
+
import { __ } from "@wordpress/i18n";
|
|
4
|
+
import { useDispatch, useSelect } from "@wordpress/data";
|
|
5
|
+
import { store as editWidgetsStore } from "../../store";
|
|
13
6
|
function SaveButton() {
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
const {
|
|
31
|
-
saveEditedWidgetAreas
|
|
32
|
-
} = useDispatch(editWidgetsStore);
|
|
7
|
+
const { hasEditedWidgetAreaIds, isSaving, isWidgetSaveLocked } = useSelect(
|
|
8
|
+
(select) => {
|
|
9
|
+
const {
|
|
10
|
+
getEditedWidgetAreas,
|
|
11
|
+
isSavingWidgetAreas,
|
|
12
|
+
isWidgetSavingLocked
|
|
13
|
+
} = select(editWidgetsStore);
|
|
14
|
+
return {
|
|
15
|
+
hasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0,
|
|
16
|
+
isSaving: isSavingWidgetAreas(),
|
|
17
|
+
isWidgetSaveLocked: isWidgetSavingLocked()
|
|
18
|
+
};
|
|
19
|
+
},
|
|
20
|
+
[]
|
|
21
|
+
);
|
|
22
|
+
const { saveEditedWidgetAreas } = useDispatch(editWidgetsStore);
|
|
33
23
|
const isDisabled = isWidgetSaveLocked || isSaving || !hasEditedWidgetAreaIds;
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
Button,
|
|
26
|
+
{
|
|
27
|
+
variant: "primary",
|
|
28
|
+
isBusy: isSaving,
|
|
29
|
+
"aria-disabled": isDisabled,
|
|
30
|
+
onClick: isDisabled ? void 0 : saveEditedWidgetAreas,
|
|
31
|
+
size: "compact",
|
|
32
|
+
children: isSaving ? __("Saving\u2026") : __("Update")
|
|
33
|
+
}
|
|
34
|
+
);
|
|
42
35
|
}
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
var save_button_default = SaveButton;
|
|
37
|
+
export {
|
|
38
|
+
save_button_default as default
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/save-button/index.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nfunction SaveButton() {\n\tconst { hasEditedWidgetAreaIds, isSaving, isWidgetSaveLocked } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetEditedWidgetAreas,\n\t\t\t\tisSavingWidgetAreas,\n\t\t\t\tisWidgetSavingLocked,\n\t\t\t} = select( editWidgetsStore );\n\n\t\t\treturn {\n\t\t\t\thasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0,\n\t\t\t\tisSaving: isSavingWidgetAreas(),\n\t\t\t\tisWidgetSaveLocked: isWidgetSavingLocked(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { saveEditedWidgetAreas } = useDispatch( editWidgetsStore );\n\n\tconst isDisabled =\n\t\tisWidgetSaveLocked || isSaving || ! hasEditedWidgetAreaIds;\n\n\treturn (\n\t\t<Button\n\t\t\tvariant=\"primary\"\n\t\t\tisBusy={ isSaving }\n\t\t\taria-disabled={ isDisabled }\n\t\t\tonClick={ isDisabled ? undefined : saveEditedWidgetAreas }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ isSaving ? __( 'Saving\u2026' ) : __( 'Update' ) }\n\t\t</Button>\n\t);\n}\n\nexport default SaveButton;\n"],
|
|
5
|
+
"mappings": "AAmCE;AAhCF,SAAS,cAAc;AACvB,SAAS,UAAU;AACnB,SAAS,aAAa,iBAAiB;AAKvC,SAAS,SAAS,wBAAwB;AAE1C,SAAS,aAAa;AACrB,QAAM,EAAE,wBAAwB,UAAU,mBAAmB,IAAI;AAAA,IAChE,CAAE,WAAY;AACb,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,gBAAiB;AAE7B,aAAO;AAAA,QACN,wBAAwB,qBAAqB,GAAG,SAAS;AAAA,QACzD,UAAU,oBAAoB;AAAA,QAC9B,oBAAoB,qBAAqB;AAAA,MAC1C;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AACA,QAAM,EAAE,sBAAsB,IAAI,YAAa,gBAAiB;AAEhE,QAAM,aACL,sBAAsB,YAAY,CAAE;AAErC,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAQ;AAAA,MACR,QAAS;AAAA,MACT,iBAAgB;AAAA,MAChB,SAAU,aAAa,SAAY;AAAA,MACnC,MAAK;AAAA,MAEH,qBAAW,GAAI,cAAU,IAAI,GAAI,QAAS;AAAA;AAAA,EAC7C;AAEF;AAEA,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,38 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import InserterSidebar from './inserter-sidebar';
|
|
14
|
-
import ListViewSidebar from './list-view-sidebar';
|
|
15
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
-
export default function SecondarySidebar() {
|
|
17
|
-
const {
|
|
18
|
-
isInserterOpen,
|
|
19
|
-
isListViewOpen
|
|
20
|
-
} = useSelect(select => {
|
|
21
|
-
const {
|
|
22
|
-
isInserterOpened,
|
|
23
|
-
isListViewOpened
|
|
24
|
-
} = select(editWidgetsStore);
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSelect } from "@wordpress/data";
|
|
3
|
+
import { store as editWidgetsStore } from "../../store";
|
|
4
|
+
import InserterSidebar from "./inserter-sidebar";
|
|
5
|
+
import ListViewSidebar from "./list-view-sidebar";
|
|
6
|
+
function SecondarySidebar() {
|
|
7
|
+
const { isInserterOpen, isListViewOpen } = useSelect((select) => {
|
|
8
|
+
const { isInserterOpened, isListViewOpened } = select(editWidgetsStore);
|
|
25
9
|
return {
|
|
26
10
|
isInserterOpen: isInserterOpened(),
|
|
27
11
|
isListViewOpen: isListViewOpened()
|
|
28
12
|
};
|
|
29
13
|
}, []);
|
|
30
14
|
if (isInserterOpen) {
|
|
31
|
-
return
|
|
15
|
+
return /* @__PURE__ */ jsx(InserterSidebar, {});
|
|
32
16
|
}
|
|
33
17
|
if (isListViewOpen) {
|
|
34
|
-
return
|
|
18
|
+
return /* @__PURE__ */ jsx(ListViewSidebar, {});
|
|
35
19
|
}
|
|
36
20
|
return null;
|
|
37
21
|
}
|
|
38
|
-
|
|
22
|
+
export {
|
|
23
|
+
SecondarySidebar as default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index.js.map
|