@wordpress/block-library 6.0.7 → 6.0.11
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/cover/edit.js +8 -3
- package/build/cover/edit.js.map +1 -1
- package/build/cover/transforms.js +2 -0
- package/build/cover/transforms.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/v1/update-gallery-modal.js +1 -1
- package/build/gallery/v1/update-gallery-modal.js.map +1 -1
- package/build/index.js +4 -3
- package/build/index.js.map +1 -1
- package/build/navigation/deprecated.js +127 -19
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +59 -33
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +1 -1
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +2 -2
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +16 -48
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +5 -2
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +4 -35
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js +50 -0
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -0
- package/build/navigation/edit/use-generate-default-navigation-title.js +73 -0
- package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -0
- package/build/navigation/index.js +1 -1
- package/build/navigation/save.js +2 -2
- package/build/navigation/save.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +19 -8
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-area/edit.js +5 -0
- package/build/navigation-area/edit.js.map +1 -1
- package/build/page-list/edit.js +40 -42
- package/build/page-list/edit.js.map +1 -1
- package/build/pattern/index.js +1 -1
- package/build/post-featured-image/edit.js +53 -23
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-terms/index.js +1 -1
- package/build/post-title/edit.js +2 -2
- package/build/post-title/edit.js.map +1 -1
- package/build/query-pagination-next/index.js +1 -1
- package/build/query-pagination-previous/index.js +1 -1
- package/build/query-title/index.js +1 -1
- package/build/site-logo/index.js +1 -1
- package/build/site-tagline/index.js +1 -1
- package/build/site-title/index.js +1 -1
- package/build/template-part/edit/placeholder/index.js +1 -1
- package/build/template-part/edit/placeholder/index.js.map +1 -1
- package/build/template-part/index.js +2 -1
- package/build/template-part/index.js.map +1 -1
- package/build-module/cover/edit.js +8 -3
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/cover/transforms.js +2 -0
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/v1/update-gallery-modal.js +1 -1
- package/build-module/gallery/v1/update-gallery-modal.js.map +1 -1
- package/build-module/index.js +4 -3
- package/build-module/index.js.map +1 -1
- package/build-module/navigation/deprecated.js +127 -19
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +60 -33
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +1 -1
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +2 -2
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +15 -45
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +5 -2
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +6 -35
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js +36 -0
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -0
- package/build-module/navigation/edit/use-generate-default-navigation-title.js +57 -0
- package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -0
- package/build-module/navigation/index.js +1 -1
- package/build-module/navigation/save.js +2 -2
- package/build-module/navigation/save.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +19 -8
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-area/edit.js +4 -0
- package/build-module/navigation-area/edit.js.map +1 -1
- package/build-module/page-list/edit.js +41 -43
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/pattern/index.js +1 -1
- package/build-module/post-featured-image/edit.js +55 -26
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-terms/index.js +1 -1
- package/build-module/post-title/edit.js +2 -2
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/query-pagination-next/index.js +1 -1
- package/build-module/query-pagination-previous/index.js +1 -1
- package/build-module/query-title/index.js +1 -1
- package/build-module/site-logo/index.js +1 -1
- package/build-module/site-tagline/index.js +1 -1
- package/build-module/site-title/index.js +1 -1
- package/build-module/template-part/edit/placeholder/index.js +2 -2
- package/build-module/template-part/edit/placeholder/index.js.map +1 -1
- package/build-module/template-part/index.js +2 -1
- package/build-module/template-part/index.js.map +1 -1
- package/build-style/code/theme-rtl.css +1 -1
- package/build-style/code/theme.css +1 -1
- package/build-style/cover/style-rtl.css +8 -2
- package/build-style/cover/style.css +8 -2
- package/build-style/editor-rtl.css +104 -53
- package/build-style/editor.css +104 -53
- package/build-style/gallery/editor-rtl.css +1 -0
- package/build-style/gallery/editor.css +1 -0
- package/build-style/navigation/style-rtl.css +41 -3
- package/build-style/navigation/style.css +41 -3
- package/build-style/post-comments-form/style-rtl.css +18 -0
- package/build-style/post-comments-form/style.css +18 -0
- package/build-style/post-featured-image/editor-rtl.css +100 -16
- package/build-style/post-featured-image/editor.css +100 -16
- package/build-style/site-logo/editor-rtl.css +2 -2
- package/build-style/site-logo/editor.css +2 -2
- package/build-style/social-links/editor-rtl.css +1 -35
- package/build-style/social-links/editor.css +1 -35
- package/build-style/style-rtl.css +67 -27
- package/build-style/style.css +67 -27
- package/build-style/theme-rtl.css +1 -1
- package/build-style/theme.css +1 -1
- package/package.json +8 -8
- package/src/calendar/index.php +3 -3
- package/src/code/theme.scss +1 -1
- package/src/cover/edit.js +8 -1
- package/src/cover/style.scss +9 -2
- package/src/cover/transforms.js +2 -0
- package/src/gallery/edit.js +1 -1
- package/src/gallery/editor.scss +1 -0
- package/src/gallery/index.php +1 -1
- package/src/gallery/v1/update-gallery-modal.js +1 -1
- package/src/home-link/index.php +1 -1
- package/src/image/index.php +1 -1
- package/src/index.js +28 -26
- package/src/navigation/block.json +1 -1
- package/src/navigation/deprecated.js +115 -13
- package/src/navigation/edit/index.js +68 -36
- package/src/navigation/edit/inner-blocks.js +2 -1
- package/src/navigation/edit/navigation-menu-selector.js +2 -2
- package/src/navigation/edit/placeholder/index.js +16 -62
- package/src/navigation/edit/responsive-wrapper.js +8 -1
- package/src/navigation/edit/unsaved-inner-blocks.js +6 -57
- package/src/navigation/edit/use-create-navigation-menu.js +39 -0
- package/src/navigation/edit/use-generate-default-navigation-title.js +79 -0
- package/src/navigation/index.php +171 -25
- package/src/navigation/save.js +2 -2
- package/src/navigation/style.scss +57 -5
- package/src/navigation/use-navigation-menu.js +20 -9
- package/src/navigation-area/edit.js +5 -0
- package/src/navigation-area/index.php +2 -1
- package/src/navigation-link/index.php +1 -1
- package/src/navigation-submenu/index.php +2 -8
- package/src/page-list/edit.js +35 -44
- package/src/page-list/index.php +10 -5
- package/src/pattern/block.json +1 -1
- package/src/post-comments-form/style.scss +20 -1
- package/src/post-featured-image/edit.js +58 -26
- package/src/post-featured-image/editor.scss +124 -20
- package/src/post-terms/block.json +1 -1
- package/src/post-title/edit.js +2 -2
- package/src/query-pagination-next/block.json +1 -1
- package/src/query-pagination-previous/block.json +1 -1
- package/src/query-title/block.json +1 -1
- package/src/site-logo/block.json +1 -1
- package/src/site-logo/editor.scss +3 -2
- package/src/site-tagline/block.json +1 -1
- package/src/site-title/block.json +1 -1
- package/src/social-links/editor.scss +1 -47
- package/src/style.scss +0 -1
- package/src/table-of-contents/index.php +1 -1
- package/src/template-part/block.json +2 -1
- package/src/template-part/edit/placeholder/index.js +2 -2
- package/src/template-part/index.php +2 -1
- package/build/navigation/edit/navigation-menu-name-modal.js +0 -55
- package/build/navigation/edit/navigation-menu-name-modal.js.map +0 -1
- package/build/navigation/edit/navigation-menu-publish-button.js +0 -53
- package/build/navigation/edit/navigation-menu-publish-button.js.map +0 -1
- package/build-module/navigation/edit/navigation-menu-name-modal.js +0 -47
- package/build-module/navigation/edit/navigation-menu-name-modal.js.map +0 -1
- package/build-module/navigation/edit/navigation-menu-publish-button.js +0 -40
- package/build-module/navigation/edit/navigation-menu-publish-button.js.map +0 -1
- package/build-style/navigation-submenu/style-rtl.css +0 -97
- package/build-style/navigation-submenu/style.css +0 -97
- package/src/navigation/edit/navigation-menu-name-modal.js +0 -69
- package/src/navigation/edit/navigation-menu-publish-button.js +0 -57
- package/src/navigation-submenu/style.scss +0 -25
package/src/site-logo/block.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"apiVersion": 2,
|
|
3
3
|
"name": "core/site-logo",
|
|
4
4
|
"title": "Site Logo",
|
|
5
|
-
"category": "
|
|
5
|
+
"category": "theme",
|
|
6
6
|
"description": "Display a graphic to represent this site. Update the block, and the changes apply everywhere it’s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.",
|
|
7
7
|
"textdomain": "default",
|
|
8
8
|
"attributes": {
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
width: 120px;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
// Style the placeholder.
|
|
60
61
|
.components-placeholder {
|
|
61
62
|
justify-content: center;
|
|
62
63
|
align-items: center;
|
|
@@ -109,7 +110,7 @@
|
|
|
109
110
|
bottom: 0;
|
|
110
111
|
left: 0;
|
|
111
112
|
border: $border-width dashed currentColor;
|
|
112
|
-
opacity: 0.
|
|
113
|
+
opacity: 0.4;
|
|
113
114
|
pointer-events: none;
|
|
114
115
|
|
|
115
116
|
// Inherit border radius from style variations.
|
|
@@ -154,7 +155,7 @@
|
|
|
154
155
|
height: 100%;
|
|
155
156
|
stroke: currentColor;
|
|
156
157
|
stroke-dasharray: 3;
|
|
157
|
-
opacity: 0.
|
|
158
|
+
opacity: 0.4;
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
161
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"apiVersion": 2,
|
|
3
3
|
"name": "core/site-tagline",
|
|
4
4
|
"title": "Site Tagline",
|
|
5
|
-
"category": "
|
|
5
|
+
"category": "theme",
|
|
6
6
|
"description": "Describe in a few words what the website is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",
|
|
7
7
|
"keywords": [ "description" ],
|
|
8
8
|
"textdomain": "default",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"apiVersion": 2,
|
|
3
3
|
"name": "core/site-title",
|
|
4
4
|
"title": "Site Title",
|
|
5
|
-
"category": "
|
|
5
|
+
"category": "theme",
|
|
6
6
|
"description": "Displays the name of this site. Update the block, and the changes apply everywhere it’s used. This will also appear in the browser title bar and in search results.",
|
|
7
7
|
"textdomain": "default",
|
|
8
8
|
"attributes": {
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
display: flex;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
& + .block-list-appender,
|
|
41
40
|
.wp-social-link {
|
|
42
41
|
padding: 0.25em;
|
|
43
42
|
|
|
@@ -66,6 +65,7 @@
|
|
|
66
65
|
|
|
67
66
|
// Selected placeholder state.
|
|
68
67
|
.wp-block-social-links .wp-block-social-links__social-prompt {
|
|
68
|
+
min-height: $button-size-small;
|
|
69
69
|
list-style: none;
|
|
70
70
|
order: 2; // Move after the appender button. Because this element is non-interactive, it does not affect tab order.
|
|
71
71
|
|
|
@@ -77,52 +77,6 @@
|
|
|
77
77
|
margin-bottom: auto;
|
|
78
78
|
cursor: default;
|
|
79
79
|
padding-right: $grid-unit-10;
|
|
80
|
-
|
|
81
|
-
& + .block-list-appender {
|
|
82
|
-
margin-right: $grid-unit-10;
|
|
83
|
-
padding: 0.25em;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Polish the Appender.
|
|
88
|
-
.wp-block-social-links .block-list-appender {
|
|
89
|
-
// Match the overall silhouette of social links.
|
|
90
|
-
margin: 4px auto 4px 0;
|
|
91
|
-
border-radius: 9999px; // This works as both circular and pill shapes.
|
|
92
|
-
|
|
93
|
-
// Treat just like a social icon.
|
|
94
|
-
.block-editor-inserter {
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: center;
|
|
97
|
-
justify-content: center;
|
|
98
|
-
font-size: inherit;
|
|
99
|
-
width: 1em;
|
|
100
|
-
height: 1em;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Duplicate the font sizes from style.scss to size the appender.
|
|
104
|
-
.has-small-icon-size & {
|
|
105
|
-
font-size: 16px; // 16 makes for a quarter-padding that keeps the icon centered.
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Normal/default.
|
|
109
|
-
.has-normal-icon-size & {
|
|
110
|
-
font-size: 24px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Large.
|
|
114
|
-
.has-large-icon-size & {
|
|
115
|
-
font-size: 36px;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Huge.
|
|
119
|
-
.has-huge-icon-size & {
|
|
120
|
-
font-size: 48px;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
&::before {
|
|
124
|
-
content: none;
|
|
125
|
-
}
|
|
126
80
|
}
|
|
127
81
|
|
|
128
82
|
// Center flex items. This has an equivalent in style.scss.
|
package/src/style.scss
CHANGED
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
@import "./media-text/style.scss";
|
|
20
20
|
@import "./navigation/style.scss";
|
|
21
21
|
@import "./navigation-link/style.scss";
|
|
22
|
-
@import "./navigation-submenu/style.scss";
|
|
23
22
|
@import "./home-link/style.scss";
|
|
24
23
|
@import "./page-list/style.scss";
|
|
25
24
|
@import "./paragraph/style.scss";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { find } from 'lodash';
|
|
4
|
+
import { find, kebabCase } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -65,7 +65,7 @@ export default function TemplatePartPlaceholder( {
|
|
|
65
65
|
// block attributes.
|
|
66
66
|
const record = {
|
|
67
67
|
title,
|
|
68
|
-
slug:
|
|
68
|
+
slug: kebabCase( title ),
|
|
69
69
|
content: serialize( startingBlocks ),
|
|
70
70
|
// `area` is filterable on the server and defaults to `UNCATEGORIZED`
|
|
71
71
|
// if provided value is not allowed.
|
|
@@ -53,7 +53,8 @@ function render_block_core_template_part( $attributes ) {
|
|
|
53
53
|
} else {
|
|
54
54
|
// Else, if the template part was provided by the active theme,
|
|
55
55
|
// render the corresponding file content.
|
|
56
|
-
$
|
|
56
|
+
$theme_folders = get_block_theme_folders();
|
|
57
|
+
$template_part_file_path = get_theme_file_path( '/' . $theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' );
|
|
57
58
|
if ( 0 === validate_file( $attributes['slug'] ) && file_exists( $template_part_file_path ) ) {
|
|
58
59
|
$content = file_get_contents( $template_part_file_path );
|
|
59
60
|
$content = is_string( $content ) && '' !== $content
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = NavigationMenuNameModal;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
|
|
12
|
-
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
function NavigationMenuNameModal(_ref) {
|
|
18
|
-
let {
|
|
19
|
-
title,
|
|
20
|
-
finishButtonText = (0, _i18n.__)('Create'),
|
|
21
|
-
onFinish,
|
|
22
|
-
onRequestClose,
|
|
23
|
-
value = ''
|
|
24
|
-
} = _ref;
|
|
25
|
-
const [name, setName] = (0, _element.useState)(value);
|
|
26
|
-
return (0, _element.createElement)(_components.Modal, {
|
|
27
|
-
title: title,
|
|
28
|
-
closeLabel: (0, _i18n.__)('Cancel'),
|
|
29
|
-
onRequestClose: onRequestClose,
|
|
30
|
-
overlayClassName: "wp-block-template-part__placeholder-create-new__title-form"
|
|
31
|
-
}, (0, _element.createElement)("form", {
|
|
32
|
-
onSubmit: event => {
|
|
33
|
-
event.preventDefault();
|
|
34
|
-
onFinish(name);
|
|
35
|
-
}
|
|
36
|
-
}, (0, _element.createElement)(_components.TextControl, {
|
|
37
|
-
label: (0, _i18n.__)('Name'),
|
|
38
|
-
value: name,
|
|
39
|
-
onChange: setName
|
|
40
|
-
}), (0, _element.createElement)(_components.Flex, {
|
|
41
|
-
className: "wp-block-template-part__placeholder-create-new__title-form-actions",
|
|
42
|
-
justify: "flex-end"
|
|
43
|
-
}, (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_components.Button, {
|
|
44
|
-
variant: "secondary",
|
|
45
|
-
onClick: () => {
|
|
46
|
-
onRequestClose();
|
|
47
|
-
}
|
|
48
|
-
}, (0, _i18n.__)('Cancel'))), (0, _element.createElement)(_components.FlexItem, null, (0, _element.createElement)(_components.Button, {
|
|
49
|
-
variant: "primary",
|
|
50
|
-
type: "submit",
|
|
51
|
-
disabled: !name.length,
|
|
52
|
-
"aria-disabled": !name.length
|
|
53
|
-
}, finishButtonText)))));
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=navigation-menu-name-modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation/edit/navigation-menu-name-modal.js"],"names":["NavigationMenuNameModal","title","finishButtonText","onFinish","onRequestClose","value","name","setName","event","preventDefault","length"],"mappings":";;;;;;;AAUA;;AAPA;;AAQA;;AAXA;AACA;AACA;AAWe,SAASA,uBAAT,OAMX;AAAA,MAN6C;AAChDC,IAAAA,KADgD;AAEhDC,IAAAA,gBAAgB,GAAG,cAAI,QAAJ,CAF6B;AAGhDC,IAAAA,QAHgD;AAIhDC,IAAAA,cAJgD;AAKhDC,IAAAA,KAAK,GAAG;AALwC,GAM7C;AACH,QAAM,CAAEC,IAAF,EAAQC,OAAR,IAAoB,uBAAUF,KAAV,CAA1B;AAEA,SACC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAGJ,KADT;AAEC,IAAA,UAAU,EAAG,cAAI,QAAJ,CAFd;AAGC,IAAA,cAAc,EAAGG,cAHlB;AAIC,IAAA,gBAAgB,EAAC;AAJlB,KAMC;AACC,IAAA,QAAQ,EAAKI,KAAF,IAAa;AACvBA,MAAAA,KAAK,CAACC,cAAN;AACAN,MAAAA,QAAQ,CAAEG,IAAF,CAAR;AACA;AAJF,KAMC,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,MAAJ,CADT;AAEC,IAAA,KAAK,EAAGA,IAFT;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IAND,EAWC,4BAAC,gBAAD;AACC,IAAA,SAAS,EAAC,oEADX;AAEC,IAAA,OAAO,EAAC;AAFT,KAIC,4BAAC,oBAAD,QACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,OAAO,EAAG,MAAM;AACfH,MAAAA,cAAc;AACd;AAJF,KAMG,cAAI,QAAJ,CANH,CADD,CAJD,EAcC,4BAAC,oBAAD,QACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,QAAQ,EAAG,CAAEE,IAAI,CAACI,MAHnB;AAIC,qBAAgB,CAAEJ,IAAI,CAACI;AAJxB,KAMGR,gBANH,CADD,CAdD,CAXD,CAND,CADD;AA8CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tFlex,\n\tFlexItem,\n\tModal,\n\tTextControl,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\nexport default function NavigationMenuNameModal( {\n\ttitle,\n\tfinishButtonText = __( 'Create' ),\n\tonFinish,\n\tonRequestClose,\n\tvalue = '',\n} ) {\n\tconst [ name, setName ] = useState( value );\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ title }\n\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\tonRequestClose={ onRequestClose }\n\t\t\toverlayClassName=\"wp-block-template-part__placeholder-create-new__title-form\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tonFinish( name );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ name }\n\t\t\t\t\tonChange={ setName }\n\t\t\t\t/>\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"wp-block-template-part__placeholder-create-new__title-form-actions\"\n\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonRequestClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tdisabled={ ! name.length }\n\t\t\t\t\t\t\taria-disabled={ ! name.length }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ finishButtonText }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = NavigationMenuPublishButton;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _components = require("@wordpress/components");
|
|
13
|
-
|
|
14
|
-
var _coreData = require("@wordpress/core-data");
|
|
15
|
-
|
|
16
|
-
var _data = require("@wordpress/data");
|
|
17
|
-
|
|
18
|
-
var _i18n = require("@wordpress/i18n");
|
|
19
|
-
|
|
20
|
-
var _navigationMenuNameModal = _interopRequireDefault(require("./navigation-menu-name-modal"));
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* WordPress dependencies
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Internal dependencies
|
|
28
|
-
*/
|
|
29
|
-
function NavigationMenuPublishButton() {
|
|
30
|
-
const [isNameModalVisible, setIsNameModalVisible] = (0, _element.useState)(false);
|
|
31
|
-
const id = (0, _coreData.useEntityId)('postType', 'wp_navigation');
|
|
32
|
-
const [navigationMenuTitle] = (0, _coreData.useEntityProp)('postType', 'wp_navigation', 'title');
|
|
33
|
-
const {
|
|
34
|
-
editEntityRecord,
|
|
35
|
-
saveEditedEntityRecord
|
|
36
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
37
|
-
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.ToolbarButton, {
|
|
38
|
-
onClick: () => setIsNameModalVisible(true)
|
|
39
|
-
}, (0, _i18n.__)('Save as')), isNameModalVisible && (0, _element.createElement)(_navigationMenuNameModal.default, {
|
|
40
|
-
title: (0, _i18n.__)('Save your new navigation menu'),
|
|
41
|
-
value: navigationMenuTitle,
|
|
42
|
-
onRequestClose: () => setIsNameModalVisible(false),
|
|
43
|
-
finishButtonText: (0, _i18n.__)('Save'),
|
|
44
|
-
onFinish: updatedTitle => {
|
|
45
|
-
editEntityRecord('postType', 'wp_navigation', id, {
|
|
46
|
-
title: updatedTitle,
|
|
47
|
-
status: 'publish'
|
|
48
|
-
});
|
|
49
|
-
saveEditedEntityRecord('postType', 'wp_navigation', id);
|
|
50
|
-
}
|
|
51
|
-
}));
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=navigation-menu-publish-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation/edit/navigation-menu-publish-button.js"],"names":["NavigationMenuPublishButton","isNameModalVisible","setIsNameModalVisible","id","navigationMenuTitle","editEntityRecord","saveEditedEntityRecord","coreStore","updatedTitle","title","status"],"mappings":";;;;;;;;;AAUA;;AAPA;;AACA;;AAKA;;AAEA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;AAGe,SAASA,2BAAT,GAAuC;AACrD,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IAAgD,uBAAU,KAAV,CAAtD;AACA,QAAMC,EAAE,GAAG,2BAAa,UAAb,EAAyB,eAAzB,CAAX;AACA,QAAM,CAAEC,mBAAF,IAA0B,6BAC/B,UAD+B,EAE/B,eAF+B,EAG/B,OAH+B,CAAhC;AAKA,QAAM;AAAEC,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAA+C,uBACpDC,eADoD,CAArD;AAIA,SACC,qDACC,4BAAC,yBAAD;AAAe,IAAA,OAAO,EAAG,MAAML,qBAAqB,CAAE,IAAF;AAApD,KACG,cAAI,SAAJ,CADH,CADD,EAIGD,kBAAkB,IACnB,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAG,cAAI,+BAAJ,CADT;AAEC,IAAA,KAAK,EAAGG,mBAFT;AAGC,IAAA,cAAc,EAAG,MAAMF,qBAAqB,CAAE,KAAF,CAH7C;AAIC,IAAA,gBAAgB,EAAG,cAAI,MAAJ,CAJpB;AAKC,IAAA,QAAQ,EAAKM,YAAF,IAAoB;AAC9BH,MAAAA,gBAAgB,CAAE,UAAF,EAAc,eAAd,EAA+BF,EAA/B,EAAmC;AAClDM,QAAAA,KAAK,EAAED,YAD2C;AAElDE,QAAAA,MAAM,EAAE;AAF0C,OAAnC,CAAhB;AAIAJ,MAAAA,sBAAsB,CACrB,UADqB,EAErB,eAFqB,EAGrBH,EAHqB,CAAtB;AAKA;AAfF,IALF,CADD;AA0BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarButton } from '@wordpress/components';\nimport {\n\tuseEntityId,\n\tuseEntityProp,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuNameModal from './navigation-menu-name-modal';\n\nexport default function NavigationMenuPublishButton() {\n\tconst [ isNameModalVisible, setIsNameModalVisible ] = useState( false );\n\tconst id = useEntityId( 'postType', 'wp_navigation' );\n\tconst [ navigationMenuTitle ] = useEntityProp(\n\t\t'postType',\n\t\t'wp_navigation',\n\t\t'title'\n\t);\n\tconst { editEntityRecord, saveEditedEntityRecord } = useDispatch(\n\t\tcoreStore\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton onClick={ () => setIsNameModalVisible( true ) }>\n\t\t\t\t{ __( 'Save as' ) }\n\t\t\t</ToolbarButton>\n\t\t\t{ isNameModalVisible && (\n\t\t\t\t<NavigationMenuNameModal\n\t\t\t\t\ttitle={ __( 'Save your new navigation menu' ) }\n\t\t\t\t\tvalue={ navigationMenuTitle }\n\t\t\t\t\tonRequestClose={ () => setIsNameModalVisible( false ) }\n\t\t\t\t\tfinishButtonText={ __( 'Save' ) }\n\t\t\t\t\tonFinish={ ( updatedTitle ) => {\n\t\t\t\t\t\teditEntityRecord( 'postType', 'wp_navigation', id, {\n\t\t\t\t\t\t\ttitle: updatedTitle,\n\t\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsaveEditedEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_navigation',\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { Button, Flex, FlexItem, Modal, TextControl } from '@wordpress/components';
|
|
7
|
-
import { useState } from '@wordpress/element';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
export default function NavigationMenuNameModal(_ref) {
|
|
10
|
-
let {
|
|
11
|
-
title,
|
|
12
|
-
finishButtonText = __('Create'),
|
|
13
|
-
onFinish,
|
|
14
|
-
onRequestClose,
|
|
15
|
-
value = ''
|
|
16
|
-
} = _ref;
|
|
17
|
-
const [name, setName] = useState(value);
|
|
18
|
-
return createElement(Modal, {
|
|
19
|
-
title: title,
|
|
20
|
-
closeLabel: __('Cancel'),
|
|
21
|
-
onRequestClose: onRequestClose,
|
|
22
|
-
overlayClassName: "wp-block-template-part__placeholder-create-new__title-form"
|
|
23
|
-
}, createElement("form", {
|
|
24
|
-
onSubmit: event => {
|
|
25
|
-
event.preventDefault();
|
|
26
|
-
onFinish(name);
|
|
27
|
-
}
|
|
28
|
-
}, createElement(TextControl, {
|
|
29
|
-
label: __('Name'),
|
|
30
|
-
value: name,
|
|
31
|
-
onChange: setName
|
|
32
|
-
}), createElement(Flex, {
|
|
33
|
-
className: "wp-block-template-part__placeholder-create-new__title-form-actions",
|
|
34
|
-
justify: "flex-end"
|
|
35
|
-
}, createElement(FlexItem, null, createElement(Button, {
|
|
36
|
-
variant: "secondary",
|
|
37
|
-
onClick: () => {
|
|
38
|
-
onRequestClose();
|
|
39
|
-
}
|
|
40
|
-
}, __('Cancel'))), createElement(FlexItem, null, createElement(Button, {
|
|
41
|
-
variant: "primary",
|
|
42
|
-
type: "submit",
|
|
43
|
-
disabled: !name.length,
|
|
44
|
-
"aria-disabled": !name.length
|
|
45
|
-
}, finishButtonText)))));
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=navigation-menu-name-modal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation/edit/navigation-menu-name-modal.js"],"names":["Button","Flex","FlexItem","Modal","TextControl","useState","__","NavigationMenuNameModal","title","finishButtonText","onFinish","onRequestClose","value","name","setName","event","preventDefault","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,IAFD,EAGCC,QAHD,EAICC,KAJD,EAKCC,WALD,QAMO,uBANP;AAOA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,eAAe,SAASC,uBAAT,OAMX;AAAA,MAN6C;AAChDC,IAAAA,KADgD;AAEhDC,IAAAA,gBAAgB,GAAGH,EAAE,CAAE,QAAF,CAF2B;AAGhDI,IAAAA,QAHgD;AAIhDC,IAAAA,cAJgD;AAKhDC,IAAAA,KAAK,GAAG;AALwC,GAM7C;AACH,QAAM,CAAEC,IAAF,EAAQC,OAAR,IAAoBT,QAAQ,CAAEO,KAAF,CAAlC;AAEA,SACC,cAAC,KAAD;AACC,IAAA,KAAK,EAAGJ,KADT;AAEC,IAAA,UAAU,EAAGF,EAAE,CAAE,QAAF,CAFhB;AAGC,IAAA,cAAc,EAAGK,cAHlB;AAIC,IAAA,gBAAgB,EAAC;AAJlB,KAMC;AACC,IAAA,QAAQ,EAAKI,KAAF,IAAa;AACvBA,MAAAA,KAAK,CAACC,cAAN;AACAN,MAAAA,QAAQ,CAAEG,IAAF,CAAR;AACA;AAJF,KAMC,cAAC,WAAD;AACC,IAAA,KAAK,EAAGP,EAAE,CAAE,MAAF,CADX;AAEC,IAAA,KAAK,EAAGO,IAFT;AAGC,IAAA,QAAQ,EAAGC;AAHZ,IAND,EAWC,cAAC,IAAD;AACC,IAAA,SAAS,EAAC,oEADX;AAEC,IAAA,OAAO,EAAC;AAFT,KAIC,cAAC,QAAD,QACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,WADT;AAEC,IAAA,OAAO,EAAG,MAAM;AACfH,MAAAA,cAAc;AACd;AAJF,KAMGL,EAAE,CAAE,QAAF,CANL,CADD,CAJD,EAcC,cAAC,QAAD,QACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,IAAI,EAAC,QAFN;AAGC,IAAA,QAAQ,EAAG,CAAEO,IAAI,CAACI,MAHnB;AAIC,qBAAgB,CAAEJ,IAAI,CAACI;AAJxB,KAMGR,gBANH,CADD,CAdD,CAXD,CAND,CADD;AA8CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tFlex,\n\tFlexItem,\n\tModal,\n\tTextControl,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\nexport default function NavigationMenuNameModal( {\n\ttitle,\n\tfinishButtonText = __( 'Create' ),\n\tonFinish,\n\tonRequestClose,\n\tvalue = '',\n} ) {\n\tconst [ name, setName ] = useState( value );\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ title }\n\t\t\tcloseLabel={ __( 'Cancel' ) }\n\t\t\tonRequestClose={ onRequestClose }\n\t\t\toverlayClassName=\"wp-block-template-part__placeholder-create-new__title-form\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tonFinish( name );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ name }\n\t\t\t\t\tonChange={ setName }\n\t\t\t\t/>\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"wp-block-template-part__placeholder-create-new__title-form-actions\"\n\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tonRequestClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tdisabled={ ! name.length }\n\t\t\t\t\t\t\taria-disabled={ ! name.length }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ finishButtonText }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"]}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { ToolbarButton } from '@wordpress/components';
|
|
7
|
-
import { useEntityId, useEntityProp, store as coreStore } from '@wordpress/core-data';
|
|
8
|
-
import { useDispatch } from '@wordpress/data';
|
|
9
|
-
import { useState } from '@wordpress/element';
|
|
10
|
-
import { __ } from '@wordpress/i18n';
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import NavigationMenuNameModal from './navigation-menu-name-modal';
|
|
16
|
-
export default function NavigationMenuPublishButton() {
|
|
17
|
-
const [isNameModalVisible, setIsNameModalVisible] = useState(false);
|
|
18
|
-
const id = useEntityId('postType', 'wp_navigation');
|
|
19
|
-
const [navigationMenuTitle] = useEntityProp('postType', 'wp_navigation', 'title');
|
|
20
|
-
const {
|
|
21
|
-
editEntityRecord,
|
|
22
|
-
saveEditedEntityRecord
|
|
23
|
-
} = useDispatch(coreStore);
|
|
24
|
-
return createElement(Fragment, null, createElement(ToolbarButton, {
|
|
25
|
-
onClick: () => setIsNameModalVisible(true)
|
|
26
|
-
}, __('Save as')), isNameModalVisible && createElement(NavigationMenuNameModal, {
|
|
27
|
-
title: __('Save your new navigation menu'),
|
|
28
|
-
value: navigationMenuTitle,
|
|
29
|
-
onRequestClose: () => setIsNameModalVisible(false),
|
|
30
|
-
finishButtonText: __('Save'),
|
|
31
|
-
onFinish: updatedTitle => {
|
|
32
|
-
editEntityRecord('postType', 'wp_navigation', id, {
|
|
33
|
-
title: updatedTitle,
|
|
34
|
-
status: 'publish'
|
|
35
|
-
});
|
|
36
|
-
saveEditedEntityRecord('postType', 'wp_navigation', id);
|
|
37
|
-
}
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=navigation-menu-publish-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation/edit/navigation-menu-publish-button.js"],"names":["ToolbarButton","useEntityId","useEntityProp","store","coreStore","useDispatch","useState","__","NavigationMenuNameModal","NavigationMenuPublishButton","isNameModalVisible","setIsNameModalVisible","id","navigationMenuTitle","editEntityRecord","saveEditedEntityRecord","updatedTitle","title","status"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,uBAA9B;AACA,SACCC,WADD,EAECC,aAFD,EAGCC,KAAK,IAAIC,SAHV,QAIO,sBAJP;AAKA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AAEA,eAAe,SAASC,2BAAT,GAAuC;AACrD,QAAM,CAAEC,kBAAF,EAAsBC,qBAAtB,IAAgDL,QAAQ,CAAE,KAAF,CAA9D;AACA,QAAMM,EAAE,GAAGX,WAAW,CAAE,UAAF,EAAc,eAAd,CAAtB;AACA,QAAM,CAAEY,mBAAF,IAA0BX,aAAa,CAC5C,UAD4C,EAE5C,eAF4C,EAG5C,OAH4C,CAA7C;AAKA,QAAM;AAAEY,IAAAA,gBAAF;AAAoBC,IAAAA;AAApB,MAA+CV,WAAW,CAC/DD,SAD+D,CAAhE;AAIA,SACC,8BACC,cAAC,aAAD;AAAe,IAAA,OAAO,EAAG,MAAMO,qBAAqB,CAAE,IAAF;AAApD,KACGJ,EAAE,CAAE,SAAF,CADL,CADD,EAIGG,kBAAkB,IACnB,cAAC,uBAAD;AACC,IAAA,KAAK,EAAGH,EAAE,CAAE,+BAAF,CADX;AAEC,IAAA,KAAK,EAAGM,mBAFT;AAGC,IAAA,cAAc,EAAG,MAAMF,qBAAqB,CAAE,KAAF,CAH7C;AAIC,IAAA,gBAAgB,EAAGJ,EAAE,CAAE,MAAF,CAJtB;AAKC,IAAA,QAAQ,EAAKS,YAAF,IAAoB;AAC9BF,MAAAA,gBAAgB,CAAE,UAAF,EAAc,eAAd,EAA+BF,EAA/B,EAAmC;AAClDK,QAAAA,KAAK,EAAED,YAD2C;AAElDE,QAAAA,MAAM,EAAE;AAF0C,OAAnC,CAAhB;AAIAH,MAAAA,sBAAsB,CACrB,UADqB,EAErB,eAFqB,EAGrBH,EAHqB,CAAtB;AAKA;AAfF,IALF,CADD;AA0BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarButton } from '@wordpress/components';\nimport {\n\tuseEntityId,\n\tuseEntityProp,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { useDispatch } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuNameModal from './navigation-menu-name-modal';\n\nexport default function NavigationMenuPublishButton() {\n\tconst [ isNameModalVisible, setIsNameModalVisible ] = useState( false );\n\tconst id = useEntityId( 'postType', 'wp_navigation' );\n\tconst [ navigationMenuTitle ] = useEntityProp(\n\t\t'postType',\n\t\t'wp_navigation',\n\t\t'title'\n\t);\n\tconst { editEntityRecord, saveEditedEntityRecord } = useDispatch(\n\t\tcoreStore\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton onClick={ () => setIsNameModalVisible( true ) }>\n\t\t\t\t{ __( 'Save as' ) }\n\t\t\t</ToolbarButton>\n\t\t\t{ isNameModalVisible && (\n\t\t\t\t<NavigationMenuNameModal\n\t\t\t\t\ttitle={ __( 'Save your new navigation menu' ) }\n\t\t\t\t\tvalue={ navigationMenuTitle }\n\t\t\t\t\tonRequestClose={ () => setIsNameModalVisible( false ) }\n\t\t\t\t\tfinishButtonText={ __( 'Save' ) }\n\t\t\t\t\tonFinish={ ( updatedTitle ) => {\n\t\t\t\t\t\teditEntityRecord( 'postType', 'wp_navigation', id, {\n\t\t\t\t\t\t\ttitle: updatedTitle,\n\t\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tsaveEditedEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'wp_navigation',\n\t\t\t\t\t\t\tid\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Colors
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Breakpoints & Media Queries
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* SCSS Variables.
|
|
9
|
-
*
|
|
10
|
-
* Please use variables from this sheet to ensure consistency across the UI.
|
|
11
|
-
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
12
|
-
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Colors
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Fonts & basic variables.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Grid System.
|
|
22
|
-
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* Dimensions.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Shadows.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Editor widths.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Block & Editor UI.
|
|
35
|
-
*/
|
|
36
|
-
/**
|
|
37
|
-
* Block paddings.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* React Native specific.
|
|
41
|
-
* These variables do not appear to be used anywhere else.
|
|
42
|
-
*/
|
|
43
|
-
/**
|
|
44
|
-
* Converts a hex value into the rgb equivalent.
|
|
45
|
-
*
|
|
46
|
-
* @param {string} hex - the hexadecimal value to convert
|
|
47
|
-
* @return {string} comma separated rgb values
|
|
48
|
-
*/
|
|
49
|
-
/**
|
|
50
|
-
* Breakpoint mixins
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* Long content fade mixin
|
|
54
|
-
*
|
|
55
|
-
* Creates a fading overlay to signify that the content is longer
|
|
56
|
-
* than the space allows.
|
|
57
|
-
*/
|
|
58
|
-
/**
|
|
59
|
-
* Focus styles.
|
|
60
|
-
*/
|
|
61
|
-
/**
|
|
62
|
-
* Applies editor left position to the selector passed as argument
|
|
63
|
-
*/
|
|
64
|
-
/**
|
|
65
|
-
* Styles that are reused verbatim in a few places
|
|
66
|
-
*/
|
|
67
|
-
/**
|
|
68
|
-
* Allows users to opt-out of animations via OS-level preferences.
|
|
69
|
-
*/
|
|
70
|
-
/**
|
|
71
|
-
* Reset default styles for JavaScript UI based pages.
|
|
72
|
-
* This is a WP-admin agnostic reset
|
|
73
|
-
*/
|
|
74
|
-
/**
|
|
75
|
-
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
76
|
-
*/
|
|
77
|
-
.wp-block-navigation-submenu {
|
|
78
|
-
position: relative;
|
|
79
|
-
display: flex;
|
|
80
|
-
}
|
|
81
|
-
.wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg {
|
|
82
|
-
stroke: currentColor;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
button.wp-block-navigation-item__content {
|
|
86
|
-
background-color: transparent;
|
|
87
|
-
border: none;
|
|
88
|
-
color: currentColor;
|
|
89
|
-
font-size: inherit;
|
|
90
|
-
font-family: inherit;
|
|
91
|
-
line-height: inherit;
|
|
92
|
-
text-align: right;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.wp-block-navigation-submenu__toggle {
|
|
96
|
-
cursor: pointer;
|
|
97
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Colors
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Breakpoints & Media Queries
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* SCSS Variables.
|
|
9
|
-
*
|
|
10
|
-
* Please use variables from this sheet to ensure consistency across the UI.
|
|
11
|
-
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
|
12
|
-
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Colors
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Fonts & basic variables.
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* Grid System.
|
|
22
|
-
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* Dimensions.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Shadows.
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* Editor widths.
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Block & Editor UI.
|
|
35
|
-
*/
|
|
36
|
-
/**
|
|
37
|
-
* Block paddings.
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* React Native specific.
|
|
41
|
-
* These variables do not appear to be used anywhere else.
|
|
42
|
-
*/
|
|
43
|
-
/**
|
|
44
|
-
* Converts a hex value into the rgb equivalent.
|
|
45
|
-
*
|
|
46
|
-
* @param {string} hex - the hexadecimal value to convert
|
|
47
|
-
* @return {string} comma separated rgb values
|
|
48
|
-
*/
|
|
49
|
-
/**
|
|
50
|
-
* Breakpoint mixins
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* Long content fade mixin
|
|
54
|
-
*
|
|
55
|
-
* Creates a fading overlay to signify that the content is longer
|
|
56
|
-
* than the space allows.
|
|
57
|
-
*/
|
|
58
|
-
/**
|
|
59
|
-
* Focus styles.
|
|
60
|
-
*/
|
|
61
|
-
/**
|
|
62
|
-
* Applies editor left position to the selector passed as argument
|
|
63
|
-
*/
|
|
64
|
-
/**
|
|
65
|
-
* Styles that are reused verbatim in a few places
|
|
66
|
-
*/
|
|
67
|
-
/**
|
|
68
|
-
* Allows users to opt-out of animations via OS-level preferences.
|
|
69
|
-
*/
|
|
70
|
-
/**
|
|
71
|
-
* Reset default styles for JavaScript UI based pages.
|
|
72
|
-
* This is a WP-admin agnostic reset
|
|
73
|
-
*/
|
|
74
|
-
/**
|
|
75
|
-
* Reset the WP Admin page styles for Gutenberg-like pages.
|
|
76
|
-
*/
|
|
77
|
-
.wp-block-navigation-submenu {
|
|
78
|
-
position: relative;
|
|
79
|
-
display: flex;
|
|
80
|
-
}
|
|
81
|
-
.wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg {
|
|
82
|
-
stroke: currentColor;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
button.wp-block-navigation-item__content {
|
|
86
|
-
background-color: transparent;
|
|
87
|
-
border: none;
|
|
88
|
-
color: currentColor;
|
|
89
|
-
font-size: inherit;
|
|
90
|
-
font-family: inherit;
|
|
91
|
-
line-height: inherit;
|
|
92
|
-
text-align: left;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.wp-block-navigation-submenu__toggle {
|
|
96
|
-
cursor: pointer;
|
|
97
|
-
}
|