@wordpress/block-library 9.37.2-next.ba3aee3a2.0 → 9.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/build/audio/index.cjs +16 -8
- package/build/audio/index.cjs.map +2 -2
- package/build/block-keyboard-shortcuts/index.cjs +2 -4
- package/build/block-keyboard-shortcuts/index.cjs.map +2 -2
- package/build/button/index.cjs +17 -8
- package/build/button/index.cjs.map +2 -2
- package/build/code/index.cjs +3 -1
- package/build/code/index.cjs.map +2 -2
- package/build/comments-title/edit.cjs +10 -6
- package/build/comments-title/edit.cjs.map +2 -2
- package/build/cover/index.cjs +20 -10
- package/build/cover/index.cjs.map +2 -2
- package/build/details/index.cjs +3 -1
- package/build/details/index.cjs.map +2 -2
- package/build/file/index.cjs +19 -9
- package/build/file/index.cjs.map +2 -2
- package/build/heading/block.json +1 -3
- package/build/heading/deprecated.cjs +101 -5
- package/build/heading/deprecated.cjs.map +3 -3
- package/build/heading/edit.cjs +20 -41
- package/build/heading/edit.cjs.map +3 -3
- package/build/heading/index.cjs +3 -1
- package/build/heading/index.cjs.map +2 -2
- package/build/heading/save.cjs +2 -16
- package/build/heading/save.cjs.map +3 -3
- package/build/heading/transforms.cjs +16 -3
- package/build/heading/transforms.cjs.map +2 -2
- package/build/image/image.cjs +3 -3
- package/build/image/image.cjs.map +2 -2
- package/build/image/index.cjs +33 -17
- package/build/image/index.cjs.map +2 -2
- package/build/list-item/index.cjs +3 -1
- package/build/list-item/index.cjs.map +2 -2
- package/build/media-text/index.cjs +30 -15
- package/build/media-text/index.cjs.map +2 -2
- package/build/more/block.json +1 -0
- package/build/more/index.cjs +3 -1
- package/build/more/index.cjs.map +2 -2
- package/build/navigation/edit/index.cjs +7 -6
- package/build/navigation/edit/index.cjs.map +2 -2
- package/build/navigation/edit/responsive-wrapper.cjs +7 -4
- package/build/navigation/edit/responsive-wrapper.cjs.map +2 -2
- package/build/navigation/edit/use-create-overlay.cjs +2 -0
- package/build/navigation/edit/use-create-overlay.cjs.map +2 -2
- package/build/navigation-link/edit.cjs +8 -58
- package/build/navigation-link/edit.cjs.map +3 -3
- package/build/navigation-link/index.cjs +13 -8
- package/build/navigation-link/index.cjs.map +2 -2
- package/build/navigation-link/shared/index.cjs +11 -2
- package/build/navigation-link/shared/index.cjs.map +2 -2
- package/build/navigation-link/shared/invalid-draft-display.cjs +82 -0
- package/build/navigation-link/shared/invalid-draft-display.cjs.map +7 -0
- package/build/navigation-link/shared/use-enable-link-status-validation.cjs +50 -0
- package/build/navigation-link/shared/use-enable-link-status-validation.cjs.map +7 -0
- package/build/navigation-link/shared/use-is-invalid-link.cjs +64 -0
- package/build/navigation-link/shared/use-is-invalid-link.cjs.map +7 -0
- package/build/navigation-overlay-close/block.json +1 -4
- package/build/navigation-overlay-close/index.cjs +3 -25
- package/build/navigation-overlay-close/index.cjs.map +3 -3
- package/build/navigation-submenu/edit.cjs +36 -18
- package/build/navigation-submenu/edit.cjs.map +2 -2
- package/build/navigation-submenu/index.cjs +15 -8
- package/build/navigation-submenu/index.cjs.map +2 -2
- package/build/nextpage/block.json +1 -0
- package/build/paragraph/index.cjs +3 -1
- package/build/paragraph/index.cjs.map +2 -2
- package/build/paragraph/transforms.cjs +14 -3
- package/build/paragraph/transforms.cjs.map +3 -3
- package/build/preformatted/index.cjs +3 -1
- package/build/preformatted/index.cjs.map +2 -2
- package/build/pullquote/index.cjs +7 -3
- package/build/pullquote/index.cjs.map +2 -2
- package/build/search/index.cjs +10 -5
- package/build/search/index.cjs.map +2 -2
- package/build/social-link/index.cjs +13 -7
- package/build/social-link/index.cjs.map +2 -2
- package/build/table-of-contents/hooks.cjs +1 -1
- package/build/table-of-contents/hooks.cjs.map +1 -1
- package/build/template-part/edit/utils/get-template-part-icon.cjs.map +1 -1
- package/build/utils/is-within-overlay.cjs +52 -0
- package/build/utils/is-within-overlay.cjs.map +7 -0
- package/build/verse/index.cjs +3 -1
- package/build/verse/index.cjs.map +2 -2
- package/build/video/index.cjs +20 -10
- package/build/video/index.cjs.map +2 -2
- package/build-module/audio/index.mjs +16 -8
- package/build-module/audio/index.mjs.map +2 -2
- package/build-module/block-keyboard-shortcuts/index.mjs +2 -4
- package/build-module/block-keyboard-shortcuts/index.mjs.map +2 -2
- package/build-module/button/index.mjs +17 -8
- package/build-module/button/index.mjs.map +2 -2
- package/build-module/code/index.mjs +3 -1
- package/build-module/code/index.mjs.map +2 -2
- package/build-module/comments-title/edit.mjs +10 -6
- package/build-module/comments-title/edit.mjs.map +2 -2
- package/build-module/cover/index.mjs +20 -10
- package/build-module/cover/index.mjs.map +2 -2
- package/build-module/details/index.mjs +3 -1
- package/build-module/details/index.mjs.map +2 -2
- package/build-module/file/index.mjs +19 -9
- package/build-module/file/index.mjs.map +2 -2
- package/build-module/heading/block.json +1 -3
- package/build-module/heading/deprecated.mjs +101 -5
- package/build-module/heading/deprecated.mjs.map +2 -2
- package/build-module/heading/edit.mjs +22 -46
- package/build-module/heading/edit.mjs.map +2 -2
- package/build-module/heading/index.mjs +3 -1
- package/build-module/heading/index.mjs.map +2 -2
- package/build-module/heading/save.mjs +2 -6
- package/build-module/heading/save.mjs.map +2 -2
- package/build-module/heading/transforms.mjs +16 -3
- package/build-module/heading/transforms.mjs.map +2 -2
- package/build-module/image/image.mjs +3 -3
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/image/index.mjs +33 -17
- package/build-module/image/index.mjs.map +2 -2
- package/build-module/list-item/index.mjs +3 -1
- package/build-module/list-item/index.mjs.map +2 -2
- package/build-module/media-text/index.mjs +30 -15
- package/build-module/media-text/index.mjs.map +2 -2
- package/build-module/more/block.json +1 -0
- package/build-module/more/index.mjs +3 -1
- package/build-module/more/index.mjs.map +2 -2
- package/build-module/navigation/edit/index.mjs +7 -6
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/responsive-wrapper.mjs +7 -4
- package/build-module/navigation/edit/responsive-wrapper.mjs.map +2 -2
- package/build-module/navigation/edit/use-create-overlay.mjs +2 -0
- package/build-module/navigation/edit/use-create-overlay.mjs.map +2 -2
- package/build-module/navigation-link/edit.mjs +12 -60
- package/build-module/navigation-link/edit.mjs.map +2 -2
- package/build-module/navigation-link/index.mjs +13 -8
- package/build-module/navigation-link/index.mjs.map +2 -2
- package/build-module/navigation-link/shared/index.mjs +7 -1
- package/build-module/navigation-link/shared/index.mjs.map +2 -2
- package/build-module/navigation-link/shared/invalid-draft-display.mjs +47 -0
- package/build-module/navigation-link/shared/invalid-draft-display.mjs.map +7 -0
- package/build-module/navigation-link/shared/use-enable-link-status-validation.mjs +25 -0
- package/build-module/navigation-link/shared/use-enable-link-status-validation.mjs.map +7 -0
- package/build-module/navigation-link/shared/use-is-invalid-link.mjs +39 -0
- package/build-module/navigation-link/shared/use-is-invalid-link.mjs.map +7 -0
- package/build-module/navigation-overlay-close/block.json +1 -4
- package/build-module/navigation-overlay-close/index.mjs +3 -25
- package/build-module/navigation-overlay-close/index.mjs.map +2 -2
- package/build-module/navigation-submenu/edit.mjs +40 -19
- package/build-module/navigation-submenu/edit.mjs.map +2 -2
- package/build-module/navigation-submenu/index.mjs +15 -8
- package/build-module/navigation-submenu/index.mjs.map +2 -2
- package/build-module/nextpage/block.json +1 -0
- package/build-module/paragraph/index.mjs +3 -1
- package/build-module/paragraph/index.mjs.map +2 -2
- package/build-module/paragraph/transforms.mjs +2 -1
- package/build-module/paragraph/transforms.mjs.map +2 -2
- package/build-module/preformatted/index.mjs +3 -1
- package/build-module/preformatted/index.mjs.map +2 -2
- package/build-module/pullquote/index.mjs +7 -3
- package/build-module/pullquote/index.mjs.map +2 -2
- package/build-module/search/index.mjs +10 -5
- package/build-module/search/index.mjs.map +2 -2
- package/build-module/social-link/index.mjs +13 -7
- package/build-module/social-link/index.mjs.map +2 -2
- package/build-module/table-of-contents/hooks.mjs +1 -1
- package/build-module/table-of-contents/hooks.mjs.map +1 -1
- package/build-module/template-part/edit/utils/get-template-part-icon.mjs.map +1 -1
- package/build-module/utils/is-within-overlay.mjs +27 -0
- package/build-module/utils/is-within-overlay.mjs.map +7 -0
- package/build-module/verse/index.mjs +3 -1
- package/build-module/verse/index.mjs.map +2 -2
- package/build-module/video/index.mjs +20 -10
- package/build-module/video/index.mjs.map +2 -2
- package/build-style/navigation/style-rtl.css +1 -16
- package/build-style/navigation/style.css +1 -16
- package/build-style/style-rtl.css +1 -16
- package/build-style/style.css +1 -16
- package/package.json +37 -38
- package/src/audio/index.js +13 -7
- package/src/block-keyboard-shortcuts/index.js +4 -7
- package/src/breadcrumbs/index.php +6 -3
- package/src/button/index.js +15 -8
- package/src/code/index.js +2 -1
- package/src/comments-title/edit.js +10 -7
- package/src/comments-title/index.php +7 -8
- package/src/cover/index.js +17 -8
- package/src/details/index.js +2 -1
- package/src/file/index.js +15 -8
- package/src/heading/block.json +1 -3
- package/src/heading/deprecated.js +118 -5
- package/src/heading/edit.js +6 -32
- package/src/heading/edit.native.js +17 -2
- package/src/heading/index.js +2 -1
- package/src/heading/save.js +2 -11
- package/src/heading/transforms.js +16 -3
- package/src/image/image.js +38 -40
- package/src/image/index.js +29 -16
- package/src/list-item/index.js +2 -1
- package/src/media-text/index.js +27 -14
- package/src/more/block.json +1 -0
- package/src/more/index.js +2 -1
- package/src/navigation/edit/index.js +9 -4
- package/src/navigation/edit/responsive-wrapper.js +15 -8
- package/src/navigation/edit/test/use-create-overlay.js +12 -0
- package/src/navigation/edit/use-create-overlay.js +2 -0
- package/src/navigation/index.php +74 -24
- package/src/navigation/style.scss +2 -18
- package/src/navigation-link/edit.js +11 -97
- package/src/navigation-link/index.js +13 -8
- package/src/navigation-link/index.php +17 -29
- package/src/navigation-link/shared/helpers.php +46 -0
- package/src/navigation-link/shared/index.js +3 -0
- package/src/navigation-link/shared/invalid-draft-display.js +63 -0
- package/src/navigation-link/shared/test/use-enable-link-status-validation.test.js +127 -0
- package/src/navigation-link/shared/use-enable-link-status-validation.js +40 -0
- package/src/navigation-link/shared/use-is-invalid-link.js +72 -0
- package/src/navigation-overlay-close/block.json +1 -4
- package/src/navigation-overlay-close/index.js +2 -37
- package/src/navigation-overlay-close/index.php +37 -1
- package/src/navigation-submenu/edit.js +49 -24
- package/src/navigation-submenu/index.js +13 -8
- package/src/navigation-submenu/index.php +25 -18
- package/src/nextpage/block.json +1 -0
- package/src/paragraph/index.js +2 -1
- package/src/paragraph/transforms.js +3 -1
- package/src/preformatted/index.js +2 -1
- package/src/pullquote/index.js +5 -3
- package/src/query-title/index.php +2 -2
- package/src/search/index.js +7 -5
- package/src/social-link/index.js +12 -7
- package/src/table-of-contents/hooks.js +1 -1
- package/src/template-part/edit/utils/get-template-part-icon.js +1 -1
- package/src/utils/is-within-overlay.js +54 -0
- package/src/verse/index.js +2 -1
- package/src/video/index.js +17 -9
- package/build/navigation-overlay-close/save.cjs +0 -67
- package/build/navigation-overlay-close/save.cjs.map +0 -7
- package/build-module/navigation-overlay-close/save.mjs +0 -46
- package/build-module/navigation-overlay-close/save.mjs.map +0 -7
- package/src/navigation-overlay-close/save.js +0 -44
package/src/pullquote/index.js
CHANGED
|
@@ -45,16 +45,18 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
|
|
|
45
45
|
{
|
|
46
46
|
id: 'value',
|
|
47
47
|
label: __( 'Content' ),
|
|
48
|
-
type: '
|
|
48
|
+
type: 'text',
|
|
49
|
+
Edit: 'rich-text', // TODO: replace with custom component
|
|
49
50
|
},
|
|
50
51
|
{
|
|
51
52
|
id: 'citation',
|
|
52
53
|
label: __( 'Citation' ),
|
|
53
|
-
type: '
|
|
54
|
+
type: 'text',
|
|
55
|
+
Edit: 'rich-text', // TODO: replace with custom component
|
|
54
56
|
},
|
|
55
57
|
];
|
|
56
58
|
settings[ formKey ] = {
|
|
57
|
-
fields: [ 'value' ],
|
|
59
|
+
fields: [ 'value', 'citation' ],
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -48,7 +48,7 @@ function render_block_core_query_title( $attributes, $content, $block ) {
|
|
|
48
48
|
if ( isset( $attributes['showSearchTerm'] ) && $attributes['showSearchTerm'] ) {
|
|
49
49
|
$title = sprintf(
|
|
50
50
|
/* translators: %s is the search term. */
|
|
51
|
-
__( 'Search results for:
|
|
51
|
+
__( 'Search results for: “%s”' ),
|
|
52
52
|
get_search_query()
|
|
53
53
|
);
|
|
54
54
|
}
|
|
@@ -66,7 +66,7 @@ function render_block_core_query_title( $attributes, $content, $block ) {
|
|
|
66
66
|
if ( $show_prefix ) {
|
|
67
67
|
$title = sprintf(
|
|
68
68
|
/* translators: %s is the post type name. */
|
|
69
|
-
__( 'Post Type:
|
|
69
|
+
__( 'Post Type: “%s”' ),
|
|
70
70
|
$post_type_name
|
|
71
71
|
);
|
|
72
72
|
} else {
|
package/src/search/index.js
CHANGED
|
@@ -35,22 +35,24 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
|
|
|
35
35
|
{
|
|
36
36
|
id: 'label',
|
|
37
37
|
label: __( 'Label' ),
|
|
38
|
-
type: '
|
|
39
|
-
|
|
38
|
+
type: 'text',
|
|
39
|
+
Edit: 'rich-text', // TODO: replace with custom component
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
id: 'buttonText',
|
|
43
43
|
label: __( 'Button text' ),
|
|
44
|
-
type: '
|
|
44
|
+
type: 'text',
|
|
45
|
+
Edit: 'rich-text', // TODO: replace with custom component
|
|
45
46
|
},
|
|
46
47
|
{
|
|
47
48
|
id: 'placeholder',
|
|
48
49
|
label: __( 'Placeholder' ),
|
|
49
|
-
type: '
|
|
50
|
+
type: 'text',
|
|
51
|
+
Edit: 'rich-text', // TODO: replace with custom component
|
|
50
52
|
},
|
|
51
53
|
];
|
|
52
54
|
settings[ formKey ] = {
|
|
53
|
-
fields: [ 'label' ],
|
|
55
|
+
fields: [ 'label', 'buttonText', 'placeholder' ],
|
|
54
56
|
};
|
|
55
57
|
}
|
|
56
58
|
|
package/src/social-link/index.js
CHANGED
|
@@ -31,20 +31,25 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
|
|
|
31
31
|
{
|
|
32
32
|
id: 'link',
|
|
33
33
|
label: __( 'Link' ),
|
|
34
|
-
type: '
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
type: 'url',
|
|
35
|
+
Edit: 'link', // TODO: replace with custom component
|
|
36
|
+
getValue: ( { item } ) => ( {
|
|
37
|
+
url: item.url,
|
|
38
|
+
rel: item.rel,
|
|
39
|
+
} ),
|
|
40
|
+
setValue: ( { value } ) => ( {
|
|
41
|
+
url: value.url,
|
|
42
|
+
rel: value.rel,
|
|
43
|
+
} ),
|
|
39
44
|
},
|
|
40
45
|
{
|
|
41
46
|
id: 'label',
|
|
42
47
|
label: __( 'Label' ),
|
|
43
|
-
type: '
|
|
48
|
+
type: 'text',
|
|
44
49
|
},
|
|
45
50
|
];
|
|
46
51
|
settings[ formKey ] = {
|
|
47
|
-
fields: [ 'link' ],
|
|
52
|
+
fields: [ 'link', 'label' ],
|
|
48
53
|
};
|
|
49
54
|
}
|
|
50
55
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
/**
|
|
13
13
|
* Helper function to retrieve the corresponding icon by area name or icon name.
|
|
14
14
|
*
|
|
15
|
-
* @param {string} areaOrIconName The area name (e.g., 'header', 'overlay') or icon name (e.g., 'menu').
|
|
15
|
+
* @param {string} areaOrIconName The area name (e.g., 'header', 'navigation-overlay') or icon name (e.g., 'menu').
|
|
16
16
|
*
|
|
17
17
|
* @return {Object} The corresponding icon.
|
|
18
18
|
*/
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { select } from '@wordpress/data';
|
|
5
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { NAVIGATION_OVERLAY_TEMPLATE_PART_AREA } from '../navigation/constants';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Checks if the current editing context is within a navigation overlay template part.
|
|
14
|
+
*
|
|
15
|
+
* This utility exists because @wordpress/block-library cannot depend on @wordpress/editor
|
|
16
|
+
* as a package dependency. Blocks can be loaded into non-post block editors, so we must
|
|
17
|
+
* access the 'core/editor' store by string literal rather than importing it.
|
|
18
|
+
*
|
|
19
|
+
* React components should wrap this in useSelect for reactivity. Non-React contexts
|
|
20
|
+
* (like filter callbacks) can call this directly.
|
|
21
|
+
*
|
|
22
|
+
* @return {boolean} True if editing a navigation overlay template part, false otherwise.
|
|
23
|
+
*/
|
|
24
|
+
export function isWithinNavigationOverlay() {
|
|
25
|
+
// @wordpress/block-library should not depend on @wordpress/editor.
|
|
26
|
+
// Blocks can be loaded into a *non-post* block editor, so to avoid
|
|
27
|
+
// declaring @wordpress/editor as a dependency, we must access its
|
|
28
|
+
// store by string.
|
|
29
|
+
// eslint-disable-next-line @wordpress/data-no-store-string-literals
|
|
30
|
+
const editorStore = select( 'core/editor' );
|
|
31
|
+
|
|
32
|
+
// Return false if the editor store is not available.
|
|
33
|
+
if ( ! editorStore ) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const { getCurrentPostType, getCurrentPostId } = editorStore;
|
|
38
|
+
const { getEditedEntityRecord } = select( coreStore );
|
|
39
|
+
|
|
40
|
+
const postType = getCurrentPostType?.();
|
|
41
|
+
const postId = getCurrentPostId?.();
|
|
42
|
+
|
|
43
|
+
if ( postType === 'wp_template_part' && postId ) {
|
|
44
|
+
const templatePart = getEditedEntityRecord(
|
|
45
|
+
'postType',
|
|
46
|
+
'wp_template_part',
|
|
47
|
+
postId
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return templatePart?.area === NAVIGATION_OVERLAY_TEMPLATE_PART_AREA;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return false;
|
|
54
|
+
}
|
package/src/verse/index.js
CHANGED
package/src/video/index.js
CHANGED
|
@@ -43,25 +43,33 @@ if ( window.__experimentalContentOnlyInspectorFields ) {
|
|
|
43
43
|
id: 'video',
|
|
44
44
|
label: __( 'Video' ),
|
|
45
45
|
type: 'media',
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
url: 'src',
|
|
49
|
-
caption: 'caption',
|
|
50
|
-
poster: 'poster',
|
|
51
|
-
},
|
|
52
|
-
args: {
|
|
46
|
+
Edit: {
|
|
47
|
+
control: 'media', // TODO: replace with custom component
|
|
53
48
|
allowedTypes: [ 'video' ],
|
|
54
49
|
multiple: false,
|
|
55
50
|
},
|
|
51
|
+
getValue: ( { item } ) => ( {
|
|
52
|
+
id: item.id,
|
|
53
|
+
url: item.src,
|
|
54
|
+
caption: item.caption,
|
|
55
|
+
poster: item.poster,
|
|
56
|
+
} ),
|
|
57
|
+
setValue: ( { value } ) => ( {
|
|
58
|
+
id: value.id,
|
|
59
|
+
src: value.url,
|
|
60
|
+
caption: value.caption,
|
|
61
|
+
poster: value.poster,
|
|
62
|
+
} ),
|
|
56
63
|
},
|
|
57
64
|
{
|
|
58
65
|
id: 'caption',
|
|
59
66
|
label: __( 'Caption' ),
|
|
60
|
-
type: '
|
|
67
|
+
type: 'text',
|
|
68
|
+
Edit: 'rich-text', // TODO: replace with custom component
|
|
61
69
|
},
|
|
62
70
|
];
|
|
63
71
|
settings[ formKey ] = {
|
|
64
|
-
fields: [ 'video' ],
|
|
72
|
+
fields: [ 'video', 'caption' ],
|
|
65
73
|
};
|
|
66
74
|
}
|
|
67
75
|
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/block-library/src/navigation-overlay-close/save.js
|
|
21
|
-
var save_exports = {};
|
|
22
|
-
__export(save_exports, {
|
|
23
|
-
default: () => NavigationOverlayCloseSave
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(save_exports);
|
|
26
|
-
var import_block_editor = require("@wordpress/block-editor");
|
|
27
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
28
|
-
var saveBlockProps = import_block_editor.useBlockProps.save;
|
|
29
|
-
function NavigationOverlayCloseSave({ attributes }) {
|
|
30
|
-
const { displayMode, text } = attributes;
|
|
31
|
-
const showIcon = displayMode === "icon" || displayMode === "both";
|
|
32
|
-
const showText = displayMode === "text" || displayMode === "both";
|
|
33
|
-
const blockProps = saveBlockProps({
|
|
34
|
-
className: "wp-block-navigation-overlay-close"
|
|
35
|
-
});
|
|
36
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
37
|
-
"button",
|
|
38
|
-
{
|
|
39
|
-
...blockProps,
|
|
40
|
-
type: "button",
|
|
41
|
-
"aria-label": !showText ? "Close" : void 0,
|
|
42
|
-
children: [
|
|
43
|
-
showIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
44
|
-
"svg",
|
|
45
|
-
{
|
|
46
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
-
viewBox: "0 0 24 24",
|
|
48
|
-
width: "24",
|
|
49
|
-
height: "24",
|
|
50
|
-
"aria-hidden": "true",
|
|
51
|
-
focusable: "false",
|
|
52
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z" })
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
showText && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
56
|
-
import_block_editor.RichText.Content,
|
|
57
|
-
{
|
|
58
|
-
tagName: "span",
|
|
59
|
-
value: text,
|
|
60
|
-
className: "wp-block-navigation-overlay-close__text"
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=save.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/navigation-overlay-close/save.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps, RichText } from '@wordpress/block-editor';\n\nconst saveBlockProps = useBlockProps.save;\n\nexport default function NavigationOverlayCloseSave( { attributes } ) {\n\tconst { displayMode, text } = attributes;\n\tconst showIcon = displayMode === 'icon' || displayMode === 'both';\n\tconst showText = displayMode === 'text' || displayMode === 'both';\n\n\tconst blockProps = saveBlockProps( {\n\t\tclassName: 'wp-block-navigation-overlay-close',\n\t} );\n\n\treturn (\n\t\t<button\n\t\t\t{ ...blockProps }\n\t\t\ttype=\"button\"\n\t\t\taria-label={ ! showText ? 'Close' : undefined }\n\t\t>\n\t\t\t{ showIcon && (\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\twidth=\"24\"\n\t\t\t\t\theight=\"24\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t>\n\t\t\t\t\t<path d=\"M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z\" />\n\t\t\t\t</svg>\n\t\t\t) }\n\t\t\t{ showText && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tclassName=\"wp-block-navigation-overlay-close__text\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t</button>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAAwC;AActC;AAZF,IAAM,iBAAiB,kCAAc;AAEtB,SAAR,2BAA6C,EAAE,WAAW,GAAI;AACpE,QAAM,EAAE,aAAa,KAAK,IAAI;AAC9B,QAAM,WAAW,gBAAgB,UAAU,gBAAgB;AAC3D,QAAM,WAAW,gBAAgB,UAAU,gBAAgB;AAE3D,QAAM,aAAa,eAAgB;AAAA,IAClC,WAAW;AAAA,EACZ,CAAE;AAEF,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,MAAK;AAAA,MACL,cAAa,CAAE,WAAW,UAAU;AAAA,MAElC;AAAA,oBACD;AAAA,UAAC;AAAA;AAAA,YACA,OAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,QAAO;AAAA,YACP,eAAY;AAAA,YACZ,WAAU;AAAA,YAEV,sDAAC,UAAK,GAAE,6FAA4F;AAAA;AAAA,QACrG;AAAA,QAEC,YACD;AAAA,UAAC,6BAAS;AAAA,UAAT;AAAA,YACA,SAAQ;AAAA,YACR,OAAQ;AAAA,YACR,WAAU;AAAA;AAAA,QACX;AAAA;AAAA;AAAA,EAEF;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// packages/block-library/src/navigation-overlay-close/save.js
|
|
2
|
-
import { useBlockProps, RichText } from "@wordpress/block-editor";
|
|
3
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
var saveBlockProps = useBlockProps.save;
|
|
5
|
-
function NavigationOverlayCloseSave({ attributes }) {
|
|
6
|
-
const { displayMode, text } = attributes;
|
|
7
|
-
const showIcon = displayMode === "icon" || displayMode === "both";
|
|
8
|
-
const showText = displayMode === "text" || displayMode === "both";
|
|
9
|
-
const blockProps = saveBlockProps({
|
|
10
|
-
className: "wp-block-navigation-overlay-close"
|
|
11
|
-
});
|
|
12
|
-
return /* @__PURE__ */ jsxs(
|
|
13
|
-
"button",
|
|
14
|
-
{
|
|
15
|
-
...blockProps,
|
|
16
|
-
type: "button",
|
|
17
|
-
"aria-label": !showText ? "Close" : void 0,
|
|
18
|
-
children: [
|
|
19
|
-
showIcon && /* @__PURE__ */ jsx(
|
|
20
|
-
"svg",
|
|
21
|
-
{
|
|
22
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
23
|
-
viewBox: "0 0 24 24",
|
|
24
|
-
width: "24",
|
|
25
|
-
height: "24",
|
|
26
|
-
"aria-hidden": "true",
|
|
27
|
-
focusable: "false",
|
|
28
|
-
children: /* @__PURE__ */ jsx("path", { d: "M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z" })
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
showText && /* @__PURE__ */ jsx(
|
|
32
|
-
RichText.Content,
|
|
33
|
-
{
|
|
34
|
-
tagName: "span",
|
|
35
|
-
value: text,
|
|
36
|
-
className: "wp-block-navigation-overlay-close__text"
|
|
37
|
-
}
|
|
38
|
-
)
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
export {
|
|
44
|
-
NavigationOverlayCloseSave as default
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=save.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/navigation-overlay-close/save.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useBlockProps, RichText } from '@wordpress/block-editor';\n\nconst saveBlockProps = useBlockProps.save;\n\nexport default function NavigationOverlayCloseSave( { attributes } ) {\n\tconst { displayMode, text } = attributes;\n\tconst showIcon = displayMode === 'icon' || displayMode === 'both';\n\tconst showText = displayMode === 'text' || displayMode === 'both';\n\n\tconst blockProps = saveBlockProps( {\n\t\tclassName: 'wp-block-navigation-overlay-close',\n\t} );\n\n\treturn (\n\t\t<button\n\t\t\t{ ...blockProps }\n\t\t\ttype=\"button\"\n\t\t\taria-label={ ! showText ? 'Close' : undefined }\n\t\t>\n\t\t\t{ showIcon && (\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\twidth=\"24\"\n\t\t\t\t\theight=\"24\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tfocusable=\"false\"\n\t\t\t\t>\n\t\t\t\t\t<path d=\"M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z\" />\n\t\t\t\t</svg>\n\t\t\t) }\n\t\t\t{ showText && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\tvalue={ text }\n\t\t\t\t\tclassName=\"wp-block-navigation-overlay-close__text\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t</button>\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,eAAe,gBAAgB;AActC,SAcG,KAdH;AAZF,IAAM,iBAAiB,cAAc;AAEtB,SAAR,2BAA6C,EAAE,WAAW,GAAI;AACpE,QAAM,EAAE,aAAa,KAAK,IAAI;AAC9B,QAAM,WAAW,gBAAgB,UAAU,gBAAgB;AAC3D,QAAM,WAAW,gBAAgB,UAAU,gBAAgB;AAE3D,QAAM,aAAa,eAAgB;AAAA,IAClC,WAAW;AAAA,EACZ,CAAE;AAEF,SACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL,MAAK;AAAA,MACL,cAAa,CAAE,WAAW,UAAU;AAAA,MAElC;AAAA,oBACD;AAAA,UAAC;AAAA;AAAA,YACA,OAAM;AAAA,YACN,SAAQ;AAAA,YACR,OAAM;AAAA,YACN,QAAO;AAAA,YACP,eAAY;AAAA,YACZ,WAAU;AAAA,YAEV,8BAAC,UAAK,GAAE,6FAA4F;AAAA;AAAA,QACrG;AAAA,QAEC,YACD;AAAA,UAAC,SAAS;AAAA,UAAT;AAAA,YACA,SAAQ;AAAA,YACR,OAAQ;AAAA,YACR,WAAU;AAAA;AAAA,QACX;AAAA;AAAA;AAAA,EAEF;AAEF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useBlockProps, RichText } from '@wordpress/block-editor';
|
|
5
|
-
|
|
6
|
-
const saveBlockProps = useBlockProps.save;
|
|
7
|
-
|
|
8
|
-
export default function NavigationOverlayCloseSave( { attributes } ) {
|
|
9
|
-
const { displayMode, text } = attributes;
|
|
10
|
-
const showIcon = displayMode === 'icon' || displayMode === 'both';
|
|
11
|
-
const showText = displayMode === 'text' || displayMode === 'both';
|
|
12
|
-
|
|
13
|
-
const blockProps = saveBlockProps( {
|
|
14
|
-
className: 'wp-block-navigation-overlay-close',
|
|
15
|
-
} );
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<button
|
|
19
|
-
{ ...blockProps }
|
|
20
|
-
type="button"
|
|
21
|
-
aria-label={ ! showText ? 'Close' : undefined }
|
|
22
|
-
>
|
|
23
|
-
{ showIcon && (
|
|
24
|
-
<svg
|
|
25
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
-
viewBox="0 0 24 24"
|
|
27
|
-
width="24"
|
|
28
|
-
height="24"
|
|
29
|
-
aria-hidden="true"
|
|
30
|
-
focusable="false"
|
|
31
|
-
>
|
|
32
|
-
<path d="M13 11.8l6.1-6.3-1.1-1-6.1 6.2-6.1-6.2-1.1 1 6.1 6.3-6.5 6.7 1.1 1 6.5-6.6 6.5 6.6 1.1-1z" />
|
|
33
|
-
</svg>
|
|
34
|
-
) }
|
|
35
|
-
{ showText && (
|
|
36
|
-
<RichText.Content
|
|
37
|
-
tagName="span"
|
|
38
|
-
value={ text }
|
|
39
|
-
className="wp-block-navigation-overlay-close__text"
|
|
40
|
-
/>
|
|
41
|
-
) }
|
|
42
|
-
</button>
|
|
43
|
-
);
|
|
44
|
-
}
|