@wordpress/block-library 9.10.0 → 9.12.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 +4 -0
- package/README.md +10 -5
- package/build/archives/index.js +6 -0
- package/build/archives/index.js.map +1 -1
- package/build/avatar/hooks.js +2 -3
- package/build/avatar/hooks.js.map +1 -1
- package/build/button/get-updated-link-attributes.js +1 -1
- package/build/button/get-updated-link-attributes.js.map +1 -1
- package/build/button/index.js +1 -1
- package/build/button/index.js.map +1 -1
- package/build/comments/index.js +12 -0
- package/build/comments/index.js.map +1 -1
- package/build/cover/constants.js +8 -0
- package/build/cover/constants.js.map +1 -0
- package/build/cover/deprecated.js +140 -4
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +1 -1
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/cover-placeholder.js +1 -2
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +42 -21
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +40 -2
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +3 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +16 -14
- package/build/cover/save.js.map +1 -1
- package/build/details/index.js +1 -0
- package/build/details/index.js.map +1 -1
- package/build/file/edit.js +2 -3
- package/build/file/edit.js.map +1 -1
- package/build/gallery/constants.js +2 -1
- package/build/gallery/constants.js.map +1 -1
- package/build/gallery/edit.js +12 -3
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/utils.js +26 -5
- package/build/gallery/utils.js.map +1 -1
- package/build/html/edit.js +5 -1
- package/build/html/edit.js.map +1 -1
- package/build/html/preview.js +2 -2
- package/build/html/preview.js.map +1 -1
- package/build/image/edit.js +1 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +144 -78
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +1 -1
- package/build/latest-posts/edit.js +3 -9
- package/build/latest-posts/edit.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +1 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +2 -2
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/paragraph/edit.js +2 -2
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-content/index.js +13 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-featured-image/edit.js +1 -1
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-template/edit.js +11 -0
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -1
- package/build/post-time-to-read/edit.js +2 -2
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +2 -2
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/order-control.js +2 -2
- package/build/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js +0 -3
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/edit/query-content.js +10 -12
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/index.js +1 -1
- package/build/query/utils.js +32 -1
- package/build/query/utils.js.map +1 -1
- package/build/query-title/edit.js +1 -1
- package/build/query-title/edit.js.map +1 -1
- package/build/search/edit.js +19 -14
- package/build/search/edit.js.map +1 -1
- package/build/separator/transforms.js +12 -0
- package/build/separator/transforms.js.map +1 -1
- package/build/social-links/edit.js +0 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/spacer/index.js +2 -0
- package/build/spacer/index.js.map +1 -1
- package/build/spacer/transforms.js +27 -0
- package/build/spacer/transforms.js.map +1 -0
- package/build/table/edit.js +0 -1
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +2 -7
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/template-part/edit/index.js +2 -5
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +0 -3
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +1 -3
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/index.js +6 -0
- package/build-module/archives/index.js.map +1 -1
- package/build-module/avatar/hooks.js +2 -3
- package/build-module/avatar/hooks.js.map +1 -1
- package/build-module/button/get-updated-link-attributes.js +1 -1
- package/build-module/button/get-updated-link-attributes.js.map +1 -1
- package/build-module/button/index.js +1 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/comments/index.js +12 -0
- package/build-module/comments/index.js.map +1 -1
- package/build-module/cover/constants.js +2 -0
- package/build-module/cover/constants.js.map +1 -0
- package/build-module/cover/deprecated.js +140 -4
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +1 -1
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/cover-placeholder.js +1 -2
- package/build-module/cover/edit/cover-placeholder.js.map +1 -1
- package/build-module/cover/edit/index.js +42 -21
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +41 -3
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/index.js +3 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +16 -14
- package/build-module/cover/save.js.map +1 -1
- package/build-module/details/index.js +1 -0
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/edit.js +2 -3
- package/build-module/file/edit.js.map +1 -1
- package/build-module/gallery/constants.js +1 -0
- package/build-module/gallery/constants.js.map +1 -1
- package/build-module/gallery/edit.js +15 -6
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/utils.js +27 -6
- package/build-module/gallery/utils.js.map +1 -1
- package/build-module/html/edit.js +6 -2
- package/build-module/html/edit.js.map +1 -1
- package/build-module/html/preview.js +2 -2
- package/build-module/html/preview.js.map +1 -1
- package/build-module/image/edit.js +1 -1
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +149 -83
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +1 -1
- package/build-module/latest-posts/edit.js +3 -9
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +1 -3
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +2 -2
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/paragraph/edit.js +2 -2
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-content/index.js +13 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-featured-image/edit.js +1 -1
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-template/edit.js +11 -0
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -1
- package/build-module/post-time-to-read/edit.js +2 -2
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +2 -2
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/order-control.js +2 -2
- package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js +0 -3
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/edit/query-content.js +10 -12
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/index.js +1 -1
- package/build-module/query/utils.js +29 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query-title/edit.js +2 -2
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/search/edit.js +20 -15
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/transforms.js +12 -0
- package/build-module/separator/transforms.js.map +1 -1
- package/build-module/social-links/edit.js +0 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/spacer/index.js +2 -0
- package/build-module/spacer/index.js.map +1 -1
- package/build-module/spacer/transforms.js +20 -0
- package/build-module/spacer/transforms.js.map +1 -0
- package/build-module/table/edit.js +0 -1
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +2 -7
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/template-part/edit/index.js +2 -5
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +0 -3
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +2 -4
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/archives/editor-rtl.css +5 -0
- package/build-style/archives/editor.css +5 -0
- package/build-style/button/style-rtl.css +3 -0
- package/build-style/button/style.css +3 -0
- package/build-style/comments/editor-rtl.css +4 -0
- package/build-style/comments/editor.css +4 -0
- package/build-style/comments/style-rtl.css +4 -0
- package/build-style/comments/style.css +4 -0
- package/build-style/cover/editor-rtl.css +3 -5
- package/build-style/cover/editor.css +3 -5
- package/build-style/cover/style-rtl.css +19 -10
- package/build-style/cover/style.css +19 -10
- package/build-style/editor-rtl.css +17 -12
- package/build-style/editor.css +17 -12
- package/build-style/image/editor-rtl.css +4 -0
- package/build-style/image/editor.css +4 -0
- package/build-style/latest-posts/editor-rtl.css +0 -7
- package/build-style/latest-posts/editor.css +0 -7
- package/build-style/media-text/style-rtl.css +1 -1
- package/build-style/media-text/style.css +1 -1
- package/build-style/navigation/editor-rtl.css +1 -0
- package/build-style/navigation/editor.css +1 -0
- package/build-style/style-rtl.css +27 -11
- package/build-style/style.css +27 -11
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/package.json +41 -40
- package/src/archives/block.json +6 -0
- package/src/archives/editor.scss +8 -0
- package/src/avatar/hooks.js +2 -3
- package/src/avatar/index.php +4 -5
- package/src/button/get-updated-link-attributes.js +1 -1
- package/src/button/index.js +1 -1
- package/src/button/style.scss +3 -0
- package/src/button/test/get-updated-link-attributes.js +15 -0
- package/src/comment-author-avatar/index.php +1 -1
- package/src/comments/block.json +12 -0
- package/src/comments/style.scss +4 -1
- package/src/cover/block.json +3 -0
- package/src/cover/constants.js +1 -0
- package/src/cover/deprecated.js +182 -4
- package/src/cover/edit/block-controls.js +1 -1
- package/src/cover/edit/cover-placeholder.js +0 -3
- package/src/cover/edit/index.js +57 -24
- package/src/cover/edit/inspector-controls.js +46 -1
- package/src/cover/editor.scss +4 -5
- package/src/cover/save.js +29 -20
- package/src/cover/style.scss +40 -10
- package/src/cover/test/__snapshots__/edit.native.js.snap +9 -9
- package/src/cover/test/__snapshots__/transforms.native.js.snap +4 -4
- package/src/cover/test/edit.js +1 -3
- package/src/cover/test/edit.native.js +4 -4
- package/src/cover/test/transforms.native.js +4 -4
- package/src/details/block.json +1 -0
- package/src/file/edit.js +2 -3
- package/src/gallery/constants.js +1 -0
- package/src/gallery/edit.js +26 -3
- package/src/gallery/utils.js +23 -2
- package/src/html/edit.js +7 -1
- package/src/html/preview.js +3 -2
- package/src/image/block.json +1 -1
- package/src/image/edit.js +1 -1
- package/src/image/editor.scss +4 -0
- package/src/image/image.js +200 -109
- package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/latest-posts/edit.js +3 -8
- package/src/latest-posts/editor.scss +0 -11
- package/src/latest-posts/index.php +1 -1
- package/src/media-text/style.scss +1 -1
- package/src/media-text/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/navigation/edit/menu-inspector-controls.js +2 -2
- package/src/navigation/edit/navigation-menu-selector.js +2 -2
- package/src/navigation/editor.scss +1 -0
- package/src/navigation/index.php +1 -1
- package/src/paragraph/edit.js +2 -2
- package/src/post-content/block.json +14 -1
- package/src/post-featured-image/edit.js +1 -1
- package/src/post-template/block.json +2 -1
- package/src/post-template/edit.js +19 -0
- package/src/post-time-to-read/edit.js +2 -2
- package/src/post-time-to-read/index.php +1 -1
- package/src/query/block.json +1 -1
- package/src/query/edit/inspector-controls/index.js +2 -2
- package/src/query/edit/inspector-controls/order-control.js +2 -2
- package/src/query/edit/pattern-selection-modal.js +0 -3
- package/src/query/edit/query-content.js +9 -17
- package/src/query/test/utils.js +59 -1
- package/src/query/utils.js +29 -0
- package/src/query-title/edit.js +2 -2
- package/src/rss/index.php +1 -1
- package/src/search/edit.js +28 -25
- package/src/search/index.php +2 -2
- package/src/separator/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/separator/test/transforms.native.js +1 -1
- package/src/separator/transforms.js +11 -0
- package/src/social-links/edit.js +0 -1
- package/src/spacer/index.js +2 -0
- package/src/spacer/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/spacer/test/transforms.native.js +1 -1
- package/src/spacer/transforms.js +20 -0
- package/src/table/edit.js +0 -1
- package/src/table-of-contents/edit.js +2 -6
- package/src/template-part/edit/index.js +2 -5
- package/src/template-part/edit/selection-modal.js +0 -3
- package/src/video/edit.js +1 -1
- package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/video/tracks-editor.js +2 -4
- package/tsconfig.tsbuildinfo +1 -1
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_i18n","_useArchiveLabel","_jsxRuntime","SUPPORTED_TYPES","QueryTitleEdit","attributes","type","level","levelOptions","textAlign","showPrefix","showSearchTerm","setAttributes","archiveTypeLabel","archiveNameLabel","useArchiveLabel","TagName","blockProps","useBlockProps","className","clsx","includes","jsx","children","Warning","__","titleElement","title","sprintf","jsxs","Fragment","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","label","onChange","checked","BlockControls","group","HeadingLevelDropdown","value","options","newLevel","AlignmentControl","nextAlign"],"sources":["@wordpress/block-library/src/query-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tWarning,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport { ToggleControl, PanelBody } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useArchiveLabel } from './use-archive-label';\n\nconst SUPPORTED_TYPES = [ 'archive', 'search' ];\n\nexport default function QueryTitleEdit( {\n\tattributes: {\n\t\ttype,\n\t\tlevel,\n\t\tlevelOptions,\n\t\ttextAlign,\n\t\tshowPrefix,\n\t\tshowSearchTerm,\n\t},\n\tsetAttributes,\n} ) {\n\tconst { archiveTypeLabel, archiveNameLabel } = useArchiveLabel();\n\n\tconst TagName = `h${ level }`;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( 'wp-block-query-title__placeholder', {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tif ( ! SUPPORTED_TYPES.includes( type ) ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ __( 'Provided type is not supported.' ) }</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet titleElement;\n\tif ( type === 'archive' ) {\n\t\tlet title;\n\t\tif ( archiveTypeLabel ) {\n\t\t\tif ( showPrefix ) {\n\t\t\t\tif ( archiveNameLabel ) {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: 1: Archive type title e.g: \"Category\", 2: Label of the archive e.g: \"Shoes\" */\n\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_i18n","_useArchiveLabel","_jsxRuntime","SUPPORTED_TYPES","QueryTitleEdit","attributes","type","level","levelOptions","textAlign","showPrefix","showSearchTerm","setAttributes","archiveTypeLabel","archiveNameLabel","useArchiveLabel","TagName","blockProps","useBlockProps","className","clsx","includes","jsx","children","Warning","__","titleElement","title","sprintf","_x","jsxs","Fragment","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","label","onChange","checked","BlockControls","group","HeadingLevelDropdown","value","options","newLevel","AlignmentControl","nextAlign"],"sources":["@wordpress/block-library/src/query-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tWarning,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport { ToggleControl, PanelBody } from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { useArchiveLabel } from './use-archive-label';\n\nconst SUPPORTED_TYPES = [ 'archive', 'search' ];\n\nexport default function QueryTitleEdit( {\n\tattributes: {\n\t\ttype,\n\t\tlevel,\n\t\tlevelOptions,\n\t\ttextAlign,\n\t\tshowPrefix,\n\t\tshowSearchTerm,\n\t},\n\tsetAttributes,\n} ) {\n\tconst { archiveTypeLabel, archiveNameLabel } = useArchiveLabel();\n\n\tconst TagName = `h${ level }`;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( 'wp-block-query-title__placeholder', {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tif ( ! SUPPORTED_TYPES.includes( type ) ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ __( 'Provided type is not supported.' ) }</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet titleElement;\n\tif ( type === 'archive' ) {\n\t\tlet title;\n\t\tif ( archiveTypeLabel ) {\n\t\t\tif ( showPrefix ) {\n\t\t\t\tif ( archiveNameLabel ) {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: 1: Archive type title e.g: \"Category\", 2: Label of the archive e.g: \"Shoes\" */\n\t\t\t\t\t\t_x( '%1$s: %2$s', 'archive label' ),\n\t\t\t\t\t\tarchiveTypeLabel,\n\t\t\t\t\t\tarchiveNameLabel\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\ttitle = sprintf(\n\t\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t\t__( '%s: Name' ),\n\t\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if ( archiveNameLabel ) {\n\t\t\t\ttitle = archiveNameLabel;\n\t\t\t} else {\n\t\t\t\ttitle = sprintf(\n\t\t\t\t\t/* translators: %s: Archive type title e.g: \"Category\", \"Tag\"... */\n\t\t\t\t\t__( '%s name' ),\n\t\t\t\t\tarchiveTypeLabel\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\ttitle = showPrefix\n\t\t\t\t? __( 'Archive type: Name' )\n\t\t\t\t: __( 'Archive title' );\n\t\t}\n\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show archive type in title' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showPrefix: ! showPrefix } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showPrefix }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t\t<TagName { ...blockProps }>{ title }</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( type === 'search' ) {\n\t\ttitleElement = (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Show search term in title' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tshowSearchTerm: ! showSearchTerm,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ showSearchTerm }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t{ showSearchTerm\n\t\t\t\t\t\t? __( 'Search results for: “search term”' )\n\t\t\t\t\t\t: __( 'Search results' ) }\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<HeadingLevelDropdown\n\t\t\t\t\tvalue={ level }\n\t\t\t\t\toptions={ levelOptions }\n\t\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t{ titleElement }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,gBAAA,GAAAJ,OAAA;AAAsD,IAAAK,WAAA,GAAAL,OAAA;AAtBtD;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,MAAMM,eAAe,GAAG,CAAE,SAAS,EAAE,QAAQ,CAAE;AAEhC,SAASC,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
|
32
32
|
// Used to calculate border radius adjustment to avoid "fat" corners when
|
|
33
33
|
// button is placed inside wrapper.
|
|
34
34
|
const DEFAULT_INNER_PADDING = '4px';
|
|
35
|
+
const PERCENTAGE_WIDTHS = [25, 50, 75, 100];
|
|
35
36
|
function SearchEdit({
|
|
36
37
|
className,
|
|
37
38
|
attributes,
|
|
@@ -274,7 +275,7 @@ function SearchEdit({
|
|
|
274
275
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
|
|
275
276
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.ToolbarGroup, {
|
|
276
277
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
|
|
277
|
-
title: (0, _i18n.__)('
|
|
278
|
+
title: (0, _i18n.__)('Show search label'),
|
|
278
279
|
icon: _icons2.toggleLabel,
|
|
279
280
|
onClick: () => {
|
|
280
281
|
setAttributes({
|
|
@@ -326,19 +327,23 @@ function SearchEdit({
|
|
|
326
327
|
__unstableInputWidth: "80px",
|
|
327
328
|
value: `${width}${widthUnit}`,
|
|
328
329
|
units: units
|
|
329
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.
|
|
330
|
-
|
|
331
|
-
,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
330
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControl, {
|
|
331
|
+
label: (0, _i18n.__)('Percentage Width'),
|
|
332
|
+
value: PERCENTAGE_WIDTHS.includes(width) && widthUnit === '%' ? width : undefined,
|
|
333
|
+
hideLabelFromVision: true,
|
|
334
|
+
onChange: newWidth => {
|
|
335
|
+
setAttributes({
|
|
336
|
+
width: newWidth,
|
|
337
|
+
widthUnit: '%'
|
|
338
|
+
});
|
|
339
|
+
},
|
|
340
|
+
isBlock: true,
|
|
341
|
+
__next40pxDefaultSize: true,
|
|
342
|
+
__nextHasNoMarginBottom: true,
|
|
343
|
+
children: PERCENTAGE_WIDTHS.map(widthValue => {
|
|
344
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
|
|
345
|
+
value: widthValue,
|
|
346
|
+
label: `${widthValue}%`
|
|
342
347
|
}, widthValue);
|
|
343
348
|
})
|
|
344
349
|
})]
|
package/build/search/edit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_element","_components","_compose","_icons","_i18n","_dom","_icons2","_utils","_jsxRuntime","DEFAULT_INNER_PADDING","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","useSelect","select","getBlockParentsByBlockName","wasBlockJustInserted","blockEditorStore","length","__unstableMarkNextChangeAsNotPersistent","useDispatch","useEffect","borderRadius","border","radius","borderProps","useBorderProps","colorProps","useColorProps","fluidTypographySettings","layout","useSettings","typographyProps","useTypographyProps","typography","fluid","wideSize","unitControlInstanceId","useInstanceId","UnitControl","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","useRef","buttonRef","units","useCustomUnits","availableUnits","defaultValues","PC_WIDTH_DEFAULT","px","PX_WIDTH_DEFAULT","getBlockClassNames","clsx","undefined","buttonPositionControls","role","title","__","isActive","icon","buttonOutside","onClick","buttonInside","noButton","buttonOnly","getButtonPositionIcon","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","jsx","type","value","onChange","event","target","ref","renderButton","buttonClasses","__experimentalGetElementClassName","buttonStyles","handleButtonClick","jsxs","Fragment","children","stripHTML","Icon","search","RichText","identifier","withoutInteractiveFormatting","html","controls","BlockControls","ToolbarGroup","ToolbarButton","toggleLabel","ToolbarDropdownMenu","buttonWithIcon","InspectorControls","PanelBody","__experimentalVStack","spacing","__experimentalUnitControl","__next40pxDefaultSize","id","min","isPercentageUnit","MIN_WIDTH","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","ButtonGroup","map","widthValue","Button","size","variant","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","useBlockProps","labelClassnames","ResizableBox","height","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tButton,\n\tButtonGroup,\n\tToolbarButton,\n\tResizableBox,\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tbuttonOnly,\n\tbuttonOutside,\n\tbuttonInside,\n\tnoButton,\n\tbuttonWithIcon,\n\ttoggleLabel,\n} from './icons';\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst wasJustInsertedIntoNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( wasJustInsertedIntoNavigationBlock ) {\n\t\t\t// This side-effect should not create an undo level.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tshowLabel: false,\n\t\t\t\tbuttonUseIcon: true,\n\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t} );\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\twasJustInsertedIntoNavigationBlock,\n\t\tsetAttributes,\n\t] );\n\n\tconst borderRadius = style?.border?.radius;\n\tlet borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps = {\n\t\t\t...borderProps,\n\t\t\tstyle: {\n\t\t\t\t...borderProps.style,\n\t\t\t\tborderRadius: `${ borderRadius }px`,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst colorProps = useColorProps( attributes );\n\tconst [ fluidTypographySettings, layout ] = useSettings(\n\t\t'typography.fluid',\n\t\t'layout'\n\t);\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn clsx(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button outside' ),\n\t\t\tisActive: buttonPosition === 'button-outside',\n\t\t\ticon: buttonOutside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button inside' ),\n\t\t\tisActive: buttonPosition === 'button-inside',\n\t\t\ticon: buttonInside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'No button' ),\n\t\t\tisActive: buttonPosition === 'no-button',\n\t\t\ticon: noButton,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'no-button',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button only' ),\n\t\t\tisActive: buttonPosition === 'button-only',\n\t\t\ticon: buttonOnly,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-only',\n\t\t\t\t\tisSearchFieldHidden: true,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t];\n\n\tconst getButtonPositionIcon = () => {\n\t\tswitch ( buttonPosition ) {\n\t\t\tcase 'button-inside':\n\t\t\t\treturn buttonInside;\n\t\t\tcase 'button-outside':\n\t\t\t\treturn buttonOutside;\n\t\t\tcase 'no-button':\n\t\t\t\treturn noButton;\n\t\t\tcase 'button-only':\n\t\t\t\treturn buttonOnly;\n\t\t}\n\t};\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = clsx(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t\t...typographyProps.style,\n\t\t\ttextDecoration: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName={ textFieldClasses }\n\t\t\t\tstyle={ textFieldStyles }\n\t\t\t\taria-label={ __( 'Optional placeholder text' ) }\n\t\t\t\t// We hide the placeholder field's placeholder when there is a value. This\n\t\t\t\t// stops screen readers from reading the placeholder field's placeholder\n\t\t\t\t// which is confusing.\n\t\t\t\tplaceholder={\n\t\t\t\t\tplaceholder ? undefined : __( 'Optional placeholder…' )\n\t\t\t\t}\n\t\t\t\tvalue={ placeholder }\n\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\tsetAttributes( { placeholder: event.target.value } )\n\t\t\t\t}\n\t\t\t\tref={ searchFieldRef }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderButton = () => {\n\t\t// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.\n\t\tconst buttonClasses = clsx(\n\t\t\t'wp-block-search__button',\n\t\t\tcolorProps.className,\n\t\t\ttypographyProps.className,\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\tbuttonUseIcon ? 'has-icon' : undefined,\n\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t);\n\t\tconst buttonStyles = {\n\t\t\t...colorProps.style,\n\t\t\t...typographyProps.style,\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t};\n\t\tconst handleButtonClick = () => {\n\t\t\tif ( hasOnlyButton ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisSearchFieldHidden: ! isSearchFieldHidden,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ buttonUseIcon && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\tbuttonText\n\t\t\t\t\t\t\t\t? stripHTML( buttonText )\n\t\t\t\t\t\t\t\t: __( 'Search' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t\tref={ buttonRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ search } />\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\n\t\t\t\t{ ! buttonUseIcon && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"buttonText\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add button text…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ buttonText }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { buttonText: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Toggle search label' ) }\n\t\t\t\t\t\ticon={ toggleLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: ! showLabel,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName={ showLabel ? 'is-pressed' : undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\ticon={ getButtonPositionIcon() }\n\t\t\t\t\t\tlabel={ __( 'Change button position' ) }\n\t\t\t\t\t\tcontrols={ buttonPositionControls }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! hasNoButton && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ttitle={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\ticon={ buttonWithIcon }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: ! buttonUseIcon,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\tbuttonUseIcon ? 'is-pressed' : undefined\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</ToolbarGroup>\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tclassName=\"wp-block-search__inspector-controls\"\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tid={ unitControlInputId } // unused, kept for backwards compatibility\n\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 0 : MIN_WIDTH\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 100 : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\tconst parsedNewWidth =\n\t\t\t\t\t\t\t\t\tnewWidth === ''\n\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t: parseInt( newWidth, 10 );\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth: parsedNewWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\t\t\t\t\t\t\t\t\t\t? PC_WIDTH_DEFAULT\n\t\t\t\t\t\t\t\t\t\t\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ButtonGroup\n\t\t\t\t\t\t\tclassName=\"wp-block-search__components-button-group\" // unused, kept for backwards compatibility\n\t\t\t\t\t\t\taria-label={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ [ 25, 50, 75, 100 ].map( ( widthValue ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\t\t\twidthValue === width &&\n\t\t\t\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'primary'\n\t\t\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\twidth: widthValue,\n\t\t\t\t\t\t\t\t\t\t\t\twidthUnit: '%',\n\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ widthValue }%\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</ButtonGroup>\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tradius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;\n\n\tconst getWrapperStyles = () => {\n\t\tconst styles = isButtonPositionInside\n\t\t\t? borderProps.style\n\t\t\t: {\n\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\tborderTopLeftRadius: borderProps.style?.borderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t };\n\n\t\tconst isNonZeroBorderRadius =\n\t\t\tborderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;\n\n\t\tif ( isButtonPositionInside && isNonZeroBorderRadius ) {\n\t\t\t// We have button inside wrapper and a border radius value to apply.\n\t\t\t// Add default padding so we don't get \"fat\" corners.\n\t\t\t//\n\t\t\t// CSS calc() is used here to support non-pixel units. The inline\n\t\t\t// style using calc() will only apply if both values have units.\n\n\t\t\tif ( typeof borderRadius === 'object' ) {\n\t\t\t\t// Individual corner border radii present.\n\t\t\t\tconst { topLeft, topRight, bottomLeft, bottomRight } =\n\t\t\t\t\tborderRadius;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( topLeft ),\n\t\t\t\t\tborderTopRightRadius: padBorderRadius( topRight ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius( bottomLeft ),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius( bottomRight ),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// The inline style using calc() will only apply if both values\n\t\t\t// supplied to calc() have units. Deprecated block's may have\n\t\t\t// unitless integer.\n\t\t\tconst radius = Number.isInteger( borderRadius )\n\t\t\t\t? `${ borderRadius }px`\n\t\t\t\t: borderRadius;\n\n\t\t\tstyles.borderRadius = `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`;\n\t\t}\n\n\t\treturn styles;\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: getBlockClassNames(),\n\t\tstyle: {\n\t\t\t...typographyProps.style,\n\t\t\t// Input opts out of text decoration.\n\t\t\ttextDecoration: undefined,\n\t\t},\n\t} );\n\n\tconst labelClassnames = clsx(\n\t\t'wp-block-search__label',\n\t\ttypographyProps.className\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\n\t\t\t{ showLabel && (\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\tclassName={ labelClassnames }\n\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add label…' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( html ) => setAttributes( { label: html } ) }\n\t\t\t\t\tstyle={ typographyProps.style }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth:\n\t\t\t\t\t\twidth === undefined\n\t\t\t\t\t\t\t? 'auto'\n\t\t\t\t\t\t\t: `${ width }${ widthUnit }`,\n\t\t\t\t\theight: 'auto',\n\t\t\t\t} }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'wp-block-search__inside-wrapper',\n\t\t\t\t\tisButtonPositionInside ? borderProps.className : undefined\n\t\t\t\t) }\n\t\t\t\tstyle={ getWrapperStyles() }\n\t\t\t\tminWidth={ MIN_WIDTH }\n\t\t\t\tenable={ getResizableSides() }\n\t\t\t\tonResizeStart={ ( event, direction, elt ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( elt.offsetWidth, 10 ),\n\t\t\t\t\t\twidthUnit: 'px',\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( width + delta.width, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t>\n\t\t\t\t{ ( isButtonPositionInside ||\n\t\t\t\t\tisButtonPositionOutside ||\n\t\t\t\t\thasOnlyButton ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ renderTextField() }\n\t\t\t\t\t\t{ renderButton() }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ hasNoButton && renderTextField() }\n\t\t\t</ResizableBox>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAYA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAYA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GAAAR,OAAA;AAKA,IAAAS,OAAA,GAAAT,OAAA;AAQA,IAAAU,MAAA,GAAAV,OAAA;AAKoB,IAAAW,WAAA,GAAAX,OAAA;AAvDpB;AACA;AACA;;AAGA;AACA;AACA;;AAgCA;AACA;AACA;;AAgBA;AACA;AACA,MAAMY,qBAAqB,GAAG,KAAK;AAEpB,SAASC,UAAUA,CAAE;EACnCC,SAAS;EACTC,UAAU;EACVC,aAAa;EACbC,eAAe;EACfC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,KAAK;IACLC,SAAS;IACTC,WAAW;IACXC,KAAK;IACLC,SAAS;IACTC,KAAK;IACLC,UAAU;IACVC,cAAc;IACdC,aAAa;IACbC,mBAAmB;IACnBC;EACD,CAAC,GAAGf,UAAU;EAEd,MAAMgB,kCAAkC,GAAG,IAAAC,eAAS,EACjDC,MAAM,IAAM;IACb,MAAM;MAAEC,0BAA0B;MAAEC;IAA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gB,CAAC,CAAG;MAC5BkB,QAAQ,EAAGlC,gBAAW;MACtBmC,MAAM,EAAGhF,iBAAiB,CAAC,CAAG;MAC9BiF,aAAa,EAAGA,CAAEtE,KAAK,EAAEuE,SAAS,EAAEC,GAAG,KAAM;QAC5C5J,aAAa,CAAE;UACdO,KAAK,EAAEoH,QAAQ,CAAEiC,GAAG,CAACC,WAAW,EAAE,EAAG,CAAC;UACtCrJ,SAAS,EAAE;QACZ,CAAE,CAAC;QACHP,eAAe,CAAE,KAAM,CAAC;MACzB,CAAG;MACH6J,YAAY,EAAGA,CAAE1E,KAAK,EAAEuE,SAAS,EAAEC,GAAG,EAAEG,KAAK,KAAM;QAClD/J,aAAa,CAAE;UACdO,KAAK,EAAEoH,QAAQ,CAAEpH,KAAK,GAAGwJ,KAAK,CAACxJ,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACH+J,UAAU,EAAG9J,UAAY;MAAA4F,QAAA,GAEvB,CAAElD,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb,IAAApD,WAAA,CAAAiG,IAAA,EAAAjG,WAAA,CAAAkG,QAAA;QAAAC,QAAA,GACGlB,eAAe,CAAC,CAAC,EACjBW,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAECzC,WAAW,IAAI8B,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_element","_components","_compose","_icons","_i18n","_dom","_icons2","_utils","_jsxRuntime","DEFAULT_INNER_PADDING","PERCENTAGE_WIDTHS","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","useSelect","select","getBlockParentsByBlockName","wasBlockJustInserted","blockEditorStore","length","__unstableMarkNextChangeAsNotPersistent","useDispatch","useEffect","borderRadius","border","radius","borderProps","useBorderProps","colorProps","useColorProps","fluidTypographySettings","layout","useSettings","typographyProps","useTypographyProps","typography","fluid","wideSize","unitControlInstanceId","useInstanceId","UnitControl","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","useRef","buttonRef","units","useCustomUnits","availableUnits","defaultValues","PC_WIDTH_DEFAULT","px","PX_WIDTH_DEFAULT","getBlockClassNames","clsx","undefined","buttonPositionControls","role","title","__","isActive","icon","buttonOutside","onClick","buttonInside","noButton","buttonOnly","getButtonPositionIcon","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","jsx","type","value","onChange","event","target","ref","renderButton","buttonClasses","__experimentalGetElementClassName","buttonStyles","handleButtonClick","jsxs","Fragment","children","stripHTML","Icon","search","RichText","identifier","withoutInteractiveFormatting","html","controls","BlockControls","ToolbarGroup","ToolbarButton","toggleLabel","ToolbarDropdownMenu","buttonWithIcon","InspectorControls","PanelBody","__experimentalVStack","spacing","__experimentalUnitControl","__next40pxDefaultSize","id","min","isPercentageUnit","MIN_WIDTH","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","__experimentalToggleGroupControl","includes","hideLabelFromVision","isBlock","__nextHasNoMarginBottom","map","widthValue","__experimentalToggleGroupControlOption","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","useBlockProps","labelClassnames","ResizableBox","size","height","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tToolbarDropdownMenu,\n\tToolbarGroup,\n\tToolbarButton,\n\tResizableBox,\n\tPanelBody,\n\t__experimentalVStack as VStack,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tbuttonOnly,\n\tbuttonOutside,\n\tbuttonInside,\n\tnoButton,\n\tbuttonWithIcon,\n\ttoggleLabel,\n} from './icons';\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\nconst PERCENTAGE_WIDTHS = [ 25, 50, 75, 100 ];\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst wasJustInsertedIntoNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( wasJustInsertedIntoNavigationBlock ) {\n\t\t\t// This side-effect should not create an undo level.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tshowLabel: false,\n\t\t\t\tbuttonUseIcon: true,\n\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t} );\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\twasJustInsertedIntoNavigationBlock,\n\t\tsetAttributes,\n\t] );\n\n\tconst borderRadius = style?.border?.radius;\n\tlet borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps = {\n\t\t\t...borderProps,\n\t\t\tstyle: {\n\t\t\t\t...borderProps.style,\n\t\t\t\tborderRadius: `${ borderRadius }px`,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst colorProps = useColorProps( attributes );\n\tconst [ fluidTypographySettings, layout ] = useSettings(\n\t\t'typography.fluid',\n\t\t'layout'\n\t);\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn clsx(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button outside' ),\n\t\t\tisActive: buttonPosition === 'button-outside',\n\t\t\ticon: buttonOutside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button inside' ),\n\t\t\tisActive: buttonPosition === 'button-inside',\n\t\t\ticon: buttonInside,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'No button' ),\n\t\t\tisActive: buttonPosition === 'no-button',\n\t\t\ticon: noButton,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'no-button',\n\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\trole: 'menuitemradio',\n\t\t\ttitle: __( 'Button only' ),\n\t\t\tisActive: buttonPosition === 'button-only',\n\t\t\ticon: buttonOnly,\n\t\t\tonClick: () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tbuttonPosition: 'button-only',\n\t\t\t\t\tisSearchFieldHidden: true,\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t];\n\n\tconst getButtonPositionIcon = () => {\n\t\tswitch ( buttonPosition ) {\n\t\t\tcase 'button-inside':\n\t\t\t\treturn buttonInside;\n\t\t\tcase 'button-outside':\n\t\t\t\treturn buttonOutside;\n\t\t\tcase 'no-button':\n\t\t\t\treturn noButton;\n\t\t\tcase 'button-only':\n\t\t\t\treturn buttonOnly;\n\t\t}\n\t};\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = clsx(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t\t...typographyProps.style,\n\t\t\ttextDecoration: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName={ textFieldClasses }\n\t\t\t\tstyle={ textFieldStyles }\n\t\t\t\taria-label={ __( 'Optional placeholder text' ) }\n\t\t\t\t// We hide the placeholder field's placeholder when there is a value. This\n\t\t\t\t// stops screen readers from reading the placeholder field's placeholder\n\t\t\t\t// which is confusing.\n\t\t\t\tplaceholder={\n\t\t\t\t\tplaceholder ? undefined : __( 'Optional placeholder…' )\n\t\t\t\t}\n\t\t\t\tvalue={ placeholder }\n\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\tsetAttributes( { placeholder: event.target.value } )\n\t\t\t\t}\n\t\t\t\tref={ searchFieldRef }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderButton = () => {\n\t\t// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.\n\t\tconst buttonClasses = clsx(\n\t\t\t'wp-block-search__button',\n\t\t\tcolorProps.className,\n\t\t\ttypographyProps.className,\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\tbuttonUseIcon ? 'has-icon' : undefined,\n\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t);\n\t\tconst buttonStyles = {\n\t\t\t...colorProps.style,\n\t\t\t...typographyProps.style,\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t};\n\t\tconst handleButtonClick = () => {\n\t\t\tif ( hasOnlyButton ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisSearchFieldHidden: ! isSearchFieldHidden,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ buttonUseIcon && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\tbuttonText\n\t\t\t\t\t\t\t\t? stripHTML( buttonText )\n\t\t\t\t\t\t\t\t: __( 'Search' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t\tref={ buttonRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ search } />\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\n\t\t\t\t{ ! buttonUseIcon && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"buttonText\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add button text…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ buttonText }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { buttonText: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ttitle={ __( 'Show search label' ) }\n\t\t\t\t\t\ticon={ toggleLabel }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: ! showLabel,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tclassName={ showLabel ? 'is-pressed' : undefined }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\ticon={ getButtonPositionIcon() }\n\t\t\t\t\t\tlabel={ __( 'Change button position' ) }\n\t\t\t\t\t\tcontrols={ buttonPositionControls }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! hasNoButton && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ttitle={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\ticon={ buttonWithIcon }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: ! buttonUseIcon,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\tbuttonUseIcon ? 'is-pressed' : undefined\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</ToolbarGroup>\n\t\t\t</BlockControls>\n\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tclassName=\"wp-block-search__inspector-controls\"\n\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t>\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tid={ unitControlInputId } // unused, kept for backwards compatibility\n\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 0 : MIN_WIDTH\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit ) ? 100 : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\tconst parsedNewWidth =\n\t\t\t\t\t\t\t\t\tnewWidth === ''\n\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t: parseInt( newWidth, 10 );\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth: parsedNewWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\t\t\t\t\t\t\t\t\t\t? PC_WIDTH_DEFAULT\n\t\t\t\t\t\t\t\t\t\t\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\tlabel={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tPERCENTAGE_WIDTHS.includes( width ) &&\n\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t? width\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\twidth: newWidth,\n\t\t\t\t\t\t\t\t\twidthUnit: '%',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ PERCENTAGE_WIDTHS.map( ( widthValue ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\t\t\tlabel={ `${ widthValue }%` }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t</VStack>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tradius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;\n\n\tconst getWrapperStyles = () => {\n\t\tconst styles = isButtonPositionInside\n\t\t\t? borderProps.style\n\t\t\t: {\n\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\tborderTopLeftRadius: borderProps.style?.borderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t };\n\n\t\tconst isNonZeroBorderRadius =\n\t\t\tborderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;\n\n\t\tif ( isButtonPositionInside && isNonZeroBorderRadius ) {\n\t\t\t// We have button inside wrapper and a border radius value to apply.\n\t\t\t// Add default padding so we don't get \"fat\" corners.\n\t\t\t//\n\t\t\t// CSS calc() is used here to support non-pixel units. The inline\n\t\t\t// style using calc() will only apply if both values have units.\n\n\t\t\tif ( typeof borderRadius === 'object' ) {\n\t\t\t\t// Individual corner border radii present.\n\t\t\t\tconst { topLeft, topRight, bottomLeft, bottomRight } =\n\t\t\t\t\tborderRadius;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( topLeft ),\n\t\t\t\t\tborderTopRightRadius: padBorderRadius( topRight ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius( bottomLeft ),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius( bottomRight ),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// The inline style using calc() will only apply if both values\n\t\t\t// supplied to calc() have units. Deprecated block's may have\n\t\t\t// unitless integer.\n\t\t\tconst radius = Number.isInteger( borderRadius )\n\t\t\t\t? `${ borderRadius }px`\n\t\t\t\t: borderRadius;\n\n\t\t\tstyles.borderRadius = `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`;\n\t\t}\n\n\t\treturn styles;\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: getBlockClassNames(),\n\t\tstyle: {\n\t\t\t...typographyProps.style,\n\t\t\t// Input opts out of text decoration.\n\t\t\ttextDecoration: undefined,\n\t\t},\n\t} );\n\n\tconst labelClassnames = clsx(\n\t\t'wp-block-search__label',\n\t\ttypographyProps.className\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\n\t\t\t{ showLabel && (\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\tclassName={ labelClassnames }\n\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add label…' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( html ) => setAttributes( { label: html } ) }\n\t\t\t\t\tstyle={ typographyProps.style }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth:\n\t\t\t\t\t\twidth === undefined\n\t\t\t\t\t\t\t? 'auto'\n\t\t\t\t\t\t\t: `${ width }${ widthUnit }`,\n\t\t\t\t\theight: 'auto',\n\t\t\t\t} }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'wp-block-search__inside-wrapper',\n\t\t\t\t\tisButtonPositionInside ? borderProps.className : undefined\n\t\t\t\t) }\n\t\t\t\tstyle={ getWrapperStyles() }\n\t\t\t\tminWidth={ MIN_WIDTH }\n\t\t\t\tenable={ getResizableSides() }\n\t\t\t\tonResizeStart={ ( event, direction, elt ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( elt.offsetWidth, 10 ),\n\t\t\t\t\t\twidthUnit: 'px',\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( width + delta.width, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t>\n\t\t\t\t{ ( isButtonPositionInside ||\n\t\t\t\t\tisButtonPositionOutside ||\n\t\t\t\t\thasOnlyButton ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ renderTextField() }\n\t\t\t\t\t\t{ renderButton() }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ hasNoButton && renderTextField() }\n\t\t\t</ResizableBox>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAYA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,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AK,EAAE0E,SAAS,EAAEC,GAAG,EAAEG,KAAK,KAAM;QAClDlK,aAAa,CAAE;UACdO,KAAK,EAAEoH,QAAQ,CAAEpH,KAAK,GAAG2J,KAAK,CAAC3J,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACHkK,UAAU,EAAGjK,UAAY;MAAA4F,QAAA,GAEvB,CAAElD,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb,IAAArD,WAAA,CAAAkG,IAAA,EAAAlG,WAAA,CAAAmG,QAAA;QAAAC,QAAA,GACGlB,eAAe,CAAC,CAAC,EACjBW,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAECzC,WAAW,IAAI8B,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
|
|
@@ -20,6 +20,18 @@ const transforms = {
|
|
|
20
20
|
schema: {
|
|
21
21
|
hr: {}
|
|
22
22
|
}
|
|
23
|
+
}],
|
|
24
|
+
to: [{
|
|
25
|
+
type: 'block',
|
|
26
|
+
blocks: ['core/spacer'],
|
|
27
|
+
// Transform to Spacer.
|
|
28
|
+
transform: ({
|
|
29
|
+
anchor
|
|
30
|
+
}) => {
|
|
31
|
+
return (0, _blocks.createBlock)('core/spacer', {
|
|
32
|
+
anchor: anchor || ''
|
|
33
|
+
});
|
|
34
|
+
}
|
|
23
35
|
}]
|
|
24
36
|
};
|
|
25
37
|
var _default = exports.default = transforms;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","transforms","from","type","regExp","transform","createBlock","selector","schema","hr","_default","exports","default"],"sources":["@wordpress/block-library/src/separator/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'enter',\n\t\t\tregExp: /^-{3,}$/,\n\t\t\ttransform: () => createBlock( 'core/separator' ),\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'hr',\n\t\t\tschema: {\n\t\t\t\thr: {},\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,IAAI,EAAE,CACL;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,SAAS;IACjBC,SAAS,EAAEA,CAAA,KAAM,IAAAC,mBAAW,EAAE,gBAAiB;EAChD,CAAC,EACD;IACCH,IAAI,EAAE,KAAK;IACXI,QAAQ,EAAE,IAAI;IACdC,MAAM,EAAE;MACPC,EAAE,EAAE,CAAC;IACN;EACD,CAAC;AAEH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,
|
|
1
|
+
{"version":3,"names":["_blocks","require","transforms","from","type","regExp","transform","createBlock","selector","schema","hr","to","blocks","anchor","_default","exports","default"],"sources":["@wordpress/block-library/src/separator/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'enter',\n\t\t\tregExp: /^-{3,}$/,\n\t\t\ttransform: () => createBlock( 'core/separator' ),\n\t\t},\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'hr',\n\t\t\tschema: {\n\t\t\t\thr: {},\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/spacer' ], // Transform to Spacer.\n\t\t\ttransform: ( { anchor } ) => {\n\t\t\t\treturn createBlock( 'core/spacer', {\n\t\t\t\t\tanchor: anchor || '',\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,IAAI,EAAE,CACL;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,SAAS;IACjBC,SAAS,EAAEA,CAAA,KAAM,IAAAC,mBAAW,EAAE,gBAAiB;EAChD,CAAC,EACD;IACCH,IAAI,EAAE,KAAK;IACXI,QAAQ,EAAE,IAAI;IACdC,MAAM,EAAE;MACPC,EAAE,EAAE,CAAC;IACN;EACD,CAAC,CACD;EACDC,EAAE,EAAE,CACH;IACCP,IAAI,EAAE,OAAO;IACbQ,MAAM,EAAE,CAAE,aAAa,CAAE;IAAE;IAC3BN,SAAS,EAAEA,CAAE;MAAEO;IAAO,CAAC,KAAM;MAC5B,OAAO,IAAAN,mBAAW,EAAE,aAAa,EAAE;QAClCM,MAAM,EAAEA,MAAM,IAAI;MACnB,CAAE,CAAC;IACJ;EACD,CAAC;AAEH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEad,UAAU","ignoreList":[]}
|
|
@@ -79,7 +79,6 @@ function SocialLinksEdit(props) {
|
|
|
79
79
|
...backgroundBackupRef.current
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
83
82
|
}, [logosOnly]);
|
|
84
83
|
const SocialPlaceholder = /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
85
84
|
className: "wp-block-social-links__social-placeholder",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_components","_i18n","_icons","_data","_jsxRuntime","sizeOptions","name","__","value","SocialLinksEdit","props","_attributes$layout$or","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","hasSelectedChild","useSelect","select","blockEditorStore","hasSelectedInnerBlock","hasAnySelected","logosOnly","className","includes","backgroundBackupRef","useRef","useEffect","current","undefined","SocialPlaceholder","jsx","children","jsxs","clsx","color","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","placeholder","templateLock","orientation","layout","__experimentalAppenderTagName","renderAppender","InnerBlocks","ButtonBlockAppender","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","useMultipleOriginColorsAndGradients","Fragment","BlockControls","group","ToolbarDropdownMenu","text","icon","popoverProps","onClose","MenuGroup","map","entry","MenuItem","check","onClick","role","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","checked","hasColorsOrGradients","__experimentalColorGradientSettingsDropdown","__experimentalIsRenderedInSidebar","settings","onColorChange","isShownByDefault","enableAlpha","panelId","ContrastChecker","textColor","backgroundColor","isLargeText","iconColorAttributes","_default","exports","default","withColors"],"sources":["@wordpress/block-library/src/social-links/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst hasSelectedChild = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackupRef = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackupRef.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackupRef.current } );\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tplaceholder: ! isSelected && SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\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{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAYA,IAAAG,WAAA,GAAAH,OAAA;AAOA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAA4C,IAAAO,WAAA,GAAAP,OAAA;AA9B5C;AACA;AACA;;AAGA;AACA;AACA;;AAyBA,MAAMQ,WAAW,GAAG,CACnB;EAAEC,IAAI,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EAAEC,KAAK,EAAE;AAAsB,CAAC,EACrD;EAAEF,IAAI,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;EAAEC,KAAK,EAAE;AAAuB,CAAC,EACvD;EAAEF,IAAI,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EAAEC,KAAK,EAAE;AAAsB,CAAC,EACrD;EAAEF,IAAI,EAAE,IAAAC,QAAE,EAAE,MAAO,CAAC;EAAEC,KAAK,EAAE;AAAqB,CAAC,CACnD;AAEM,SAASC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5F,eAAgB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_blockEditor","_components","_i18n","_icons","_data","_jsxRuntime","sizeOptions","name","__","value","SocialLinksEdit","props","_attributes$layout$or","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","hasSelectedChild","useSelect","select","blockEditorStore","hasSelectedInnerBlock","hasAnySelected","logosOnly","className","includes","backgroundBackupRef","useRef","useEffect","current","undefined","SocialPlaceholder","jsx","children","jsxs","clsx","color","blockProps","useBlockProps","innerBlocksProps","useInnerBlocksProps","placeholder","templateLock","orientation","layout","__experimentalAppenderTagName","renderAppender","InnerBlocks","ButtonBlockAppender","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","useMultipleOriginColorsAndGradients","Fragment","BlockControls","group","ToolbarDropdownMenu","text","icon","popoverProps","onClose","MenuGroup","map","entry","MenuItem","check","onClick","role","InspectorControls","PanelBody","title","ToggleControl","__nextHasNoMarginBottom","checked","hasColorsOrGradients","__experimentalColorGradientSettingsDropdown","__experimentalIsRenderedInSidebar","settings","onColorChange","isShownByDefault","enableAlpha","panelId","ContrastChecker","textColor","backgroundColor","isLargeText","iconColorAttributes","_default","exports","default","withColors"],"sources":["@wordpress/block-library/src/social-links/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst hasSelectedChild = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackupRef = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackupRef.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackupRef.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tplaceholder: ! isSelected && SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\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{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAYA,IAAAG,WAAA,GAAAH,OAAA;AAOA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAA4C,IAAAO,WAAA,GAAAP,OAAA;AA9B5C;AACA;AACA;;AAGA;AACA;AACA;;AAyBA,MAAMQ,WAAW,GAAG,CACnB;EAAEC,IAAI,EAAE,IAAAC,QAAE,EAAE,OAAQ,CAAC;EAAEC,KAAK,EAA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D;IAAA,CACiB,CACnB,eACD,IAAAhG,WAAA,CAAAqC,GAAA;MAAA,GAASO;IAAgB,CAAI,CAAC;EAAA,CAC7B,CAAC;AAEL;AAEA,MAAMqD,mBAAmB,GAAG;EAC3BtF,SAAS,EAAE,YAAY;EACvBD,mBAAmB,EAAE;AACtB,CAAC;AAAC,IAAAwF,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,uBAAU,EAAEJ,mBAAoB,CAAC,CAAE5F,eAAgB,CAAC","ignoreList":[]}
|
package/build/spacer/index.js
CHANGED
|
@@ -9,6 +9,7 @@ var _icons = require("@wordpress/icons");
|
|
|
9
9
|
var _initBlock = _interopRequireDefault(require("../utils/init-block"));
|
|
10
10
|
var _deprecated = _interopRequireDefault(require("./deprecated"));
|
|
11
11
|
var _edit = _interopRequireDefault(require("./edit"));
|
|
12
|
+
var _transforms = _interopRequireDefault(require("./transforms"));
|
|
12
13
|
var _save = _interopRequireDefault(require("./save"));
|
|
13
14
|
/**
|
|
14
15
|
* WordPress dependencies
|
|
@@ -55,6 +56,7 @@ const {
|
|
|
55
56
|
exports.name = name;
|
|
56
57
|
const settings = exports.settings = {
|
|
57
58
|
icon: _icons.resizeCornerNE,
|
|
59
|
+
transforms: _transforms.default,
|
|
58
60
|
edit: _edit.default,
|
|
59
61
|
save: _save.default,
|
|
60
62
|
deprecated: _deprecated.default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","height","type","width","usesContext","supports","anchor","spacing","margin","__experimentalDefaultControls","interactivity","clientNavigation","editorStyle","style","settings","icon","edit","save","deprecated","init","initBlock"],"sources":["@wordpress/block-library/src/spacer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { resizeCornerNE as icon } from '@wordpress/icons';\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';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_deprecated","_edit","_transforms","_save","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","height","type","width","usesContext","supports","anchor","spacing","margin","__experimentalDefaultControls","interactivity","clientNavigation","editorStyle","style","settings","icon","transforms","edit","save","deprecated","init","initBlock"],"sources":["@wordpress/block-library/src/spacer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { resizeCornerNE as icon } from '@wordpress/icons';\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 transforms from './transforms';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,KAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAbA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,MAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,KAAA;MAAAD,IAAA;IAAA;EAAA;EAAAE,WAAA;EAAAC,QAAA;IAAAC,MAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,6BAAA;QAAAD,MAAA;MAAA;IAAA;IAAAE,aAAA;MAAAC,gBAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,KAAA;AAAA;AAUA,MAAM;EAAElB;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAInB,MAAMmB,QAAQ,GAAAtB,OAAA,CAAAsB,QAAA,GAAG;EACvBC,IAAI,EAAJA,qBAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE1B,IAAI;EAAEJ,QAAQ;EAAEuB;AAAS,CAAE,CAAC;AAACtB,OAAA,CAAA4B,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _blocks = require("@wordpress/blocks");
|
|
8
|
+
/**
|
|
9
|
+
* WordPress dependencies
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const transforms = {
|
|
13
|
+
to: [{
|
|
14
|
+
type: 'block',
|
|
15
|
+
blocks: ['core/separator'],
|
|
16
|
+
// Transform to Separator.
|
|
17
|
+
transform: ({
|
|
18
|
+
anchor
|
|
19
|
+
}) => {
|
|
20
|
+
return (0, _blocks.createBlock)('core/separator', {
|
|
21
|
+
anchor: anchor || ''
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}]
|
|
25
|
+
};
|
|
26
|
+
var _default = exports.default = transforms;
|
|
27
|
+
//# sourceMappingURL=transforms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_blocks","require","transforms","to","type","blocks","transform","anchor","createBlock","_default","exports","default"],"sources":["@wordpress/block-library/src/spacer/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/separator' ], // Transform to Separator.\n\t\t\ttransform: ( { anchor } ) => {\n\t\t\t\treturn createBlock( 'core/separator', {\n\t\t\t\t\tanchor: anchor || '',\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,EAAE,EAAE,CACH;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,gBAAgB,CAAE;IAAE;IAC9BC,SAAS,EAAEA,CAAE;MAAEC;IAAO,CAAC,KAAM;MAC5B,OAAO,IAAAC,mBAAW,EAAE,gBAAgB,EAAE;QACrCD,MAAM,EAAEA,MAAM,IAAI;MACnB,CAAE,CAAC;IACJ;EACD,CAAC;AAEH,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaT,UAAU","ignoreList":[]}
|
package/build/table/edit.js
CHANGED
|
@@ -391,7 +391,6 @@ function TableEdit({
|
|
|
391
391
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
|
|
392
392
|
group: "other",
|
|
393
393
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarDropdownMenu, {
|
|
394
|
-
hasArrowIndicator: true,
|
|
395
394
|
icon: _icons.table,
|
|
396
395
|
label: (0, _i18n.__)('Edit table'),
|
|
397
396
|
controls: tableControls
|