@wordpress/block-library 9.12.0 → 9.12.1-next.082ed6819.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/block-keyboard-shortcuts/index.js +7 -7
- package/build/block-keyboard-shortcuts/index.js.map +1 -1
- package/build/cover/edit/index.js +1 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/index.js +10 -10
- package/build/cover/index.js.map +1 -1
- package/build/cover/shared.js +6 -7
- package/build/cover/shared.js.map +1 -1
- package/build/details/index.js +19 -0
- package/build/details/index.js.map +1 -1
- package/build/file/edit.js +7 -3
- package/build/file/edit.js.map +1 -1
- package/build/freeform/modal.js +1 -1
- package/build/freeform/modal.js.map +1 -1
- package/build/heading/index.js +1 -7
- package/build/heading/index.js.map +1 -1
- package/build/home-link/edit.js +20 -36
- package/build/home-link/edit.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +6 -8
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/page-list/index.js +14 -0
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +26 -25
- package/build/paragraph/edit.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -11
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/utils.js +6 -8
- package/build/query/utils.js.map +1 -1
- package/build/social-link/edit.js +22 -9
- package/build/social-link/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -7
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/utils/get-template-part-icon.js +23 -0
- package/build/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build/template-part/edit/utils/hooks.js +1 -6
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/variations.js +6 -12
- package/build/template-part/variations.js.map +1 -1
- package/build/video/tracks-editor.js +135 -121
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/block-keyboard-shortcuts/index.js +7 -7
- package/build-module/block-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/cover/edit/index.js +1 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/index.js +10 -10
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/shared.js +6 -7
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/details/index.js +20 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/edit.js +7 -3
- package/build-module/file/edit.js.map +1 -1
- package/build-module/freeform/modal.js +1 -1
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/heading/index.js +1 -7
- package/build-module/heading/index.js.map +1 -1
- package/build-module/home-link/edit.js +23 -39
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +6 -8
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/page-list/index.js +14 -0
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +26 -25
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -11
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/utils.js +6 -8
- package/build-module/query/utils.js.map +1 -1
- package/build-module/social-link/edit.js +24 -11
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +3 -8
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/utils/get-template-part-icon.js +15 -0
- package/build-module/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build-module/template-part/edit/utils/hooks.js +1 -6
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/variations.js +5 -11
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/video/tracks-editor.js +136 -122
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/editor-rtl.css +12 -8
- package/build-style/editor.css +12 -8
- package/build-style/navigation/style-rtl.css +1 -1
- package/build-style/navigation/style.css +1 -1
- package/build-style/page-list/style-rtl.css +4 -0
- package/build-style/page-list/style.css +4 -0
- package/build-style/query/editor-rtl.css +0 -4
- package/build-style/query/editor.css +0 -4
- package/build-style/search/style-rtl.css +3 -3
- package/build-style/search/style.css +3 -3
- package/build-style/social-link/editor-rtl.css +4 -4
- package/build-style/social-link/editor.css +4 -4
- package/build-style/style-rtl.css +8 -4
- package/build-style/style.css +8 -4
- package/build-style/video/editor-rtl.css +8 -0
- package/build-style/video/editor.css +8 -0
- package/package.json +33 -33
- package/src/block-keyboard-shortcuts/index.js +25 -11
- package/src/cover/edit/index.js +1 -1
- package/src/cover/index.js +8 -8
- package/src/cover/shared.js +10 -10
- package/src/cover/test/edit.js +2 -2
- package/src/details/index.js +23 -1
- package/src/file/edit.js +8 -2
- package/src/freeform/modal.js +1 -1
- package/src/heading/block.json +1 -7
- package/src/home-link/edit.js +27 -45
- package/src/home-link/index.php +0 -3
- package/src/navigation/index.php +4 -150
- package/src/navigation/style.scss +1 -1
- package/src/navigation/use-template-part-area-label.js +10 -10
- package/src/page-list/block.json +14 -0
- package/src/page-list/style.scss +4 -0
- package/src/paragraph/edit.js +20 -17
- package/src/pattern/index.php +0 -7
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -5
- package/src/query/edit/inspector-controls/index.js +0 -10
- package/src/query/editor.scss +0 -4
- package/src/query/index.php +1 -1
- package/src/query/utils.js +14 -15
- package/src/rss/index.php +11 -8
- package/src/search/style.scss +3 -5
- package/src/social-link/edit.js +47 -19
- package/src/social-link/editor.scss +6 -7
- package/src/template-part/edit/advanced-controls.js +13 -13
- package/src/template-part/edit/utils/get-template-part-icon.js +20 -0
- package/src/template-part/edit/utils/hooks.js +2 -7
- package/src/template-part/variations.js +4 -16
- package/src/video/editor.scss +9 -0
- package/src/video/tracks-editor.js +157 -139
- package/build/query/edit/inspector-controls/create-new-post-link.js +0 -40
- package/build/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/build-module/query/edit/inspector-controls/create-new-post-link.js +0 -33
- package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/src/query/edit/inspector-controls/create-new-post-link.js +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_components","_element","_i18n","_data","_icons","_compose","_jsxRuntime","ModalAuxiliaryActions","onClick","isModalFullScreen","isMobileViewport","useViewportMatch","jsx","Button","size","icon","fullscreen","isPressed","label","__","ClassicEdit","props","styles","useSelect","select","store","getSettings","useEffect","baseURL","suffix","settings","window","wpEditorL10n","tinymce","EditorManager","overrideDefaults","base_url","wp","oldEditor","initialize","id","setup","editor","on","doc","getDoc","forEach","css","styleEl","createElement","innerHTML","head","appendChild","remove","ModalEdit","clientId","attributes","content","setAttributes","onReplace","isOpen","setOpen","useState","setIsModalFullScreen","onClose","jsxs","Fragment","children","BlockControls","ToolbarGroup","ToolbarButton","RawHTML","Modal","title","onRequestClose","shouldCloseOnClickOutside","overlayClassName","isFullScreen","className","headerActions","defaultValue","Flex","justify","expanded","FlexItem","__next40pxDefaultSize","variant","getContent"],"sources":["@wordpress/block-library/src/freeform/modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockControls, store } from '@wordpress/block-editor';\nimport {\n\tToolbarGroup,\n\tToolbarButton,\n\tModal,\n\tButton,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { useEffect, useState, RawHTML } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { fullscreen } from '@wordpress/icons';\nimport { useViewportMatch } from '@wordpress/compose';\n\nfunction ModalAuxiliaryActions( { onClick, isModalFullScreen } ) {\n\t// 'small' to match the rules in editor.scss.\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tif ( isMobileViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_components","_element","_i18n","_data","_icons","_compose","_jsxRuntime","ModalAuxiliaryActions","onClick","isModalFullScreen","isMobileViewport","useViewportMatch","jsx","Button","size","icon","fullscreen","isPressed","label","__","ClassicEdit","props","styles","useSelect","select","store","getSettings","useEffect","baseURL","suffix","settings","window","wpEditorL10n","tinymce","EditorManager","overrideDefaults","base_url","wp","oldEditor","initialize","id","setup","editor","on","doc","getDoc","forEach","css","styleEl","createElement","innerHTML","head","appendChild","remove","ModalEdit","clientId","attributes","content","setAttributes","onReplace","isOpen","setOpen","useState","setIsModalFullScreen","onClose","jsxs","Fragment","children","BlockControls","ToolbarGroup","ToolbarButton","RawHTML","Modal","title","onRequestClose","shouldCloseOnClickOutside","overlayClassName","isFullScreen","className","headerActions","defaultValue","Flex","justify","expanded","FlexItem","__next40pxDefaultSize","variant","getContent"],"sources":["@wordpress/block-library/src/freeform/modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockControls, store } from '@wordpress/block-editor';\nimport {\n\tToolbarGroup,\n\tToolbarButton,\n\tModal,\n\tButton,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { useEffect, useState, RawHTML } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { fullscreen } from '@wordpress/icons';\nimport { useViewportMatch } from '@wordpress/compose';\n\nfunction ModalAuxiliaryActions( { onClick, isModalFullScreen } ) {\n\t// 'small' to match the rules in editor.scss.\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tif ( isMobileViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tonClick={ onClick }\n\t\t\ticon={ fullscreen }\n\t\t\tisPressed={ isModalFullScreen }\n\t\t\tlabel={\n\t\t\t\tisModalFullScreen\n\t\t\t\t\t? __( 'Exit fullscreen' )\n\t\t\t\t\t: __( 'Enter fullscreen' )\n\t\t\t}\n\t\t/>\n\t);\n}\n\nfunction ClassicEdit( props ) {\n\tconst styles = useSelect(\n\t\t( select ) => select( store ).getSettings().styles\n\t);\n\tuseEffect( () => {\n\t\tconst { baseURL, suffix, settings } = window.wpEditorL10n.tinymce;\n\n\t\twindow.tinymce.EditorManager.overrideDefaults( {\n\t\t\tbase_url: baseURL,\n\t\t\tsuffix,\n\t\t} );\n\n\t\twindow.wp.oldEditor.initialize( props.id, {\n\t\t\ttinymce: {\n\t\t\t\t...settings,\n\t\t\t\tsetup( editor ) {\n\t\t\t\t\teditor.on( 'init', () => {\n\t\t\t\t\t\tconst doc = editor.getDoc();\n\t\t\t\t\t\tstyles.forEach( ( { css } ) => {\n\t\t\t\t\t\t\tconst styleEl = doc.createElement( 'style' );\n\t\t\t\t\t\t\tstyleEl.innerHTML = css;\n\t\t\t\t\t\t\tdoc.head.appendChild( styleEl );\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\n\t\treturn () => {\n\t\t\twindow.wp.oldEditor.remove( props.id );\n\t\t};\n\t}, [] );\n\n\treturn <textarea { ...props } />;\n}\n\nexport default function ModalEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes: { content },\n\t\tsetAttributes,\n\t\tonReplace,\n\t} = props;\n\tconst [ isOpen, setOpen ] = useState( false );\n\tconst [ isModalFullScreen, setIsModalFullScreen ] = useState( false );\n\tconst id = `editor-${ clientId }`;\n\n\tconst onClose = () => ( content ? setOpen( false ) : onReplace( [] ) );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton onClick={ () => setOpen( true ) }>\n\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t</ToolbarButton>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ content && <RawHTML>{ content }</RawHTML> }\n\t\t\t{ ( isOpen || ! content ) && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Classic Editor' ) }\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\tshouldCloseOnClickOutside={ false }\n\t\t\t\t\toverlayClassName=\"block-editor-freeform-modal\"\n\t\t\t\t\tisFullScreen={ isModalFullScreen }\n\t\t\t\t\tclassName=\"block-editor-freeform-modal__content\"\n\t\t\t\t\theaderActions={\n\t\t\t\t\t\t<ModalAuxiliaryActions\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tsetIsModalFullScreen( ! isModalFullScreen )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisModalFullScreen={ isModalFullScreen }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<ClassicEdit id={ id } defaultValue={ content } />\n\t\t\t\t\t<Flex\n\t\t\t\t\t\tclassName=\"block-editor-freeform-modal__actions\"\n\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tcontent:\n\t\t\t\t\t\t\t\t\t\t\twindow.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@@ const metadata = exports.metadata = {
|
|
|
57
57
|
color: true,
|
|
58
58
|
radius: true,
|
|
59
59
|
style: true,
|
|
60
|
-
width: true
|
|
61
|
-
__experimentalDefaultControls: {
|
|
62
|
-
color: true,
|
|
63
|
-
radius: true,
|
|
64
|
-
style: true,
|
|
65
|
-
width: true
|
|
66
|
-
}
|
|
60
|
+
width: true
|
|
67
61
|
},
|
|
68
62
|
color: {
|
|
69
63
|
gradients: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","textAlign","type","content","source","selector","role","level","levelOptions","placeholder","supports","align","anchor","className","splitting","__experimentalBorder","color","radius","style","width","
|
|
1
|
+
{"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","textAlign","type","content","source","selector","role","level","levelOptions","placeholder","supports","align","anchor","className","splitting","__experimentalBorder","color","radius","style","width","gradients","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalTextDecoration","__experimentalWritingMode","__unstablePasteTextInline","__experimentalSlashInserter","interactivity","clientNavigation","editorStyle","settings","icon","example","__","__experimentalLabel","context","customName","hasContent","trim","length","sprintf","transforms","deprecated","merge","attributesToMerge","edit","save","init","initBlock"],"sources":["@wordpress/block-library/src/heading/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { heading as icon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcontent: __( 'Code is Poetry' ),\n\t\t\tlevel: 2,\n\t\t\ttextAlign: 'center',\n\t\t},\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { content, level } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\t\tconst hasContent = content?.trim().length > 0;\n\n\t\t// In the list view, use the block's content as the label.\n\t\t// If the content is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || hasContent ) ) {\n\t\t\treturn customName || content;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\treturn ! hasContent\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. %s: heading level. */\n\t\t\t\t\t\t__( 'Level %s. Empty.' ),\n\t\t\t\t\t\tlevel\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. 1: heading level. 2: heading content. */\n\t\t\t\t\t\t__( 'Level %1$s. %2$s' ),\n\t\t\t\t\t\tlevel,\n\t\t\t\t\t\tcontent\n\t\t\t\t );\n\t\t}\n\t},\n\ttransforms,\n\tdeprecated,\n\tmerge( attributes, attributesToMerge ) {\n\t\treturn {\n\t\t\tcontent:\n\t\t\t\t( attributes.content || '' ) +\n\t\t\t\t( attributesToMerge.content || '' ),\n\t\t};\n\t},\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,WAAA,GAAAJ,sBAAA,CA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]}
|
package/build/home-link/edit.js
CHANGED
|
@@ -10,7 +10,6 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
10
10
|
var _i18n = require("@wordpress/i18n");
|
|
11
11
|
var _data = require("@wordpress/data");
|
|
12
12
|
var _coreData = require("@wordpress/core-data");
|
|
13
|
-
var _element = require("@wordpress/element");
|
|
14
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
14
|
/**
|
|
16
15
|
* External dependencies
|
|
@@ -26,13 +25,11 @@ function HomeEdit({
|
|
|
26
25
|
setAttributes,
|
|
27
26
|
context
|
|
28
27
|
}) {
|
|
28
|
+
var _attributes$label;
|
|
29
29
|
const homeUrl = (0, _data.useSelect)(select => {
|
|
30
30
|
// Site index.
|
|
31
31
|
return select(_coreData.store).getEntityRecord('root', '__unstableBase')?.home;
|
|
32
32
|
}, []);
|
|
33
|
-
const {
|
|
34
|
-
__unstableMarkNextChangeAsNotPersistent
|
|
35
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
36
33
|
const {
|
|
37
34
|
textColor,
|
|
38
35
|
backgroundColor,
|
|
@@ -50,38 +47,25 @@ function HomeEdit({
|
|
|
50
47
|
backgroundColor: style?.color?.background
|
|
51
48
|
}
|
|
52
49
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
identifier: "label",
|
|
73
|
-
className: "wp-block-home-link__label",
|
|
74
|
-
value: label,
|
|
75
|
-
onChange: labelValue => {
|
|
76
|
-
setAttributes({
|
|
77
|
-
label: labelValue
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
"aria-label": (0, _i18n.__)('Home link text'),
|
|
81
|
-
placeholder: (0, _i18n.__)('Add home link'),
|
|
82
|
-
withoutInteractiveFormatting: true,
|
|
83
|
-
allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
|
|
84
|
-
})
|
|
50
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
51
|
+
...blockProps,
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
53
|
+
className: "wp-block-home-link__content wp-block-navigation-item__content",
|
|
54
|
+
href: homeUrl,
|
|
55
|
+
onClick: preventDefault,
|
|
56
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText, {
|
|
57
|
+
identifier: "label",
|
|
58
|
+
className: "wp-block-home-link__label",
|
|
59
|
+
value: (_attributes$label = attributes.label) !== null && _attributes$label !== void 0 ? _attributes$label : (0, _i18n.__)('Home'),
|
|
60
|
+
onChange: labelValue => {
|
|
61
|
+
setAttributes({
|
|
62
|
+
label: labelValue
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
"aria-label": (0, _i18n.__)('Home link text'),
|
|
66
|
+
placeholder: (0, _i18n.__)('Add home link'),
|
|
67
|
+
withoutInteractiveFormatting: true,
|
|
68
|
+
allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
|
|
85
69
|
})
|
|
86
70
|
})
|
|
87
71
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_i18n","_data","_coreData","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_i18n","_data","_coreData","_jsxRuntime","preventDefault","event","HomeEdit","attributes","setAttributes","context","_attributes$label","homeUrl","useSelect","select","coreStore","getEntityRecord","home","textColor","backgroundColor","style","blockProps","useBlockProps","className","clsx","color","text","background","jsx","children","href","onClick","RichText","identifier","value","label","__","onChange","labelValue","placeholder","withoutInteractiveFormatting","allowedFormats"],"sources":["@wordpress/block-library/src/home-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst preventDefault = ( event ) => event.preventDefault();\n\nexport default function HomeEdit( { attributes, setAttributes, context } ) {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\t// Site index.\n\t\treturn select( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t?.home;\n\t}, [] );\n\n\tconst { textColor, backgroundColor, style } = context;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( 'wp-block-navigation-item', {\n\t\t\t'has-text-color': !! textColor || !! style?.color?.text,\n\t\t\t[ `has-${ textColor }-color` ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || !! style?.color?.background,\n\t\t\t[ `has-${ backgroundColor }-background-color` ]: !! backgroundColor,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: style?.color?.text,\n\t\t\tbackgroundColor: style?.color?.background,\n\t\t},\n\t} );\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<a\n\t\t\t\tclassName=\"wp-block-home-link__content wp-block-navigation-item__content\"\n\t\t\t\thref={ homeUrl }\n\t\t\t\tonClick={ preventDefault }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\tclassName=\"wp-block-home-link__label\"\n\t\t\t\t\tvalue={ attributes.label ?? __( 'Home' ) }\n\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t} }\n\t\t\t\t\taria-label={ __( 'Home link text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add home link' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t'core/italic',\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AE;MACNK,KAAK,EAAEL,KAAK,EAAEK,KAAK,EAAEC,IAAI;MACzBP,eAAe,EAAEC,KAAK,EAAEK,KAAK,EAAEE;IAChC;EACD,CAAE,CAAC;EAEH,oBACC,IAAAvB,WAAA,CAAAwB,GAAA;IAAA,GAAUP,UAAU;IAAAQ,QAAA,eACnB,IAAAzB,WAAA,CAAAwB,GAAA;MACCL,SAAS,EAAC,+DAA+D;MACzEO,IAAI,EAAGlB,OAAS;MAChBmB,OAAO,EAAG1B,cAAgB;MAAAwB,QAAA,eAE1B,IAAAzB,WAAA,CAAAwB,GAAA,EAAC5B,YAAA,CAAAgC,QAAQ;QACRC,UAAU,EAAC,OAAO;QAClBV,SAAS,EAAC,2BAA2B;QACrCW,KAAK,GAAAvB,iBAAA,GAAGH,UAAU,CAAC2B,KAAK,cAAAxB,iBAAA,cAAAA,iBAAA,GAAI,IAAAyB,QAAE,EAAE,MAAO,CAAG;QAC1CC,QAAQ,EAAKC,UAAU,IAAM;UAC5B7B,aAAa,CAAE;YAAE0B,KAAK,EAAEG;UAAW,CAAE,CAAC;QACvC,CAAG;QACH,cAAa,IAAAF,QAAE,EAAE,gBAAiB,CAAG;QACrCG,WAAW,EAAG,IAAAH,QAAE,EAAE,eAAgB,CAAG;QACrCI,4BAA4B;QAC5BC,cAAc,EAAG,CAChB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,oBAAoB;MAClB,CACH;IAAC,CACA;EAAC,CACA,CAAC;AAER","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ var _blockEditor = require("@wordpress/block-editor");
|
|
|
8
8
|
var _coreData = require("@wordpress/core-data");
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
10
|
var _createTemplatePartId = require("../template-part/edit/utils/create-template-part-id");
|
|
11
|
+
var _getTemplatePartIcon = require("../template-part/edit/utils/get-template-part-icon");
|
|
11
12
|
/**
|
|
12
13
|
* WordPress dependencies
|
|
13
14
|
*/
|
|
@@ -34,14 +35,11 @@ function useTemplatePartAreaLabel(clientId) {
|
|
|
34
35
|
if (!parentTemplatePartClientIds?.length) {
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/* eslint-disable @wordpress/data-no-store-string-literals */
|
|
43
|
-
const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
|
|
44
|
-
/* eslint-enable @wordpress/data-no-store-string-literals */
|
|
38
|
+
const defaultTemplatePartAreas = select(_coreData.store).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || [];
|
|
39
|
+
const definedAreas = defaultTemplatePartAreas.map(item => ({
|
|
40
|
+
...item,
|
|
41
|
+
icon: (0, _getTemplatePartIcon.getTemplatePartIcon)(item.icon)
|
|
42
|
+
}));
|
|
45
43
|
const {
|
|
46
44
|
getCurrentTheme,
|
|
47
45
|
getEditedEntityRecord
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_coreData","_data","_createTemplatePartId","useTemplatePartAreaLabel","clientId","useSelect","select","getBlock","getBlockParentsByBlockName","blockEditorStore","withAscendingResults","parentTemplatePartClientIds","length","definedAreas","
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_coreData","_data","_createTemplatePartId","_getTemplatePartIcon","useTemplatePartAreaLabel","clientId","useSelect","select","getBlock","getBlockParentsByBlockName","blockEditorStore","withAscendingResults","parentTemplatePartClientIds","length","defaultTemplatePartAreas","coreStore","getEntityRecord","default_template_part_areas","definedAreas","map","item","icon","getTemplatePartIcon","getCurrentTheme","getEditedEntityRecord","templatePartClientId","templatePartBlock","theme","stylesheet","slug","attributes","templatePartEntityId","createTemplatePartId","templatePartEntity","area","find","definedArea","label"],"sources":["@wordpress/block-library/src/navigation/use-template-part-area-label.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\n\n// TODO: this util should perhaps be refactored somewhere like core-data.\nimport { createTemplatePartId } from '../template-part/edit/utils/create-template-part-id';\nimport { getTemplatePartIcon } from '../template-part/edit/utils/get-template-part-icon';\n\nexport default function useTemplatePartAreaLabel( clientId ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\t// Use the lack of a clientId as an opportunity to bypass the rest\n\t\t\t// of this hook.\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { getBlock, getBlockParentsByBlockName } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst withAscendingResults = true;\n\t\t\tconst parentTemplatePartClientIds = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/template-part',\n\t\t\t\twithAscendingResults\n\t\t\t);\n\n\t\t\tif ( ! parentTemplatePartClientIds?.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst defaultTemplatePartAreas =\n\t\t\t\tselect( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t\t\t?.default_template_part_areas || [];\n\n\t\t\tconst definedAreas = defaultTemplatePartAreas.map( ( item ) => ( {\n\t\t\t\t...item,\n\t\t\t\ticon: getTemplatePartIcon( item.icon ),\n\t\t\t} ) );\n\n\t\t\tconst { getCurrentTheme, getEditedEntityRecord } =\n\t\t\t\tselect( coreStore );\n\n\t\t\tfor ( const templatePartClientId of parentTemplatePartClientIds ) {\n\t\t\t\tconst templatePartBlock = getBlock( templatePartClientId );\n\n\t\t\t\t// The 'area' usually isn't stored on the block, but instead\n\t\t\t\t// on the entity.\n\t\t\t\tconst { theme = getCurrentTheme()?.stylesheet, slug } =\n\t\t\t\t\ttemplatePartBlock.attributes;\n\t\t\t\tconst templatePartEntityId = createTemplatePartId(\n\t\t\t\t\ttheme,\n\t\t\t\t\tslug\n\t\t\t\t);\n\t\t\t\tconst templatePartEntity = getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template_part',\n\t\t\t\t\ttemplatePartEntityId\n\t\t\t\t);\n\n\t\t\t\t// Look up the `label` for the area in the defined areas so\n\t\t\t\t// that an internationalized label can be used.\n\t\t\t\tif ( templatePartEntity?.area ) {\n\t\t\t\t\treturn definedAreas.find(\n\t\t\t\t\t\t( definedArea ) =>\n\t\t\t\t\t\t\tdefinedArea.area !== 'uncategorized' &&\n\t\t\t\t\t\t\tdefinedArea.area === templatePartEntity.area\n\t\t\t\t\t)?.label;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[ clientId ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAOA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AAbA;AACA;AACA;;AAKA;AACA;AACA;;AAEA;;AAIe,SAASK,wBAAwBA,CAAEC,QAAQ,EAAG;EAC5D,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb;IACA;IACA,IAAK,CAAEF,QAAQ,EAAG;MACjB;IACD;IAEA,MAAM;MAAEG,QAAQ;MAAEC;IAA2B,CAAC,GAC7CF,MAAM,CAAEG,kBAAiB,CAAC;IAE3B,MAAMC,oBAAoB,GAAG,IAAI;IACjC,MAAMC,2BAA2B,GAAGH,0BAA0B,CAC7DJ,QAAQ,EACR,oBAAoB,EACpBM,oBACD,CAAC;IAED,IAAK,CAAEC,2BAA2B,EAAEC,MAAM,EAAG;MAC5C;IACD;IAEA,MAAMC,wBAAwB,GAC7BP,MAAM,CAAEQ,eAAU,CAAC,CAACC,eAAe,CAAE,MAAM,EAAE,gBAAiB,CAAC,EAC5DC,2BAA2B,IAAI,EAAE;IAErC,MAAMC,YAAY,GAAGJ,wBAAwB,CAACK,GAAG,CAAIC,IAAI,KAAQ;MAChE,GAAGA,IAAI;MACPC,IAAI,EAAE,IAAAC,wCAAmB,EAAEF,IAAI,CAACC,IAAK;IACtC,CAAC,CAAG,CAAC;IAEL,MAAM;MAAEE,eAAe;MAAEC;IAAsB,CAAC,GAC/CjB,MAAM,CAAEQ,eAAU,CAAC;IAEpB,KAAM,MAAMU,oBAAoB,IAAIb,2BAA2B,EAAG;MACjE,MAAMc,iBAAiB,GAAGlB,QAAQ,CAAEiB,oBAAqB,CAAC;;MAE1D;MACA;MACA,MAAM;QAAEE,KAAK,GAAGJ,eAAe,CAAC,CAAC,EAAEK,UAAU;QAAEC;MAAK,CAAC,GACpDH,iBAAiB,CAACI,UAAU;MAC7B,MAAMC,oBAAoB,GAAG,IAAAC,0CAAoB,EAChDL,KAAK,EACLE,IACD,CAAC;MACD,MAAMI,kBAAkB,GAAGT,qBAAqB,CAC/C,UAAU,EACV,kBAAkB,EAClBO,oBACD,CAAC;;MAED;MACA;MACA,IAAKE,kBAAkB,EAAEC,IAAI,EAAG;QAC/B,OAAOhB,YAAY,CAACiB,IAAI,CACrBC,WAAW,IACZA,WAAW,CAACF,IAAI,KAAK,eAAe,IACpCE,WAAW,CAACF,IAAI,KAAKD,kBAAkB,CAACC,IAC1C,CAAC,EAAEG,KAAK;MACT;IACD;EACD,CAAC,EACD,CAAEhC,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
|
package/build/page-list/index.js
CHANGED
|
@@ -53,6 +53,20 @@ const metadata = exports.metadata = {
|
|
|
53
53
|
},
|
|
54
54
|
interactivity: {
|
|
55
55
|
clientNavigation: true
|
|
56
|
+
},
|
|
57
|
+
__experimentalBorder: {
|
|
58
|
+
radius: true,
|
|
59
|
+
color: true,
|
|
60
|
+
width: true,
|
|
61
|
+
style: true
|
|
62
|
+
},
|
|
63
|
+
spacing: {
|
|
64
|
+
padding: true,
|
|
65
|
+
margin: true,
|
|
66
|
+
__experimentalDefaultControls: {
|
|
67
|
+
padding: false,
|
|
68
|
+
margin: false
|
|
69
|
+
}
|
|
56
70
|
}
|
|
57
71
|
},
|
|
58
72
|
editorStyle: "wp-block-page-list-editor",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","allowedBlocks","description","keywords","textdomain","attributes","parentPageID","type","isNested","usesContext","supports","reusable","html","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","interactivity","clientNavigation","
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","allowedBlocks","description","keywords","textdomain","attributes","parentPageID","type","isNested","usesContext","supports","reusable","html","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","interactivity","clientNavigation","__experimentalBorder","radius","color","width","style","spacing","padding","margin","editorStyle","settings","icon","pages","example","edit","init","initBlock"],"sources":["@wordpress/block-library/src/page-list/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { pages } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit.js';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon: pages,\n\texample: {},\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,aAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,YAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,QAAA;MAAAD,IAAA;MAAA;IAAA;EAAA;EAAAE,WAAA;EAAAC,QAAA;IAAAC,QAAA;IAAAC,IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAC,6BAAA;QAAAR,QAAA;MAAA;IAAA;IAAAS,aAAA;MAAAC,gBAAA;IAAA;IAAAC,oBAAA;MAAAC,MAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAC,KAAA;IAAA;IAAAC,OAAA;MAAAC,OAAA;MAAAC,MAAA;MAAAV,6BAAA;QAAAS,OAAA;QAAAC,MAAA;MAAA;IAAA;EAAA;EAAAC,WAAA;EAAAJ,KAAA;AAAA;AAOA,MAAM;EAAE/B;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAInB,MAAMoC,QAAQ,GAAAvC,OAAA,CAAAuC,QAAA,GAAG;EACvBC,IAAI,EAAEC,YAAK;EACXC,OAAO,EAAE,CAAC,CAAC;EACXC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE1C,IAAI;EAAEJ,QAAQ;EAAEwC;AAAS,CAAE,CAAC;AAACvC,OAAA,CAAA4C,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/build/paragraph/edit.js
CHANGED
|
@@ -65,25 +65,28 @@ function DropCapControl({
|
|
|
65
65
|
} else {
|
|
66
66
|
helpText = (0, _i18n.__)('Show a large initial letter.');
|
|
67
67
|
}
|
|
68
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
dropCap: undefined
|
|
73
|
-
}),
|
|
74
|
-
resetAllFilter: () => ({
|
|
75
|
-
dropCap: undefined
|
|
76
|
-
}),
|
|
77
|
-
panelId: clientId,
|
|
78
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
79
|
-
__nextHasNoMarginBottom: true,
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
69
|
+
group: "typography",
|
|
70
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
71
|
+
hasValue: () => !!dropCap,
|
|
80
72
|
label: (0, _i18n.__)('Drop cap'),
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
onDeselect: () => setAttributes({
|
|
74
|
+
dropCap: undefined
|
|
75
|
+
}),
|
|
76
|
+
resetAllFilter: () => ({
|
|
77
|
+
dropCap: undefined
|
|
84
78
|
}),
|
|
85
|
-
|
|
86
|
-
|
|
79
|
+
panelId: clientId,
|
|
80
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
81
|
+
__nextHasNoMarginBottom: true,
|
|
82
|
+
label: (0, _i18n.__)('Drop cap'),
|
|
83
|
+
checked: !!dropCap,
|
|
84
|
+
onChange: () => setAttributes({
|
|
85
|
+
dropCap: !dropCap
|
|
86
|
+
}),
|
|
87
|
+
help: helpText,
|
|
88
|
+
disabled: hasDropCapDisabled(align)
|
|
89
|
+
})
|
|
87
90
|
})
|
|
88
91
|
});
|
|
89
92
|
}
|
|
@@ -93,7 +96,8 @@ function ParagraphBlock({
|
|
|
93
96
|
onReplace,
|
|
94
97
|
onRemove,
|
|
95
98
|
setAttributes,
|
|
96
|
-
clientId
|
|
99
|
+
clientId,
|
|
100
|
+
isSelected: isSingleSelected
|
|
97
101
|
}) {
|
|
98
102
|
const {
|
|
99
103
|
align,
|
|
@@ -131,13 +135,10 @@ function ParagraphBlock({
|
|
|
131
135
|
direction: newDirection
|
|
132
136
|
})
|
|
133
137
|
})]
|
|
134
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
attributes: attributes,
|
|
139
|
-
setAttributes: setAttributes
|
|
140
|
-
})
|
|
138
|
+
}), isSingleSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)(DropCapControl, {
|
|
139
|
+
clientId: clientId,
|
|
140
|
+
attributes: attributes,
|
|
141
|
+
setAttributes: setAttributes
|
|
141
142
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText, {
|
|
142
143
|
identifier: "content",
|
|
143
144
|
tagName: "p",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_blockEditor","_icons","_useEnter","_jsxRuntime","ParagraphRTLControl","direction","setDirection","isRTL","jsx","ToolbarButton","icon","formatLtr","title","_x","isActive","onClick","undefined","hasDropCapDisabled","align","DropCapControl","clientId","attributes","setAttributes","isDropCapFeatureEnabled","useSettings","dropCap","helpText","__","__experimentalToolsPanelItem","hasValue","label","onDeselect","resetAllFilter","panelId","children","ToggleControl","__nextHasNoMarginBottom","checked","onChange","help","disabled","ParagraphBlock","mergeBlocks","onReplace","onRemove","content","placeholder","blockProps","useBlockProps","ref","useOnEnter","className","clsx","style","blockEditingMode","useBlockEditingMode","jsxs","Fragment","BlockControls","group","AlignmentControl","value","newAlign","newDirection","InspectorControls","RichText","identifier","tagName","newContent","onMerge","isEmpty","__unstableEmbedURLOnPaste","__unstableAllowPrefixTransformations","_default","exports","default"],"sources":["@wordpress/block-library/src/paragraph/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tuseSettings,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { formatLtr } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useOnEnter } from './use-enter';\n\nfunction ParagraphRTLControl( { direction, setDirection } ) {\n\treturn (\n\t\tisRTL() && (\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ formatLtr }\n\t\t\t\ttitle={ _x( 'Left to right', 'editor button' ) }\n\t\t\t\tisActive={ direction === 'ltr' }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetDirection( direction === 'ltr' ? undefined : 'ltr' );\n\t\t\t\t} }\n\t\t\t/>\n\t\t)\n\t);\n}\n\nfunction hasDropCapDisabled( align ) {\n\treturn align === ( isRTL() ? 'left' : 'right' ) || align === 'center';\n}\n\nfunction DropCapControl( { clientId, attributes, setAttributes } ) {\n\t// Please do not add a useSelect call to the paragraph block unconditionally.\n\t// Every useSelect added to a (frequently used) block will degrade load\n\t// and type performance. By moving it within InspectorControls, the subscription is\n\t// now only added for the selected block(s).\n\tconst [ isDropCapFeatureEnabled ] = useSettings( 'typography.dropCap' );\n\n\tif ( ! isDropCapFeatureEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst { align, dropCap } = attributes;\n\n\tlet helpText;\n\tif ( hasDropCapDisabled( align ) ) {\n\t\thelpText = __( 'Not available for aligned text.' );\n\t} else if ( dropCap ) {\n\t\thelpText = __( 'Showing large initial letter.' );\n\t} else {\n\t\thelpText = __( 'Show a large initial letter.' );\n\t}\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => !! dropCap }\n\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\tonDeselect={ () => setAttributes( { dropCap: undefined } ) }\n\t\t\tresetAllFilter={ () => ( { dropCap: undefined } ) }\n\t\t\tpanelId={ clientId }\n\t\t>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\tchecked={ !! dropCap }\n\t\t\t\tonChange={ () => setAttributes( { dropCap: ! dropCap } ) }\n\t\t\t\thelp={ helpText }\n\t\t\t\tdisabled={ hasDropCapDisabled( align ) }\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n\nfunction ParagraphBlock( {\n\tattributes,\n\tmergeBlocks,\n\tonReplace,\n\tonRemove,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { align, content, direction, dropCap, placeholder } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tref: useOnEnter( { clientId, content } ),\n\t\tclassName: clsx( {\n\t\t\t'has-drop-cap': hasDropCapDisabled( align ) ? false : dropCap,\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\tstyle: { direction },\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ align }\n\t\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\talign: newAlign,\n\t\t\t\t\t\t\t\tdropCap: hasDropCapDisabled( newAlign )\n\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t: dropCap,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ParagraphRTLControl\n\t\t\t\t\t\tdirection={ direction }\n\t\t\t\t\t\tsetDirection={ ( newDirection ) =>\n\t\t\t\t\t\t\tsetAttributes( { direction: newDirection } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"typography\">\n\t\t\t\t<DropCapControl\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"p\"\n\t\t\t\t{ ...blockProps }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t}\n\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tonRemove={ onRemove }\n\t\t\t\taria-label={\n\t\t\t\t\tRichText.isEmpty( content )\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'Empty block; start writing or type forward slash to choose a block'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Block: Paragraph' )\n\t\t\t\t}\n\t\t\t\tdata-empty={ RichText.isEmpty( content ) }\n\t\t\t\tplaceholder={ placeholder || __( 'Type / to choose a block' ) }\n\t\t\t\tdata-custom-placeholder={ placeholder ? true : undefined }\n\t\t\t\t__unstableEmbedURLOnPaste\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ParagraphBlock;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,SAAA,GAAAL,OAAA;AAAyC,IAAAM,WAAA,GAAAN,OAAA;AA5BzC;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAGA,SAASO,mBAAmBA,CAAE;EAAEC,SAAS;EAAEC;AAAa,CAAC,EAAG;EAC3D,OACC,IAAAC,WAAK,EAAC,CAAC,iBACN,IAAAJ,WAAA,CAAAK,GAAA,EAACT,WAA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AAE,EACF,oEACA,CAAC,GACD,IAAAA,QAAE,EAAE,kBAAmB,CAC1B;MACD,cAAasC,qBAAQ,CAACK,OAAO,CAAEzB,OAAQ,CAAG;MAC1CC,WAAW,EAAGA,WAAW,IAAI,IAAAnB,QAAE,EAAE,0BAA2B,CAAG;MAC/D,2BAA0BmB,WAAW,GAAG,IAAI,GAAG9B,SAAW;MAC1DuD,yBAAyB;MACzBC,oCAAoC;IAAA,CACpC,CAAC;EAAA,CACD,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_components","_blockEditor","_icons","_useEnter","_jsxRuntime","ParagraphRTLControl","direction","setDirection","isRTL","jsx","ToolbarButton","icon","formatLtr","title","_x","isActive","onClick","undefined","hasDropCapDisabled","align","DropCapControl","clientId","attributes","setAttributes","isDropCapFeatureEnabled","useSettings","dropCap","helpText","__","InspectorControls","group","children","__experimentalToolsPanelItem","hasValue","label","onDeselect","resetAllFilter","panelId","ToggleControl","__nextHasNoMarginBottom","checked","onChange","help","disabled","ParagraphBlock","mergeBlocks","onReplace","onRemove","isSelected","isSingleSelected","content","placeholder","blockProps","useBlockProps","ref","useOnEnter","className","clsx","style","blockEditingMode","useBlockEditingMode","jsxs","Fragment","BlockControls","AlignmentControl","value","newAlign","newDirection","RichText","identifier","tagName","newContent","onMerge","isEmpty","__unstableEmbedURLOnPaste","__unstableAllowPrefixTransformations","_default","exports","default"],"sources":["@wordpress/block-library/src/paragraph/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport {\n\tToolbarButton,\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tuseSettings,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { formatLtr } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useOnEnter } from './use-enter';\n\nfunction ParagraphRTLControl( { direction, setDirection } ) {\n\treturn (\n\t\tisRTL() && (\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ formatLtr }\n\t\t\t\ttitle={ _x( 'Left to right', 'editor button' ) }\n\t\t\t\tisActive={ direction === 'ltr' }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetDirection( direction === 'ltr' ? undefined : 'ltr' );\n\t\t\t\t} }\n\t\t\t/>\n\t\t)\n\t);\n}\n\nfunction hasDropCapDisabled( align ) {\n\treturn align === ( isRTL() ? 'left' : 'right' ) || align === 'center';\n}\n\nfunction DropCapControl( { clientId, attributes, setAttributes } ) {\n\t// Please do not add a useSelect call to the paragraph block unconditionally.\n\t// Every useSelect added to a (frequently used) block will degrade load\n\t// and type performance. By moving it within InspectorControls, the subscription is\n\t// now only added for the selected block(s).\n\tconst [ isDropCapFeatureEnabled ] = useSettings( 'typography.dropCap' );\n\n\tif ( ! isDropCapFeatureEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst { align, dropCap } = attributes;\n\n\tlet helpText;\n\tif ( hasDropCapDisabled( align ) ) {\n\t\thelpText = __( 'Not available for aligned text.' );\n\t} else if ( dropCap ) {\n\t\thelpText = __( 'Showing large initial letter.' );\n\t} else {\n\t\thelpText = __( 'Show a large initial letter.' );\n\t}\n\n\treturn (\n\t\t<InspectorControls group=\"typography\">\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! dropCap }\n\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { dropCap: undefined } ) }\n\t\t\t\tresetAllFilter={ () => ( { dropCap: undefined } ) }\n\t\t\t\tpanelId={ clientId }\n\t\t\t>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\t\tchecked={ !! dropCap }\n\t\t\t\t\tonChange={ () => setAttributes( { dropCap: ! dropCap } ) }\n\t\t\t\t\thelp={ helpText }\n\t\t\t\t\tdisabled={ hasDropCapDisabled( align ) }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t</InspectorControls>\n\t);\n}\n\nfunction ParagraphBlock( {\n\tattributes,\n\tmergeBlocks,\n\tonReplace,\n\tonRemove,\n\tsetAttributes,\n\tclientId,\n\tisSelected: isSingleSelected,\n} ) {\n\tconst { align, content, direction, dropCap, placeholder } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tref: useOnEnter( { clientId, content } ),\n\t\tclassName: clsx( {\n\t\t\t'has-drop-cap': hasDropCapDisabled( align ) ? false : dropCap,\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\tstyle: { direction },\n\t} );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<AlignmentControl\n\t\t\t\t\t\tvalue={ align }\n\t\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\talign: newAlign,\n\t\t\t\t\t\t\t\tdropCap: hasDropCapDisabled( newAlign )\n\t\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t\t: dropCap,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ParagraphRTLControl\n\t\t\t\t\t\tdirection={ direction }\n\t\t\t\t\t\tsetDirection={ ( newDirection ) =>\n\t\t\t\t\t\t\tsetAttributes( { direction: newDirection } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && (\n\t\t\t\t<DropCapControl\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"p\"\n\t\t\t\t{ ...blockProps }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t}\n\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tonRemove={ onRemove }\n\t\t\t\taria-label={\n\t\t\t\t\tRichText.isEmpty( content )\n\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t'Empty block; start writing or type forward slash to choose a block'\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Block: Paragraph' )\n\t\t\t\t}\n\t\t\t\tdata-empty={ RichText.isEmpty( content ) }\n\t\t\t\tplaceholder={ placeholder || __( 'Type / to choose a block' ) }\n\t\t\t\tdata-custom-placeholder={ placeholder ? true : undefined }\n\t\t\t\t__unstableEmbedURLOnPaste\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ParagraphBlock;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AAKA,IAAAK,SAAA,GAAAL,OAAA;AAAyC,IAAAM,WAAA,GAAAN,OAAA;AA5BzC;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAGA,SAASO,mBAAmBA,CAAE;EAAEC,SAAS;EAAEC;AAAa,CAAC,EAAG;EAC3D,OACC,IAAAC,WAAK,EAAC,CAAC,iBACN,IAAAJ,WAAA,CAAAK,GAA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qBAAQ,CAACK,OAAO,CAAEvB,OAAQ,CAAC,GACxB,IAAAtB,QAAE,EACF,oEACA,CAAC,GACD,IAAAA,QAAE,EAAE,kBAAmB,CAC1B;MACD,cAAawC,qBAAQ,CAACK,OAAO,CAAEvB,OAAQ,CAAG;MAC1CC,WAAW,EAAGA,WAAW,IAAI,IAAAvB,QAAE,EAAE,0BAA2B,CAAG;MAC/D,2BAA0BuB,WAAW,GAAG,IAAI,GAAGlC,SAAW;MAC1DyD,yBAAyB;MACzBC,oCAAoC;IAAA,CACpC,CAAC;EAAA,CACD,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEclC,cAAc","ignoreList":[]}
|
|
@@ -25,11 +25,9 @@ function EnhancedPaginationControl({
|
|
|
25
25
|
hasUnsupportedBlocks
|
|
26
26
|
} = (0, _utils.useUnsupportedBlocks)(clientId);
|
|
27
27
|
const fullPageClientSideNavigation = window.__experimentalFullPageClientSideNavigation;
|
|
28
|
-
let help = (0, _i18n.__)('
|
|
28
|
+
let help = (0, _i18n.__)('Reload the full page—instead of just the posts list—when visitors navigate between pages.');
|
|
29
29
|
if (fullPageClientSideNavigation) {
|
|
30
30
|
help = (0, _i18n.__)('Experimental full-page client-side navigation setting enabled.');
|
|
31
|
-
} else if (enhancedPagination) {
|
|
32
|
-
help = (0, _i18n.__)('Reload the full page—instead of just the posts list—when visitors navigate between pages.');
|
|
33
31
|
} else if (hasUnsupportedBlocks) {
|
|
34
32
|
help = (0, _i18n.__)('Enhancement disabled because there are non-compatible blocks inside the Query block.');
|
|
35
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_utils","_jsxRuntime","EnhancedPaginationControl","enhancedPagination","setAttributes","clientId","hasUnsupportedBlocks","useUnsupportedBlocks","fullPageClientSideNavigation","window","__experimentalFullPageClientSideNavigation","help","__","jsx","Fragment","children","ToggleControl","__nextHasNoMarginBottom","label","checked","disabled","onChange","value"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useUnsupportedBlocks } from '../../utils';\n\nexport default function EnhancedPaginationControl( {\n\tenhancedPagination,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { hasUnsupportedBlocks } = useUnsupportedBlocks( clientId );\n\tconst fullPageClientSideNavigation =\n\t\twindow.__experimentalFullPageClientSideNavigation;\n\n\tlet help = __(
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_utils","_jsxRuntime","EnhancedPaginationControl","enhancedPagination","setAttributes","clientId","hasUnsupportedBlocks","useUnsupportedBlocks","fullPageClientSideNavigation","window","__experimentalFullPageClientSideNavigation","help","__","jsx","Fragment","children","ToggleControl","__nextHasNoMarginBottom","label","checked","disabled","onChange","value"],"sources":["@wordpress/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToggleControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useUnsupportedBlocks } from '../../utils';\n\nexport default function EnhancedPaginationControl( {\n\tenhancedPagination,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { hasUnsupportedBlocks } = useUnsupportedBlocks( clientId );\n\tconst fullPageClientSideNavigation =\n\t\twindow.__experimentalFullPageClientSideNavigation;\n\n\tlet help = __(\n\t\t'Reload the full page—instead of just the posts list—when visitors navigate between pages.'\n\t);\n\tif ( fullPageClientSideNavigation ) {\n\t\thelp = __(\n\t\t\t'Experimental full-page client-side navigation setting enabled.'\n\t\t);\n\t} else if ( hasUnsupportedBlocks ) {\n\t\thelp = __(\n\t\t\t'Enhancement disabled because there are non-compatible blocks inside the Query block.'\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Reload full page' ) }\n\t\t\t\thelp={ help }\n\t\t\t\tchecked={\n\t\t\t\t\t! enhancedPagination && ! fullPageClientSideNavigation\n\t\t\t\t}\n\t\t\t\tdisabled={\n\t\t\t\t\thasUnsupportedBlocks || fullPageClientSideNavigation\n\t\t\t\t}\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tenhancedPagination: ! value,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AAAmD,IAAAG,WAAA,GAAAH,OAAA;AATnD;AACA;AACA;;AAIA;AACA;AACA;;AAGe,SAASI,yBAAyBA,CAAE;EAClDC,kBAAkB;EAClBC,aAAa;EACbC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,2BAAoB,EAAEF,QAAS,CAAC;EACjE,MAAMG,4BAA4B,GACjCC,MAAM,CAACC,0CAA0C;EAElD,IAAIC,IAAI,GAAG,IAAAC,QAAE,EACZ,2FACD,CAAC;EACD,IAAKJ,4BAA4B,EAAG;IACnCG,IAAI,GAAG,IAAAC,QAAE,EACR,gEACD,CAAC;EACF,CAAC,MAAM,IAAKN,oBAAoB,EAAG;IAClCK,IAAI,GAAG,IAAAC,QAAE,EACR,sFACD,CAAC;EACF;EAEA,oBACC,IAAAX,WAAA,CAAAY,GAAA,EAAAZ,WAAA,CAAAa,QAAA;IAAAC,QAAA,eACC,IAAAd,WAAA,CAAAY,GAAA,EAAChB,WAAA,CAAAmB,aAAa;MACbC,uBAAuB;MACvBC,KAAK,EAAG,IAAAN,QAAE,EAAE,kBAAmB,CAAG;MAClCD,IAAI,EAAGA,IAAM;MACbQ,OAAO,EACN,CAAEhB,kBAAkB,IAAI,CAAEK,4BAC1B;MACDY,QAAQ,EACPd,oBAAoB,IAAIE,4BACxB;MACDa,QAAQ,EAAKC,KAAK,IAAM;QACvBlB,aAAa,CAAE;UACdD,kBAAkB,EAAE,CAAEmB;QACvB,CAAE,CAAC;MACJ;IAAG,CACH;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -9,7 +9,6 @@ var _components = require("@wordpress/components");
|
|
|
9
9
|
var _data = require("@wordpress/data");
|
|
10
10
|
var _coreData = require("@wordpress/core-data");
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
13
12
|
var _compose = require("@wordpress/compose");
|
|
14
13
|
var _element = require("@wordpress/element");
|
|
15
14
|
var _orderControl = _interopRequireDefault(require("./order-control"));
|
|
@@ -18,11 +17,9 @@ var _parentControl = _interopRequireDefault(require("./parent-control"));
|
|
|
18
17
|
var _taxonomyControls = require("./taxonomy-controls");
|
|
19
18
|
var _formatControls = _interopRequireDefault(require("./format-controls"));
|
|
20
19
|
var _stickyControl = _interopRequireDefault(require("./sticky-control"));
|
|
21
|
-
var _createNewPostLink = _interopRequireDefault(require("./create-new-post-link"));
|
|
22
20
|
var _perPageControl = _interopRequireDefault(require("./per-page-control"));
|
|
23
21
|
var _offsetControls = _interopRequireDefault(require("./offset-controls"));
|
|
24
22
|
var _pagesControl = _interopRequireDefault(require("./pages-control"));
|
|
25
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
26
23
|
var _utils = require("../../utils");
|
|
27
24
|
var _hooks = require("../../../utils/hooks");
|
|
28
25
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -34,9 +31,6 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
34
31
|
* Internal dependencies
|
|
35
32
|
*/
|
|
36
33
|
|
|
37
|
-
const {
|
|
38
|
-
BlockInfo
|
|
39
|
-
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
40
34
|
function QueryInspectorControls(props) {
|
|
41
35
|
const {
|
|
42
36
|
attributes,
|
|
@@ -142,11 +136,7 @@ function QueryInspectorControls(props) {
|
|
|
142
136
|
const showPagesControl = (0, _utils.isControlAllowed)(allowedControls, 'pages');
|
|
143
137
|
const showDisplayPanel = showPostCountControl || showOffSetControl || showPagesControl;
|
|
144
138
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
145
|
-
children: [
|
|
146
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_createNewPostLink.default, {
|
|
147
|
-
postType: postType
|
|
148
|
-
})
|
|
149
|
-
}), showSettingsPanel && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.PanelBody, {
|
|
139
|
+
children: [showSettingsPanel && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.PanelBody, {
|
|
150
140
|
title: (0, _i18n.__)('Settings'),
|
|
151
141
|
children: [showInheritControl && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToggleGroupControl, {
|
|
152
142
|
__next40pxDefaultSize: true,
|