@wordpress/block-library 9.12.0 → 9.13.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 +2 -0
- 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 +57 -10
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/index.js +4 -2
- package/build/social-link/index.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 +61 -14
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/index.js +4 -2
- package/build-module/social-link/index.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 +16 -8
- package/build-style/editor.css +16 -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 +8 -4
- package/build-style/social-link/editor.css +8 -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 +2 -2
- 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/block.json +4 -2
- package/src/social-link/edit.js +87 -19
- package/src/social-link/editor.scss +11 -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":["BlockControls","store","ToolbarGroup","ToolbarButton","Modal","Button","Flex","FlexItem","useEffect","useState","RawHTML","__","useSelect","fullscreen","useViewportMatch","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ModalAuxiliaryActions","onClick","isModalFullScreen","isMobileViewport","size","icon","isPressed","label","ClassicEdit","props","styles","select","getSettings","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","setIsModalFullScreen","onClose","children","title","onRequestClose","shouldCloseOnClickOutside","overlayClassName","isFullScreen","className","headerActions","defaultValue","justify","expanded","__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":["BlockControls","store","ToolbarGroup","ToolbarButton","Modal","Button","Flex","FlexItem","useEffect","useState","RawHTML","__","useSelect","fullscreen","useViewportMatch","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ModalAuxiliaryActions","onClick","isModalFullScreen","isMobileViewport","size","icon","isPressed","label","ClassicEdit","props","styles","select","getSettings","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","setIsModalFullScreen","onClose","children","title","onRequestClose","shouldCloseOnClickOutside","overlayClassName","isFullScreen","className","headerActions","defaultValue","justify","expanded","__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\ts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A,iBAAiB,EAAGA;MAAmB,CACvC,CACD;MAAA+C,QAAA,gBAEDtD,IAAA,CAACa,WAAW;QAACiB,EAAE,EAAGA,EAAI;QAACgC,YAAY,EAAGf;MAAS,CAAE,CAAC,eAClD7C,KAAA,CAACZ,IAAI;QACJsE,SAAS,EAAC,sCAAsC;QAChDG,OAAO,EAAC,UAAU;QAClBC,QAAQ,EAAG,KAAO;QAAAV,QAAA,gBAElBtD,IAAA,CAACT,QAAQ;UAAA+D,QAAA,eACRtD,IAAA,CAACX,MAAM;YACN4E,qBAAqB;YACrBC,OAAO,EAAC,UAAU;YAClB5D,OAAO,EAAG+C,OAAS;YAAAC,QAAA,EAEjB3D,EAAE,CAAE,QAAS;UAAC,CACT;QAAC,CACA,CAAC,eACXK,IAAA,CAACT,QAAQ;UAAA+D,QAAA,eACRtD,IAAA,CAACX,MAAM;YACN4E,qBAAqB;YACrBC,OAAO,EAAC,SAAS;YACjB5D,OAAO,EAAGA,CAAA,KAAM;cACf0C,aAAa,CAAE;gBACdD,OAAO,EACN1B,MAAM,CAACM,EAAE,CAACC,SAAS,CAACuC,UAAU,CAC7BrC,EACD;cACF,CAAE,CAAC;cACHqB,OAAO,CAAE,KAAM,CAAC;YACjB,CAAG;YAAAG,QAAA,EAED3D,EAAE,CAAE,MAAO;UAAC,CACP;QAAC,CACA,CAAC;MAAA,CACN,CAAC;IAAA,CACD,CACP;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["heading","icon","__","sprintf","initBlock","deprecated","edit","metadata","$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":["heading","icon","__","sprintf","initBlock","deprecated","edit","metadata","$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","save","transforms","settings","example","__experimentalLabel","context","customName","hasContent","trim","length","merge","attributesToMerge","init"],"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":"AAAA;AACA;AACA;AACA,SAASA,OAAO,IAAIC,IAAI,QAAQ,kBAAkB;AAClD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,SAAA;MAAAC,IAAA;IAAA;IAAAC,OAAA;MAAAD,IAAA;MAAAE,MAAA;MAAAC,QAAA;MAAAC,IAAA;IAAA;IAAAC,KAAA;MAAAL,IAAA;MAAA;IAAA;IAAAM,YAAA;MAAAN,IAAA;IAAA;IAAAO,WAAA;MAAAP,IAAA;IAAA;EAAA;EAAAQ,QAAA;IAAAC,KAAA;IAAAC,MAAA;IAAAC,SAAA;IAAAC,SAAA;IAAAC,oBAAA;MAAAC,KAAA;MAAAC,MAAA;MAAAC,KAAA;MAAAC,KAAA;IAAA;IAAAH,KAAA;MAAAI,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;MAAAL,6BAAA;QAAAI,MAAA;QAAAC,OAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,wBAA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EAAEsD,iBAAiB,EAAG;IACtC,OAAO;MACNnD,OAAO,EACN,CAAEH,UAAU,CAACG,OAAO,IAAI,EAAE,KACxBmD,iBAAiB,CAACnD,OAAO,IAAI,EAAE;IACnC,CAAC;EACF,CAAC;EACDb,IAAI;EACJqD;AACD,CAAC;AAED,OAAO,MAAMY,IAAI,GAAGA,CAAA,KAAMnE,SAAS,CAAE;EAAEM,IAAI;EAAEH,QAAQ;EAAEsD;AAAS,CAAE,CAAC","ignoreList":[]}
|
|
@@ -6,25 +6,22 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { RichText, useBlockProps
|
|
9
|
+
import { RichText, useBlockProps } from '@wordpress/block-editor';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
|
-
import { useSelect
|
|
11
|
+
import { useSelect } from '@wordpress/data';
|
|
12
12
|
import { store as coreStore } from '@wordpress/core-data';
|
|
13
|
-
import {
|
|
14
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
14
|
const preventDefault = event => event.preventDefault();
|
|
16
15
|
export default function HomeEdit({
|
|
17
16
|
attributes,
|
|
18
17
|
setAttributes,
|
|
19
18
|
context
|
|
20
19
|
}) {
|
|
20
|
+
var _attributes$label;
|
|
21
21
|
const homeUrl = useSelect(select => {
|
|
22
22
|
// Site index.
|
|
23
23
|
return select(coreStore).getEntityRecord('root', '__unstableBase')?.home;
|
|
24
24
|
}, []);
|
|
25
|
-
const {
|
|
26
|
-
__unstableMarkNextChangeAsNotPersistent
|
|
27
|
-
} = useDispatch(blockEditorStore);
|
|
28
25
|
const {
|
|
29
26
|
textColor,
|
|
30
27
|
backgroundColor,
|
|
@@ -42,38 +39,25 @@ export default function HomeEdit({
|
|
|
42
39
|
backgroundColor: style?.color?.background
|
|
43
40
|
}
|
|
44
41
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
identifier: "label",
|
|
65
|
-
className: "wp-block-home-link__label",
|
|
66
|
-
value: label,
|
|
67
|
-
onChange: labelValue => {
|
|
68
|
-
setAttributes({
|
|
69
|
-
label: labelValue
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
"aria-label": __('Home link text'),
|
|
73
|
-
placeholder: __('Add home link'),
|
|
74
|
-
withoutInteractiveFormatting: true,
|
|
75
|
-
allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
|
|
76
|
-
})
|
|
42
|
+
return /*#__PURE__*/_jsx("div", {
|
|
43
|
+
...blockProps,
|
|
44
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
45
|
+
className: "wp-block-home-link__content wp-block-navigation-item__content",
|
|
46
|
+
href: homeUrl,
|
|
47
|
+
onClick: preventDefault,
|
|
48
|
+
children: /*#__PURE__*/_jsx(RichText, {
|
|
49
|
+
identifier: "label",
|
|
50
|
+
className: "wp-block-home-link__label",
|
|
51
|
+
value: (_attributes$label = attributes.label) !== null && _attributes$label !== void 0 ? _attributes$label : __('Home'),
|
|
52
|
+
onChange: labelValue => {
|
|
53
|
+
setAttributes({
|
|
54
|
+
label: labelValue
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
"aria-label": __('Home link text'),
|
|
58
|
+
placeholder: __('Add home link'),
|
|
59
|
+
withoutInteractiveFormatting: true,
|
|
60
|
+
allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
|
|
77
61
|
})
|
|
78
62
|
})
|
|
79
63
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","RichText","useBlockProps","
|
|
1
|
+
{"version":3,"names":["clsx","RichText","useBlockProps","__","useSelect","store","coreStore","jsx","_jsx","preventDefault","event","HomeEdit","attributes","setAttributes","context","_attributes$label","homeUrl","select","getEntityRecord","home","textColor","backgroundColor","style","blockProps","className","color","text","background","children","href","onClick","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',\n\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</a>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,aAAa,QAAQ,yBAAyB;AACjE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1D,MAAMC,cAAc,GAAKC,KAAK,IAAMA,KAAK,CAACD,cAAc,CAAC,CAAC;AAE1D,eAAe,SAASE,QAAQA,CAAE;EAAEC,UAAU;EAAEC,aAAa;EAAEC;AAAQ,CAAC,EAAG;EAAA,IAAAC,iBAAA;EAC1E,MAAMC,OAAO,GAAGZ,SAAS,CAAIa,MAAM,IAAM;IACxC;IACA,OAAOA,MAAM,CAAEX,SAAU,CAAC,CAACY,eAAe,CAAE,MAAM,EAAE,gBAAiB,CAAC,EACnEC,IAAI;EACR,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEC,SAAS;IAAEC,eAAe;IAAEC;EAAM,CAAC,GAAGR,OAAO;EACrD,MAAMS,UAAU,GAAGrB,aAAa,CAAE;IACjCsB,SAAS,EAAExB,IAAI,CAAE,0BAA0B,EAAE;MAC5C,gBAAgB,EAAE,CAAC,CAAEoB,SAAS,IAAI,CAAC,CAAEE,KAAK,EAAEG,KAAK,EAAEC,IAAI;MACvD,CAAE,OAAQN,SAAS,QAAS,GAAI,CAAC,CAAEA,SAAS;MAC5C,gBAAgB,EAAE,CAAC,CAAEC,eAAe,IAAI,CAAC,CAAEC,KAAK,EAAEG,KAAK,EAAEE,UAAU;MACnE,CAAE,OAAQN,eAAe,mBAAoB,GAAI,CAAC,CAAEA;IACrD,CAAE,CAAC;IACHC,KAAK,EAAE;MACNG,KAAK,EAAEH,KAAK,EAAEG,KAAK,EAAEC,IAAI;MACzBL,eAAe,EAAEC,KAAK,EAAEG,KAAK,EAAEE;IAChC;EACD,CAAE,CAAC;EAEH,oBACCnB,IAAA;IAAA,GAAUe,UAAU;IAAAK,QAAA,eACnBpB,IAAA;MACCgB,SAAS,EAAC,+DAA+D;MACzEK,IAAI,EAAGb,OAAS;MAChBc,OAAO,EAAGrB,cAAgB;MAAAmB,QAAA,eAE1BpB,IAAA,CAACP,QAAQ;QACR8B,UAAU,EAAC,OAAO;QAClBP,SAAS,EAAC,2BAA2B;QACrCQ,KAAK,GAAAjB,iBAAA,GAAGH,UAAU,CAACqB,KAAK,cAAAlB,iBAAA,cAAAA,iBAAA,GAAIZ,EAAE,CAAE,MAAO,CAAG;QAC1C+B,QAAQ,EAAKC,UAAU,IAAM;UAC5BtB,aAAa,CAAE;YAAEoB,KAAK,EAAEE;UAAW,CAAE,CAAC;QACvC,CAAG;QACH,cAAahC,EAAE,CAAE,gBAAiB,CAAG;QACrCiC,WAAW,EAAGjC,EAAE,CAAE,eAAgB,CAAG;QACrCkC,4BAA4B;QAC5BC,cAAc,EAAG,CAChB,WAAW,EACX,aAAa,EACb,YAAY,EACZ,oBAAoB;MAClB,CACH;IAAC,CACA;EAAC,CACA,CAAC;AAER","ignoreList":[]}
|
|
@@ -11,6 +11,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
11
11
|
|
|
12
12
|
// TODO: this util should perhaps be refactored somewhere like core-data.
|
|
13
13
|
import { createTemplatePartId } from '../template-part/edit/utils/create-template-part-id';
|
|
14
|
+
import { getTemplatePartIcon } from '../template-part/edit/utils/get-template-part-icon';
|
|
14
15
|
export default function useTemplatePartAreaLabel(clientId) {
|
|
15
16
|
return useSelect(select => {
|
|
16
17
|
// Use the lack of a clientId as an opportunity to bypass the rest
|
|
@@ -27,14 +28,11 @@ export default function useTemplatePartAreaLabel(clientId) {
|
|
|
27
28
|
if (!parentTemplatePartClientIds?.length) {
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/* eslint-disable @wordpress/data-no-store-string-literals */
|
|
36
|
-
const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
|
|
37
|
-
/* eslint-enable @wordpress/data-no-store-string-literals */
|
|
31
|
+
const defaultTemplatePartAreas = select(coreStore).getEntityRecord('root', '__unstableBase')?.default_template_part_areas || [];
|
|
32
|
+
const definedAreas = defaultTemplatePartAreas.map(item => ({
|
|
33
|
+
...item,
|
|
34
|
+
icon: getTemplatePartIcon(item.icon)
|
|
35
|
+
}));
|
|
38
36
|
const {
|
|
39
37
|
getCurrentTheme,
|
|
40
38
|
getEditedEntityRecord
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blockEditorStore","coreStore","useSelect","createTemplatePartId","useTemplatePartAreaLabel","clientId","select","getBlock","getBlockParentsByBlockName","withAscendingResults","parentTemplatePartClientIds","length","definedAreas","
|
|
1
|
+
{"version":3,"names":["store","blockEditorStore","coreStore","useSelect","createTemplatePartId","getTemplatePartIcon","useTemplatePartAreaLabel","clientId","select","getBlock","getBlockParentsByBlockName","withAscendingResults","parentTemplatePartClientIds","length","defaultTemplatePartAreas","getEntityRecord","default_template_part_areas","definedAreas","map","item","icon","getCurrentTheme","getEditedEntityRecord","templatePartClientId","templatePartBlock","theme","stylesheet","slug","attributes","templatePartEntityId","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":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;;AAEA;AACA,SAASC,oBAAoB,QAAQ,qDAAqD;AAC1F,SAASC,mBAAmB,QAAQ,oDAAoD;AAExF,eAAe,SAASC,wBAAwBA,CAAEC,QAAQ,EAAG;EAC5D,OAAOJ,SAAS,CACbK,MAAM,IAAM;IACb;IACA;IACA,IAAK,CAAED,QAAQ,EAAG;MACjB;IACD;IAEA,MAAM;MAAEE,QAAQ;MAAEC;IAA2B,CAAC,GAC7CF,MAAM,CAAEP,gBAAiB,CAAC;IAE3B,MAAMU,oBAAoB,GAAG,IAAI;IACjC,MAAMC,2BAA2B,GAAGF,0BAA0B,CAC7DH,QAAQ,EACR,oBAAoB,EACpBI,oBACD,CAAC;IAED,IAAK,CAAEC,2BAA2B,EAAEC,MAAM,EAAG;MAC5C;IACD;IAEA,MAAMC,wBAAwB,GAC7BN,MAAM,CAAEN,SAAU,CAAC,CAACa,eAAe,CAAE,MAAM,EAAE,gBAAiB,CAAC,EAC5DC,2BAA2B,IAAI,EAAE;IAErC,MAAMC,YAAY,GAAGH,wBAAwB,CAACI,GAAG,CAAIC,IAAI,KAAQ;MAChE,GAAGA,IAAI;MACPC,IAAI,EAAEf,mBAAmB,CAAEc,IAAI,CAACC,IAAK;IACtC,CAAC,CAAG,CAAC;IAEL,MAAM;MAAEC,eAAe;MAAEC;IAAsB,CAAC,GAC/Cd,MAAM,CAAEN,SAAU,CAAC;IAEpB,KAAM,MAAMqB,oBAAoB,IAAIX,2BAA2B,EAAG;MACjE,MAAMY,iBAAiB,GAAGf,QAAQ,CAAEc,oBAAqB,CAAC;;MAE1D;MACA;MACA,MAAM;QAAEE,KAAK,GAAGJ,eAAe,CAAC,CAAC,EAAEK,UAAU;QAAEC;MAAK,CAAC,GACpDH,iBAAiB,CAACI,UAAU;MAC7B,MAAMC,oBAAoB,GAAGzB,oBAAoB,CAChDqB,KAAK,EACLE,IACD,CAAC;MACD,MAAMG,kBAAkB,GAAGR,qBAAqB,CAC/C,UAAU,EACV,kBAAkB,EAClBO,oBACD,CAAC;;MAED;MACA;MACA,IAAKC,kBAAkB,EAAEC,IAAI,EAAG;QAC/B,OAAOd,YAAY,CAACe,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,CAAE3B,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
|
|
@@ -46,6 +46,20 @@ const metadata = {
|
|
|
46
46
|
},
|
|
47
47
|
interactivity: {
|
|
48
48
|
clientNavigation: true
|
|
49
|
+
},
|
|
50
|
+
__experimentalBorder: {
|
|
51
|
+
radius: true,
|
|
52
|
+
color: true,
|
|
53
|
+
width: true,
|
|
54
|
+
style: true
|
|
55
|
+
},
|
|
56
|
+
spacing: {
|
|
57
|
+
padding: true,
|
|
58
|
+
margin: true,
|
|
59
|
+
__experimentalDefaultControls: {
|
|
60
|
+
padding: false,
|
|
61
|
+
margin: false
|
|
62
|
+
}
|
|
49
63
|
}
|
|
50
64
|
},
|
|
51
65
|
editorStyle: "wp-block-page-list-editor",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["pages","initBlock","metadata","$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":["pages","initBlock","metadata","$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","edit","settings","icon","example","init"],"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":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAAC,MAAAC,QAAA;EAAAC,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;AAE5C,OAAOK,IAAI,MAAM,WAAW;AAE5B,MAAM;EAAEpC;AAAK,CAAC,GAAGH,QAAQ;AAEzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAMqC,QAAQ,GAAG;EACvBC,IAAI,EAAE3C,KAAK;EACX4C,OAAO,EAAE,CAAC,CAAC;EACXH;AACD,CAAC;AAED,OAAO,MAAMI,IAAI,GAAGA,CAAA,KAAM5C,SAAS,CAAE;EAAEI,IAAI;EAAEH,QAAQ;EAAEwC;AAAS,CAAE,CAAC","ignoreList":[]}
|
|
@@ -57,25 +57,28 @@ function DropCapControl({
|
|
|
57
57
|
} else {
|
|
58
58
|
helpText = __('Show a large initial letter.');
|
|
59
59
|
}
|
|
60
|
-
return /*#__PURE__*/_jsx(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
dropCap: undefined
|
|
65
|
-
}),
|
|
66
|
-
resetAllFilter: () => ({
|
|
67
|
-
dropCap: undefined
|
|
68
|
-
}),
|
|
69
|
-
panelId: clientId,
|
|
70
|
-
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
71
|
-
__nextHasNoMarginBottom: true,
|
|
60
|
+
return /*#__PURE__*/_jsx(InspectorControls, {
|
|
61
|
+
group: "typography",
|
|
62
|
+
children: /*#__PURE__*/_jsx(ToolsPanelItem, {
|
|
63
|
+
hasValue: () => !!dropCap,
|
|
72
64
|
label: __('Drop cap'),
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
onDeselect: () => setAttributes({
|
|
66
|
+
dropCap: undefined
|
|
67
|
+
}),
|
|
68
|
+
resetAllFilter: () => ({
|
|
69
|
+
dropCap: undefined
|
|
76
70
|
}),
|
|
77
|
-
|
|
78
|
-
|
|
71
|
+
panelId: clientId,
|
|
72
|
+
children: /*#__PURE__*/_jsx(ToggleControl, {
|
|
73
|
+
__nextHasNoMarginBottom: true,
|
|
74
|
+
label: __('Drop cap'),
|
|
75
|
+
checked: !!dropCap,
|
|
76
|
+
onChange: () => setAttributes({
|
|
77
|
+
dropCap: !dropCap
|
|
78
|
+
}),
|
|
79
|
+
help: helpText,
|
|
80
|
+
disabled: hasDropCapDisabled(align)
|
|
81
|
+
})
|
|
79
82
|
})
|
|
80
83
|
});
|
|
81
84
|
}
|
|
@@ -85,7 +88,8 @@ function ParagraphBlock({
|
|
|
85
88
|
onReplace,
|
|
86
89
|
onRemove,
|
|
87
90
|
setAttributes,
|
|
88
|
-
clientId
|
|
91
|
+
clientId,
|
|
92
|
+
isSelected: isSingleSelected
|
|
89
93
|
}) {
|
|
90
94
|
const {
|
|
91
95
|
align,
|
|
@@ -123,13 +127,10 @@ function ParagraphBlock({
|
|
|
123
127
|
direction: newDirection
|
|
124
128
|
})
|
|
125
129
|
})]
|
|
126
|
-
}), /*#__PURE__*/_jsx(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
attributes: attributes,
|
|
131
|
-
setAttributes: setAttributes
|
|
132
|
-
})
|
|
130
|
+
}), isSingleSelected && /*#__PURE__*/_jsx(DropCapControl, {
|
|
131
|
+
clientId: clientId,
|
|
132
|
+
attributes: attributes,
|
|
133
|
+
setAttributes: setAttributes
|
|
133
134
|
}), /*#__PURE__*/_jsx(RichText, {
|
|
134
135
|
identifier: "content",
|
|
135
136
|
tagName: "p",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","__","_x","isRTL","ToolbarButton","ToggleControl","__experimentalToolsPanelItem","ToolsPanelItem","AlignmentControl","BlockControls","InspectorControls","RichText","useBlockProps","useSettings","useBlockEditingMode","formatLtr","useOnEnter","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ParagraphRTLControl","direction","setDirection","icon","title","isActive","onClick","undefined","hasDropCapDisabled","align","DropCapControl","clientId","attributes","setAttributes","isDropCapFeatureEnabled","dropCap","helpText","hasValue","label","onDeselect","resetAllFilter","panelId","
|
|
1
|
+
{"version":3,"names":["clsx","__","_x","isRTL","ToolbarButton","ToggleControl","__experimentalToolsPanelItem","ToolsPanelItem","AlignmentControl","BlockControls","InspectorControls","RichText","useBlockProps","useSettings","useBlockEditingMode","formatLtr","useOnEnter","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ParagraphRTLControl","direction","setDirection","icon","title","isActive","onClick","undefined","hasDropCapDisabled","align","DropCapControl","clientId","attributes","setAttributes","isDropCapFeatureEnabled","dropCap","helpText","group","children","hasValue","label","onDeselect","resetAllFilter","panelId","__nextHasNoMarginBottom","checked","onChange","help","disabled","ParagraphBlock","mergeBlocks","onReplace","onRemove","isSelected","isSingleSelected","content","placeholder","blockProps","ref","className","style","blockEditingMode","value","newAlign","newDirection","identifier","tagName","newContent","onMerge","isEmpty","__unstableEmbedURLOnPaste","__unstableAllowPrefixTransformations"],"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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC/C,SACCC,aAAa,EACbC,aAAa,EACbC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SACCC,gBAAgB,EAChBC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACRC,aAAa,EACbC,WAAW,EACXC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,SAA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AAE,kBAAmB,CAC1B;MACD,cAAaU,QAAQ,CAAC6D,OAAO,CAAEd,OAAQ,CAAG;MAC1CC,WAAW,EAAGA,WAAW,IAAI1D,EAAE,CAAE,0BAA2B,CAAG;MAC/D,2BAA0B0D,WAAW,GAAG,IAAI,GAAG7B,SAAW;MAC1D2C,yBAAyB;MACzBC,oCAAoC;IAAA,CACpC,CAAC;EAAA,CACD,CAAC;AAEL;AAEA,eAAetB,cAAc","ignoreList":[]}
|
|
@@ -18,11 +18,9 @@ export default function EnhancedPaginationControl({
|
|
|
18
18
|
hasUnsupportedBlocks
|
|
19
19
|
} = useUnsupportedBlocks(clientId);
|
|
20
20
|
const fullPageClientSideNavigation = window.__experimentalFullPageClientSideNavigation;
|
|
21
|
-
let help = __('
|
|
21
|
+
let help = __('Reload the full page—instead of just the posts list—when visitors navigate between pages.');
|
|
22
22
|
if (fullPageClientSideNavigation) {
|
|
23
23
|
help = __('Experimental full-page client-side navigation setting enabled.');
|
|
24
|
-
} else if (enhancedPagination) {
|
|
25
|
-
help = __('Reload the full page—instead of just the posts list—when visitors navigate between pages.');
|
|
26
24
|
} else if (hasUnsupportedBlocks) {
|
|
27
25
|
help = __('Enhancement disabled because there are non-compatible blocks inside the Query block.');
|
|
28
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ToggleControl","__","useUnsupportedBlocks","jsx","_jsx","Fragment","_Fragment","EnhancedPaginationControl","enhancedPagination","setAttributes","clientId","hasUnsupportedBlocks","fullPageClientSideNavigation","window","__experimentalFullPageClientSideNavigation","help","children","__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":["ToggleControl","__","useUnsupportedBlocks","jsx","_jsx","Fragment","_Fragment","EnhancedPaginationControl","enhancedPagination","setAttributes","clientId","hasUnsupportedBlocks","fullPageClientSideNavigation","window","__experimentalFullPageClientSideNavigation","help","children","__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":"AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAEnD,eAAe,SAASC,yBAAyBA,CAAE;EAClDC,kBAAkB;EAClBC,aAAa;EACbC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC;EAAqB,CAAC,GAAGT,oBAAoB,CAAEQ,QAAS,CAAC;EACjE,MAAME,4BAA4B,GACjCC,MAAM,CAACC,0CAA0C;EAElD,IAAIC,IAAI,GAAGd,EAAE,CACZ,2FACD,CAAC;EACD,IAAKW,4BAA4B,EAAG;IACnCG,IAAI,GAAGd,EAAE,CACR,gEACD,CAAC;EACF,CAAC,MAAM,IAAKU,oBAAoB,EAAG;IAClCI,IAAI,GAAGd,EAAE,CACR,sFACD,CAAC;EACF;EAEA,oBACCG,IAAA,CAAAE,SAAA;IAAAU,QAAA,eACCZ,IAAA,CAACJ,aAAa;MACbiB,uBAAuB;MACvBC,KAAK,EAAGjB,EAAE,CAAE,kBAAmB,CAAG;MAClCc,IAAI,EAAGA,IAAM;MACbI,OAAO,EACN,CAAEX,kBAAkB,IAAI,CAAEI,4BAC1B;MACDQ,QAAQ,EACPT,oBAAoB,IAAIC,4BACxB;MACDS,QAAQ,EAAKC,KAAK,IAAM;QACvBb,aAAa,CAAE;UACdD,kBAAkB,EAAE,CAAEc;QACvB,CAAE,CAAC;MACJ;IAAG,CACH;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -5,7 +5,6 @@ import { PanelBody, TextControl, SelectControl, RangeControl, __experimentalTogg
|
|
|
5
5
|
import { useSelect } from '@wordpress/data';
|
|
6
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
9
8
|
import { debounce } from '@wordpress/compose';
|
|
10
9
|
import { useEffect, useState, useCallback } from '@wordpress/element';
|
|
11
10
|
|
|
@@ -18,17 +17,12 @@ import ParentControl from './parent-control';
|
|
|
18
17
|
import { TaxonomyControls } from './taxonomy-controls';
|
|
19
18
|
import FormatControls from './format-controls';
|
|
20
19
|
import StickyControl from './sticky-control';
|
|
21
|
-
import CreateNewPostLink from './create-new-post-link';
|
|
22
20
|
import PerPageControl from './per-page-control';
|
|
23
21
|
import OffsetControl from './offset-controls';
|
|
24
22
|
import PagesControl from './pages-control';
|
|
25
|
-
import { unlock } from '../../../lock-unlock';
|
|
26
23
|
import { usePostTypes, useIsPostTypeHierarchical, useAllowedControls, isControlAllowed, useTaxonomies } from '../../utils';
|
|
27
24
|
import { useToolsPanelDropdownMenuProps } from '../../../utils/hooks';
|
|
28
25
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
|
-
const {
|
|
30
|
-
BlockInfo
|
|
31
|
-
} = unlock(blockEditorPrivateApis);
|
|
32
26
|
export default function QueryInspectorControls(props) {
|
|
33
27
|
const {
|
|
34
28
|
attributes,
|
|
@@ -134,11 +128,7 @@ export default function QueryInspectorControls(props) {
|
|
|
134
128
|
const showPagesControl = isControlAllowed(allowedControls, 'pages');
|
|
135
129
|
const showDisplayPanel = showPostCountControl || showOffSetControl || showPagesControl;
|
|
136
130
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
137
|
-
children: [
|
|
138
|
-
children: /*#__PURE__*/_jsx(CreateNewPostLink, {
|
|
139
|
-
postType: postType
|
|
140
|
-
})
|
|
141
|
-
}), showSettingsPanel && /*#__PURE__*/_jsxs(PanelBody, {
|
|
131
|
+
children: [showSettingsPanel && /*#__PURE__*/_jsxs(PanelBody, {
|
|
142
132
|
title: __('Settings'),
|
|
143
133
|
children: [showInheritControl && /*#__PURE__*/_jsxs(ToggleGroupControl, {
|
|
144
134
|
__next40pxDefaultSize: true,
|