@wordpress/block-library 6.0.6 → 6.0.10
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 +118 -12
- 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-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 +118 -12
- 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-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 +40 -3
- package/build-style/navigation/style.css +40 -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 +66 -27
- package/build-style/style.css +66 -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 +105 -4
- 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 +173 -19
- package/src/navigation/save.js +2 -2
- package/src/navigation/style.scss +56 -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-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
|
@@ -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
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
Flex,
|
|
7
|
-
FlexItem,
|
|
8
|
-
Modal,
|
|
9
|
-
TextControl,
|
|
10
|
-
} from '@wordpress/components';
|
|
11
|
-
import { useState } from '@wordpress/element';
|
|
12
|
-
import { __ } from '@wordpress/i18n';
|
|
13
|
-
|
|
14
|
-
export default function NavigationMenuNameModal( {
|
|
15
|
-
title,
|
|
16
|
-
finishButtonText = __( 'Create' ),
|
|
17
|
-
onFinish,
|
|
18
|
-
onRequestClose,
|
|
19
|
-
value = '',
|
|
20
|
-
} ) {
|
|
21
|
-
const [ name, setName ] = useState( value );
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Modal
|
|
25
|
-
title={ title }
|
|
26
|
-
closeLabel={ __( 'Cancel' ) }
|
|
27
|
-
onRequestClose={ onRequestClose }
|
|
28
|
-
overlayClassName="wp-block-template-part__placeholder-create-new__title-form"
|
|
29
|
-
>
|
|
30
|
-
<form
|
|
31
|
-
onSubmit={ ( event ) => {
|
|
32
|
-
event.preventDefault();
|
|
33
|
-
onFinish( name );
|
|
34
|
-
} }
|
|
35
|
-
>
|
|
36
|
-
<TextControl
|
|
37
|
-
label={ __( 'Name' ) }
|
|
38
|
-
value={ name }
|
|
39
|
-
onChange={ setName }
|
|
40
|
-
/>
|
|
41
|
-
<Flex
|
|
42
|
-
className="wp-block-template-part__placeholder-create-new__title-form-actions"
|
|
43
|
-
justify="flex-end"
|
|
44
|
-
>
|
|
45
|
-
<FlexItem>
|
|
46
|
-
<Button
|
|
47
|
-
variant="secondary"
|
|
48
|
-
onClick={ () => {
|
|
49
|
-
onRequestClose();
|
|
50
|
-
} }
|
|
51
|
-
>
|
|
52
|
-
{ __( 'Cancel' ) }
|
|
53
|
-
</Button>
|
|
54
|
-
</FlexItem>
|
|
55
|
-
<FlexItem>
|
|
56
|
-
<Button
|
|
57
|
-
variant="primary"
|
|
58
|
-
type="submit"
|
|
59
|
-
disabled={ ! name.length }
|
|
60
|
-
aria-disabled={ ! name.length }
|
|
61
|
-
>
|
|
62
|
-
{ finishButtonText }
|
|
63
|
-
</Button>
|
|
64
|
-
</FlexItem>
|
|
65
|
-
</Flex>
|
|
66
|
-
</form>
|
|
67
|
-
</Modal>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { ToolbarButton } from '@wordpress/components';
|
|
5
|
-
import {
|
|
6
|
-
useEntityId,
|
|
7
|
-
useEntityProp,
|
|
8
|
-
store as coreStore,
|
|
9
|
-
} from '@wordpress/core-data';
|
|
10
|
-
import { useDispatch } from '@wordpress/data';
|
|
11
|
-
import { useState } from '@wordpress/element';
|
|
12
|
-
import { __ } from '@wordpress/i18n';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import NavigationMenuNameModal from './navigation-menu-name-modal';
|
|
18
|
-
|
|
19
|
-
export default function NavigationMenuPublishButton() {
|
|
20
|
-
const [ isNameModalVisible, setIsNameModalVisible ] = useState( false );
|
|
21
|
-
const id = useEntityId( 'postType', 'wp_navigation' );
|
|
22
|
-
const [ navigationMenuTitle ] = useEntityProp(
|
|
23
|
-
'postType',
|
|
24
|
-
'wp_navigation',
|
|
25
|
-
'title'
|
|
26
|
-
);
|
|
27
|
-
const { editEntityRecord, saveEditedEntityRecord } = useDispatch(
|
|
28
|
-
coreStore
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<>
|
|
33
|
-
<ToolbarButton onClick={ () => setIsNameModalVisible( true ) }>
|
|
34
|
-
{ __( 'Save as' ) }
|
|
35
|
-
</ToolbarButton>
|
|
36
|
-
{ isNameModalVisible && (
|
|
37
|
-
<NavigationMenuNameModal
|
|
38
|
-
title={ __( 'Save your new navigation menu' ) }
|
|
39
|
-
value={ navigationMenuTitle }
|
|
40
|
-
onRequestClose={ () => setIsNameModalVisible( false ) }
|
|
41
|
-
finishButtonText={ __( 'Save' ) }
|
|
42
|
-
onFinish={ ( updatedTitle ) => {
|
|
43
|
-
editEntityRecord( 'postType', 'wp_navigation', id, {
|
|
44
|
-
title: updatedTitle,
|
|
45
|
-
status: 'publish',
|
|
46
|
-
} );
|
|
47
|
-
saveEditedEntityRecord(
|
|
48
|
-
'postType',
|
|
49
|
-
'wp_navigation',
|
|
50
|
-
id
|
|
51
|
-
);
|
|
52
|
-
} }
|
|
53
|
-
/>
|
|
54
|
-
) }
|
|
55
|
-
</>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
.wp-block-navigation-submenu {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: flex;
|
|
4
|
-
|
|
5
|
-
.wp-block-navigation__submenu-icon svg {
|
|
6
|
-
stroke: currentColor;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
button.wp-block-navigation-item__content {
|
|
11
|
-
background-color: transparent;
|
|
12
|
-
border: none;
|
|
13
|
-
color: currentColor;
|
|
14
|
-
font-size: inherit;
|
|
15
|
-
font-family: inherit;
|
|
16
|
-
line-height: inherit;
|
|
17
|
-
|
|
18
|
-
// Buttons default to center alignment. This becomes visible
|
|
19
|
-
// when a menu item label is long enough to wrap.
|
|
20
|
-
text-align: left;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.wp-block-navigation-submenu__toggle {
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
}
|