@wordpress/block-library 9.25.0 → 9.26.1-next.719a03cbe.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.
Files changed (179) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/avatar/edit.js +84 -39
  3. package/build/avatar/edit.js.map +1 -1
  4. package/build/avatar/user-control.js +32 -17
  5. package/build/avatar/user-control.js.map +1 -1
  6. package/build/button/edit.js +1 -1
  7. package/build/button/edit.js.map +1 -1
  8. package/build/cover/edit/inspector-controls.js +2 -2
  9. package/build/cover/edit/inspector-controls.js.map +1 -1
  10. package/build/details/index.js +1 -1
  11. package/build/details/index.js.map +1 -1
  12. package/build/embed/variations.js +0 -10
  13. package/build/embed/variations.js.map +1 -1
  14. package/build/form/edit.js +0 -1
  15. package/build/form/edit.js.map +1 -1
  16. package/build/form/index.js +3 -3
  17. package/build/form/index.js.map +1 -1
  18. package/build/form-input/index.js +2 -1
  19. package/build/form-input/index.js.map +1 -1
  20. package/build/form-submission-notification/index.js +2 -1
  21. package/build/form-submission-notification/index.js.map +1 -1
  22. package/build/form-submit-button/index.js +2 -1
  23. package/build/form-submit-button/index.js.map +1 -1
  24. package/build/gallery/constants.js +2 -1
  25. package/build/gallery/constants.js.map +1 -1
  26. package/build/gallery/edit.js +93 -15
  27. package/build/gallery/edit.js.map +1 -1
  28. package/build/image/edit.js +6 -0
  29. package/build/image/edit.js.map +1 -1
  30. package/build/image/image.js +1 -0
  31. package/build/image/image.js.map +1 -1
  32. package/build/image/view.js +0 -3
  33. package/build/image/view.js.map +1 -1
  34. package/build/list/index.js +0 -1
  35. package/build/list/index.js.map +1 -1
  36. package/build/more/edit.native.js +17 -32
  37. package/build/more/edit.native.js.map +1 -1
  38. package/build/navigation-link/edit.js +28 -1
  39. package/build/navigation-link/edit.js.map +1 -1
  40. package/build/post-author/edit.js +152 -52
  41. package/build/post-author/edit.js.map +1 -1
  42. package/build/post-comments-form/form.js +1 -1
  43. package/build/post-comments-form/form.js.map +1 -1
  44. package/build/post-featured-image/edit.js +2 -1
  45. package/build/post-featured-image/edit.js.map +1 -1
  46. package/build/post-navigation-link/edit.js +72 -33
  47. package/build/post-navigation-link/edit.js.map +1 -1
  48. package/build/search/edit.js +1 -1
  49. package/build/search/edit.js.map +1 -1
  50. package/build/site-logo/edit.js +69 -24
  51. package/build/site-logo/edit.js.map +1 -1
  52. package/build/social-link/edit.js +21 -5
  53. package/build/social-link/edit.js.map +1 -1
  54. package/build/social-link/edit.native.js +13 -5
  55. package/build/social-link/edit.native.js.map +1 -1
  56. package/build/social-link/social-list.js +17 -25
  57. package/build/social-link/social-list.js.map +1 -1
  58. package/build/social-links/edit.js +8 -5
  59. package/build/social-links/edit.js.map +1 -1
  60. package/build/video/tracks-editor.js +23 -9
  61. package/build/video/tracks-editor.js.map +1 -1
  62. package/build-module/avatar/edit.js +83 -38
  63. package/build-module/avatar/edit.js.map +1 -1
  64. package/build-module/avatar/user-control.js +33 -18
  65. package/build-module/avatar/user-control.js.map +1 -1
  66. package/build-module/button/edit.js +1 -1
  67. package/build-module/button/edit.js.map +1 -1
  68. package/build-module/cover/edit/inspector-controls.js +2 -2
  69. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  70. package/build-module/details/index.js +1 -1
  71. package/build-module/details/index.js.map +1 -1
  72. package/build-module/embed/variations.js +0 -10
  73. package/build-module/embed/variations.js.map +1 -1
  74. package/build-module/form/edit.js +0 -1
  75. package/build-module/form/edit.js.map +1 -1
  76. package/build-module/form/index.js +3 -3
  77. package/build-module/form/index.js.map +1 -1
  78. package/build-module/form-input/index.js +2 -1
  79. package/build-module/form-input/index.js.map +1 -1
  80. package/build-module/form-submission-notification/index.js +2 -1
  81. package/build-module/form-submission-notification/index.js.map +1 -1
  82. package/build-module/form-submit-button/index.js +2 -1
  83. package/build-module/form-submit-button/index.js.map +1 -1
  84. package/build-module/gallery/constants.js +1 -0
  85. package/build-module/gallery/constants.js.map +1 -1
  86. package/build-module/gallery/edit.js +95 -17
  87. package/build-module/gallery/edit.js.map +1 -1
  88. package/build-module/image/edit.js +6 -0
  89. package/build-module/image/edit.js.map +1 -1
  90. package/build-module/image/image.js +1 -0
  91. package/build-module/image/image.js.map +1 -1
  92. package/build-module/image/view.js +0 -3
  93. package/build-module/image/view.js.map +1 -1
  94. package/build-module/list/index.js +0 -1
  95. package/build-module/list/index.js.map +1 -1
  96. package/build-module/more/edit.native.js +16 -30
  97. package/build-module/more/edit.native.js.map +1 -1
  98. package/build-module/navigation-link/edit.js +29 -2
  99. package/build-module/navigation-link/edit.js.map +1 -1
  100. package/build-module/post-author/edit.js +153 -53
  101. package/build-module/post-author/edit.js.map +1 -1
  102. package/build-module/post-comments-form/form.js +1 -1
  103. package/build-module/post-comments-form/form.js.map +1 -1
  104. package/build-module/post-featured-image/edit.js +2 -1
  105. package/build-module/post-featured-image/edit.js.map +1 -1
  106. package/build-module/post-navigation-link/edit.js +73 -34
  107. package/build-module/post-navigation-link/edit.js.map +1 -1
  108. package/build-module/search/edit.js +1 -1
  109. package/build-module/search/edit.js.map +1 -1
  110. package/build-module/site-logo/edit.js +70 -25
  111. package/build-module/site-logo/edit.js.map +1 -1
  112. package/build-module/social-link/edit.js +24 -8
  113. package/build-module/social-link/edit.js.map +1 -1
  114. package/build-module/social-link/edit.native.js +15 -6
  115. package/build-module/social-link/edit.native.js.map +1 -1
  116. package/build-module/social-link/social-list.js +16 -21
  117. package/build-module/social-link/social-list.js.map +1 -1
  118. package/build-module/social-links/edit.js +8 -5
  119. package/build-module/social-links/edit.js.map +1 -1
  120. package/build-module/video/tracks-editor.js +24 -10
  121. package/build-module/video/tracks-editor.js.map +1 -1
  122. package/build-style/calendar/style-rtl.css +7 -7
  123. package/build-style/calendar/style.css +7 -7
  124. package/build-style/comments-pagination/editor-rtl.css +0 -12
  125. package/build-style/comments-pagination/editor.css +0 -14
  126. package/build-style/comments-pagination/style-rtl.css +0 -7
  127. package/build-style/comments-pagination/style.css +0 -9
  128. package/build-style/editor-rtl.css +0 -30
  129. package/build-style/editor.css +0 -32
  130. package/build-style/gallery/editor-rtl.css +0 -13
  131. package/build-style/gallery/editor.css +0 -13
  132. package/build-style/navigation/style-rtl.css +5 -0
  133. package/build-style/navigation/style.css +5 -0
  134. package/build-style/style-rtl.css +12 -14
  135. package/build-style/style.css +12 -16
  136. package/package.json +35 -35
  137. package/src/avatar/edit.js +99 -51
  138. package/src/avatar/user-control.js +34 -29
  139. package/src/button/edit.js +1 -1
  140. package/src/calendar/style.scss +10 -10
  141. package/src/comments-pagination/editor.scss +0 -15
  142. package/src/comments-pagination/style.scss +0 -8
  143. package/src/cover/edit/inspector-controls.js +1 -1
  144. package/src/details/index.js +1 -1
  145. package/src/editor.scss +0 -1
  146. package/src/embed/variations.js +0 -8
  147. package/src/form/block.json +1 -2
  148. package/src/form/edit.js +0 -1
  149. package/src/form/index.js +1 -0
  150. package/src/form-input/index.js +1 -0
  151. package/src/form-submission-notification/index.js +1 -0
  152. package/src/form-submit-button/index.js +1 -0
  153. package/src/gallery/constants.js +1 -0
  154. package/src/gallery/edit.js +182 -68
  155. package/src/gallery/editor.scss +0 -17
  156. package/src/image/edit.js +12 -0
  157. package/src/image/image.js +1 -0
  158. package/src/image/index.php +4 -1
  159. package/src/image/view.js +0 -3
  160. package/src/list/block.json +0 -1
  161. package/src/more/edit.native.js +19 -33
  162. package/src/navigation/style.scss +9 -0
  163. package/src/navigation-link/edit.js +32 -2
  164. package/src/post-author/edit.js +178 -63
  165. package/src/post-comments-form/form.js +1 -1
  166. package/src/post-featured-image/edit.js +1 -0
  167. package/src/post-navigation-link/edit.js +96 -51
  168. package/src/rss/index.php +2 -1
  169. package/src/search/edit.js +1 -1
  170. package/src/site-logo/edit.js +90 -35
  171. package/src/social-link/edit.js +18 -7
  172. package/src/social-link/edit.native.js +10 -4
  173. package/src/social-link/index.php +13 -0
  174. package/src/social-link/social-list.js +15 -20
  175. package/src/social-links/edit.js +6 -7
  176. package/src/video/tracks-editor.js +18 -6
  177. package/build-style/post-author/editor-rtl.css +0 -140
  178. package/build-style/post-author/editor.css +0 -140
  179. package/src/post-author/editor.scss +0 -7
@@ -6,11 +6,16 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, ToggleControl, SelectControl, PanelBody } from '@wordpress/components';
9
+ import { __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, ToggleControl, SelectControl } from '@wordpress/components';
10
10
  import { InspectorControls, RichText, BlockControls, AlignmentToolbar, useBlockProps, useBlockEditingMode } from '@wordpress/block-editor';
11
11
  import { __, _x } from '@wordpress/i18n';
12
12
  import { useSelect } from '@wordpress/data';
13
13
  import { store as coreStore } from '@wordpress/core-data';
14
+
15
+ /**
16
+ * Internal dependencies
17
+ */
18
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
14
19
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
15
20
  export default function PostNavigationLinkEdit({
16
21
  context: {
@@ -74,46 +79,80 @@ export default function PostNavigationLinkEdit({
74
79
  });
75
80
  return [selectOption, ...taxonomyOptions];
76
81
  };
82
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
77
83
  return /*#__PURE__*/_jsxs(_Fragment, {
78
84
  children: [/*#__PURE__*/_jsx(InspectorControls, {
79
- children: /*#__PURE__*/_jsxs(PanelBody, {
80
- children: [/*#__PURE__*/_jsx(ToggleControl, {
81
- __nextHasNoMarginBottom: true,
85
+ children: /*#__PURE__*/_jsxs(ToolsPanel, {
86
+ label: __('Settings'),
87
+ resetAll: () => {
88
+ setAttributes({
89
+ showTitle: false,
90
+ linkLabel: false,
91
+ arrow: 'none'
92
+ });
93
+ },
94
+ dropdownMenuProps: dropdownMenuProps,
95
+ children: [/*#__PURE__*/_jsx(ToolsPanelItem, {
82
96
  label: __('Display the title as a link'),
83
- help: __('If you have entered a custom label, it will be prepended before the title.'),
84
- checked: !!showTitle,
85
- onChange: () => setAttributes({
86
- showTitle: !showTitle
97
+ isShownByDefault: true,
98
+ hasValue: () => showTitle,
99
+ onDeselect: () => setAttributes({
100
+ showTitle: false
101
+ }),
102
+ children: /*#__PURE__*/_jsx(ToggleControl, {
103
+ __nextHasNoMarginBottom: true,
104
+ label: __('Display the title as a link'),
105
+ help: __('If you have entered a custom label, it will be prepended before the title.'),
106
+ checked: !!showTitle,
107
+ onChange: () => setAttributes({
108
+ showTitle: !showTitle
109
+ })
87
110
  })
88
- }), showTitle && /*#__PURE__*/_jsx(ToggleControl, {
89
- __nextHasNoMarginBottom: true,
111
+ }), showTitle && /*#__PURE__*/_jsx(ToolsPanelItem, {
90
112
  label: __('Include the label as part of the link'),
91
- checked: !!linkLabel,
92
- onChange: () => setAttributes({
93
- linkLabel: !linkLabel
113
+ isShownByDefault: true,
114
+ hasValue: () => !!linkLabel,
115
+ onDeselect: () => setAttributes({
116
+ linkLabel: false
117
+ }),
118
+ children: /*#__PURE__*/_jsx(ToggleControl, {
119
+ __nextHasNoMarginBottom: true,
120
+ label: __('Include the label as part of the link'),
121
+ checked: !!linkLabel,
122
+ onChange: () => setAttributes({
123
+ linkLabel: !linkLabel
124
+ })
94
125
  })
95
- }), /*#__PURE__*/_jsxs(ToggleGroupControl, {
96
- __next40pxDefaultSize: true,
97
- __nextHasNoMarginBottom: true,
126
+ }), /*#__PURE__*/_jsx(ToolsPanelItem, {
98
127
  label: __('Arrow'),
99
- value: arrow,
100
- onChange: value => {
101
- setAttributes({
102
- arrow: value
103
- });
104
- },
105
- help: __('A decorative arrow for the next and previous link.'),
106
- isBlock: true,
107
- children: [/*#__PURE__*/_jsx(ToggleGroupControlOption, {
108
- value: "none",
109
- label: _x('None', 'Arrow option for Next/Previous link')
110
- }), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
111
- value: "arrow",
112
- label: _x('Arrow', 'Arrow option for Next/Previous link')
113
- }), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
114
- value: "chevron",
115
- label: _x('Chevron', 'Arrow option for Next/Previous link')
116
- })]
128
+ isShownByDefault: true,
129
+ hasValue: () => arrow !== 'none',
130
+ onDeselect: () => setAttributes({
131
+ arrow: 'none'
132
+ }),
133
+ children: /*#__PURE__*/_jsxs(ToggleGroupControl, {
134
+ __next40pxDefaultSize: true,
135
+ __nextHasNoMarginBottom: true,
136
+ label: __('Arrow'),
137
+ value: arrow,
138
+ onChange: value => {
139
+ setAttributes({
140
+ arrow: value
141
+ });
142
+ },
143
+ help: __('A decorative arrow for the next and previous link.'),
144
+ isBlock: true,
145
+ children: [/*#__PURE__*/_jsx(ToggleGroupControlOption, {
146
+ value: "none",
147
+ label: _x('None', 'Arrow option for Next/Previous link')
148
+ }), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
149
+ value: "arrow",
150
+ label: _x('Arrow', 'Arrow option for Next/Previous link')
151
+ }), /*#__PURE__*/_jsx(ToggleGroupControlOption, {
152
+ value: "chevron",
153
+ label: _x('Chevron', 'Arrow option for Next/Previous link')
154
+ })]
155
+ })
117
156
  })]
118
157
  })
119
158
  }), /*#__PURE__*/_jsx(InspectorControls, {
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","ToggleControl","SelectControl","PanelBody","InspectorControls","RichText","BlockControls","AlignmentToolbar","useBlockProps","useBlockEditingMode","__","_x","useSelect","store","coreStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PostNavigationLinkEdit","context","postType","attributes","type","label","showTitle","textAlign","linkLabel","arrow","taxonomy","setAttributes","blockEditingMode","showControls","isNext","placeholder","arrowMap","none","chevron","displayArrow","ariaLabel","blockProps","className","taxonomies","select","getTaxonomies","filteredTaxonomies","per_page","getTaxonomyOptions","selectOption","value","taxonomyOptions","filter","visibility","publicly_queryable","map","item","slug","name","children","__nextHasNoMarginBottom","help","checked","onChange","__next40pxDefaultSize","isBlock","group","options","nextAlign","tagName","identifier","withoutInteractiveFormatting","newLabel","href","onClick","event","preventDefault"],"sources":["@wordpress/block-library/src/post-navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToggleControl,\n\tSelectControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tRichText,\n\tBlockControls,\n\tAlignmentToolbar,\n\tuseBlockProps,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function PostNavigationLinkEdit( {\n\tcontext: { postType },\n\tattributes: {\n\t\ttype,\n\t\tlabel,\n\t\tshowTitle,\n\t\ttextAlign,\n\t\tlinkLabel,\n\t\tarrow,\n\t\ttaxonomy,\n\t},\n\tsetAttributes,\n} ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst showControls = blockEditingMode === 'default';\n\tconst isNext = type === 'next';\n\tlet placeholder = isNext ? __( 'Next' ) : __( 'Previous' );\n\n\tconst arrowMap = {\n\t\tnone: '',\n\t\tarrow: isNext ? '→' : '←',\n\t\tchevron: isNext ? '»' : '«',\n\t};\n\n\tconst displayArrow = arrowMap[ arrow ];\n\n\tif ( showTitle ) {\n\t\tplaceholder = isNext\n\t\t\t? /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Next: ' ) // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t\t\t: /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Previous: ' ); // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t}\n\n\tconst ariaLabel = isNext ? __( 'Next post' ) : __( 'Previous post' );\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( 'Unfiltered' ),\n\t\t\tvalue: '',\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( { visibility } ) => !! visibility?.publicly_queryable )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display the title as a link' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'If you have entered a custom label, it will be prepended before the title.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tchecked={ !! showTitle }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowTitle: ! showTitle,\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{ showTitle && (\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={ __(\n\t\t\t\t\t\t\t\t'Include the label as part of the link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ !! linkLabel }\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\tlinkLabel: ! linkLabel,\n\t\t\t\t\t\t\t\t} )\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<ToggleGroupControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\t\t\t\tvalue={ arrow }\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tsetAttributes( { arrow: value } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'A decorative arrow for the next and previous link.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"none\"\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'None',\n\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"arrow\"\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'Arrow',\n\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\tvalue=\"chevron\"\n\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t'Chevron',\n\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Filter by taxonomy' ) }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttaxonomy: value,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ showControls && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<AlignmentToolbar\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ ! isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block-post-navigation-link__arrow-previous is-arrow-${ arrow }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ displayArrow }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<RichText\n\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ showTitle && (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref=\"#post-navigation-pseudo-link\"\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'An example title' ) }\n\t\t\t\t\t</a>\n\t\t\t\t) }\n\t\t\t\t{ isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block-post-navigation-link__arrow-next is-arrow-${ arrow }` }\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t{ displayArrow }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,EAClEC,aAAa,EACbC,aAAa,EACbC,SAAS,QACH,uBAAuB;AAC9B,SACCC,iBAAiB,EACjBC,QAAQ,EACRC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE1D,eAAe,SAASC,sBAAsBA,CAAE;EAC/CC,OAAO,EAAE;IAAEC;EAAS,CAAC;EACrBC,UAAU,EAAE;IACXC,IAAI;IACJC,KAAK;IACLC,SAAS;IACTC,SAAS;IACTC,SAAS;IACTC,KAAK;IACLC;EACD,CAAC;EACDC;AACD,CAAC,EAAG;EACH,MAAMC,gBAAgB,GAAGxB,mBAAmB,CAAC,CAAC;EAC9C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,YAAY,iBACzBxB,IAAA;QACC2B,SAAS,EAAG,0DAA2Db,KAAK,EAAK;QAAA8B,QAAA,EAE/EpB;MAAY,CACT,CACN,eACDxB,IAAA,CAACX,QAAQ;QACRiE,OAAO,EAAC,GAAG;QACXC,UAAU,EAAC,OAAO;QAClB,cAAa9B,SAAW;QACxBL,WAAW,EAAGA,WAAa;QAC3Be,KAAK,EAAGzB,KAAO;QACf8C,4BAA4B;QAC5BR,QAAQ,EAAKS,QAAQ,IACpBzC,aAAa,CAAE;UAAEN,KAAK,EAAE+C;QAAS,CAAE;MACnC,CACD,CAAC,EACA9C,SAAS,iBACVX,IAAA;QACC0D,IAAI,EAAC,8BAA8B;QACnCC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;QAAAjB,QAAA,EAE7ClD,EAAE,CAAE,kBAAmB;MAAC,CACxB,CACH,EACCyB,MAAM,IAAIK,YAAY,iBACvBxB,IAAA;QACC2B,SAAS,EAAG,sDAAuDb,KAAK,EAAK;QAC7E,mBAAW;QAAA8B,QAAA,EAETpB;MAAY,CACT,CACN;IAAA,CACG,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","ToggleControl","SelectControl","InspectorControls","RichText","BlockControls","AlignmentToolbar","useBlockProps","useBlockEditingMode","__","_x","useSelect","store","coreStore","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PostNavigationLinkEdit","context","postType","attributes","type","label","showTitle","textAlign","linkLabel","arrow","taxonomy","setAttributes","blockEditingMode","showControls","isNext","placeholder","arrowMap","none","chevron","displayArrow","ariaLabel","blockProps","className","taxonomies","select","getTaxonomies","filteredTaxonomies","per_page","getTaxonomyOptions","selectOption","value","taxonomyOptions","filter","visibility","publicly_queryable","map","item","slug","name","dropdownMenuProps","children","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","help","checked","onChange","__next40pxDefaultSize","isBlock","group","options","nextAlign","tagName","identifier","withoutInteractiveFormatting","newLabel","href","onClick","event","preventDefault"],"sources":["@wordpress/block-library/src/post-navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tToggleControl,\n\tSelectControl,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tRichText,\n\tBlockControls,\n\tAlignmentToolbar,\n\tuseBlockProps,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function PostNavigationLinkEdit( {\n\tcontext: { postType },\n\tattributes: {\n\t\ttype,\n\t\tlabel,\n\t\tshowTitle,\n\t\ttextAlign,\n\t\tlinkLabel,\n\t\tarrow,\n\t\ttaxonomy,\n\t},\n\tsetAttributes,\n} ) {\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst showControls = blockEditingMode === 'default';\n\tconst isNext = type === 'next';\n\tlet placeholder = isNext ? __( 'Next' ) : __( 'Previous' );\n\n\tconst arrowMap = {\n\t\tnone: '',\n\t\tarrow: isNext ? '→' : '←',\n\t\tchevron: isNext ? '»' : '«',\n\t};\n\n\tconst displayArrow = arrowMap[ arrow ];\n\n\tif ( showTitle ) {\n\t\tplaceholder = isNext\n\t\t\t? /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Next: ' ) // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t\t\t: /* translators: Label before for next and previous post. There is a space after the colon. */\n\t\t\t __( 'Previous: ' ); // eslint-disable-line @wordpress/i18n-no-flanking-whitespace\n\t}\n\n\tconst ariaLabel = isNext ? __( 'Next post' ) : __( 'Previous post' );\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst taxonomies = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getTaxonomies } = select( coreStore );\n\t\t\tconst filteredTaxonomies = getTaxonomies( {\n\t\t\t\ttype: postType,\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t\treturn filteredTaxonomies;\n\t\t},\n\t\t[ postType ]\n\t);\n\tconst getTaxonomyOptions = () => {\n\t\tconst selectOption = {\n\t\t\tlabel: __( 'Unfiltered' ),\n\t\t\tvalue: '',\n\t\t};\n\t\tconst taxonomyOptions = ( taxonomies ?? [] )\n\t\t\t.filter( ( { visibility } ) => !! visibility?.publicly_queryable )\n\t\t\t.map( ( item ) => {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: item.slug,\n\t\t\t\t\tlabel: item.name,\n\t\t\t\t};\n\t\t\t} );\n\n\t\treturn [ selectOption, ...taxonomyOptions ];\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tshowTitle: false,\n\t\t\t\t\t\t\tlinkLabel: false,\n\t\t\t\t\t\t\tarrow: 'none',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Display the title as a link' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => showTitle }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showTitle: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\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={ __( 'Display the title as a link' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'If you have entered a custom label, it will be prepended before the title.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ !! showTitle }\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\tshowTitle: ! showTitle,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ showTitle && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t'Include the label as part of the link'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! linkLabel }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { linkLabel: false } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Include the label as part of the link'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ !! linkLabel }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkLabel: ! linkLabel,\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Arrow' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => arrow !== 'none' }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { arrow: 'none' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleGroupControl\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\tlabel={ __( 'Arrow' ) }\n\t\t\t\t\t\t\tvalue={ arrow }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { arrow: value } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'A decorative arrow for the next and previous link.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"none\"\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'None',\n\t\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\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<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"arrow\"\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Arrow',\n\t\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\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<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"chevron\"\n\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t'Chevron',\n\t\t\t\t\t\t\t\t\t'Arrow option for Next/Previous link'\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</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Filter by taxonomy' ) }\n\t\t\t\t\tvalue={ taxonomy }\n\t\t\t\t\toptions={ getTaxonomyOptions() }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\ttaxonomy: value,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ showControls && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<AlignmentToolbar\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ ! isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block-post-navigation-link__arrow-previous is-arrow-${ arrow }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ displayArrow }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<RichText\n\t\t\t\t\ttagName=\"a\"\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tonChange={ ( newLabel ) =>\n\t\t\t\t\t\tsetAttributes( { label: newLabel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ showTitle && (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref=\"#post-navigation-pseudo-link\"\n\t\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'An example title' ) }\n\t\t\t\t\t</a>\n\t\t\t\t) }\n\t\t\t\t{ isNext && displayArrow && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ `wp-block-post-navigation-link__arrow-next is-arrow-${ arrow }` }\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t{ displayArrow }\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,EAClEC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,aAAa,EACbC,aAAa,QACP,uBAAuB;AAC9B,SACCC,iBAAiB,EACjBC,QAAQ,EACRC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEhE,eAAe,SAASC,sBAA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GAAUwB,UAAU;MAAAmB,QAAA,GACjB,CAAE1B,MAAM,IAAIK,YAAY,iBACzBxB,IAAA;QACC2B,SAAS,EAAG,0DAA2Db,KAAK,EAAK;QAAA+B,QAAA,EAE/ErB;MAAY,CACT,CACN,eACDxB,IAAA,CAACZ,QAAQ;QACRuE,OAAO,EAAC,GAAG;QACXC,UAAU,EAAC,OAAO;QAClB,cAAanC,SAAW;QACxBL,WAAW,EAAGA,WAAa;QAC3Be,KAAK,EAAGzB,KAAO;QACfmD,4BAA4B;QAC5BR,QAAQ,EAAKS,QAAQ,IACpB9C,aAAa,CAAE;UAAEN,KAAK,EAAEoD;QAAS,CAAE;MACnC,CACD,CAAC,EACAnD,SAAS,iBACVX,IAAA;QACC+D,IAAI,EAAC,8BAA8B;QACnCC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;QAAArB,QAAA,EAE7CpD,EAAE,CAAE,kBAAmB;MAAC,CACxB,CACH,EACC0B,MAAM,IAAIK,YAAY,iBACvBxB,IAAA;QACC2B,SAAS,EAAG,sDAAuDb,KAAK,EAAK;QAC7E,mBAAW;QAAA+B,QAAA,EAETrB;MAAY,CACT,CACN;IAAA,CACG,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
@@ -343,7 +343,7 @@ export default function SearchEdit({
343
343
  children: PERCENTAGE_WIDTHS.map(widthValue => {
344
344
  return /*#__PURE__*/_jsx(ToggleGroupControlOption, {
345
345
  value: widthValue,
346
- label: sprintf(/* translators: Percentage value. */
346
+ label: sprintf(/* translators: %d: Percentage value. */
347
347
  __('%d%%'), widthValue)
348
348
  }, widthValue);
349
349
  })
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useBlockProps","InspectorControls","RichText","__experimentalUseBorderProps","useBorderProps","__experimentalUseColorProps","useColorProps","getTypographyClassesAndStyles","useTypographyProps","store","blockEditorStore","__experimentalGetElementClassName","useSettings","useDispatch","useSelect","useEffect","useRef","SelectControl","ToggleControl","ResizableBox","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalVStack","VStack","useInstanceId","Icon","search","__","sprintf","__unstableStripHTML","stripHTML","PC_WIDTH_DEFAULT","PX_WIDTH_DEFAULT","MIN_WIDTH","isPercentageUnit","useToolsPanelDropdownMenuProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_INNER_PADDING","PERCENTAGE_WIDTHS","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","select","getBlockParentsByBlockName","wasBlockJustInserted","length","__unstableMarkNextChangeAsNotPersistent","borderRadius","border","radius","borderProps","colorProps","fluidTypographySettings","layout","typographyProps","typography","fluid","wideSize","unitControlInstanceId","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","buttonRef","units","availableUnits","defaultValues","px","getBlockClassNames","undefined","buttonPositionControls","value","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","type","onChange","event","target","ref","renderButton","buttonClasses","buttonStyles","handleButtonClick","children","onClick","icon","identifier","withoutInteractiveFormatting","html","dropdownMenuProps","controls","resetAll","hasValue","onDeselect","isShownByDefault","__nextHasNoMarginBottom","checked","__next40pxDefaultSize","options","id","min","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","includes","hideLabelFromVision","isBlock","map","widthValue","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","labelClassnames","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\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\tSelectControl,\n\tToggleControl,\n\tResizableBox,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\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\tlabel: __( 'Button outside' ),\n\t\t\tvalue: 'button-outside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button inside' ),\n\t\t\tvalue: 'button-inside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'No button' ),\n\t\t\tvalue: 'no-button',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button only' ),\n\t\t\tvalue: 'button-only',\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\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst controls = (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => ! showLabel }\n\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tchecked={ showLabel }\n\t\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tshowLabel: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => buttonPosition !== 'button-outside' }\n\t\t\t\t\t\tlabel={ __( 'Button position' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tvalue={ buttonPosition }\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\tlabel={ __( 'Button position' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonPosition: value,\n\t\t\t\t\t\t\t\t\tisSearchFieldHidden:\n\t\t\t\t\t\t\t\t\t\tvalue === 'button-only',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\toptions={ buttonPositionControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ buttonPosition !== 'no-button' && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! buttonUseIcon }\n\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tchecked={ buttonUseIcon }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tbuttonUseIcon: value,\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! width }\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\t\tid={ unitControlInputId } // Unused, kept for backwards compatibility\n\t\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t: MIN_WIDTH\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 100\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tconst parsedNewWidth =\n\t\t\t\t\t\t\t\t\t\tnewWidth === ''\n\t\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t\t: parseInt( newWidth, 10 );\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: parsedNewWidth,\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\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\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\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\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\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tPERCENTAGE_WIDTHS.includes( width ) &&\n\t\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t\t? width\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: newWidth,\n\t\t\t\t\t\t\t\t\t\twidthUnit: '%',\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\tisBlock\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ PERCENTAGE_WIDTHS.map( ( widthValue ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\t\t\twidthValue\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} ) }\n\t\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\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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G,KAAM;QAC5CrH,aAAa,CAAE;UACdO,KAAK,EAAE+E,QAAQ,CAAE+B,GAAG,CAACC,WAAW,EAAE,EAAG,CAAC;UACtC9G,SAAS,EAAE;QACZ,CAAE,CAAC;QACHP,eAAe,CAAE,KAAM,CAAC;MACzB,CAAG;MACHsH,YAAY,EAAGA,CAAE9D,KAAK,EAAE2D,SAAS,EAAEC,GAAG,EAAEG,KAAK,KAAM;QAClDxH,aAAa,CAAE;UACdO,KAAK,EAAE+E,QAAQ,CAAE/E,KAAK,GAAGiH,KAAK,CAACjH,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACHwH,UAAU,EAAGvH,UAAY;MAAA8D,QAAA,GAEvB,CAAE9B,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb3C,KAAA,CAAAF,SAAA;QAAAwE,QAAA,GACGb,eAAe,CAAC,CAAC,EACjBS,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAECxB,WAAW,IAAIe,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useBlockProps","InspectorControls","RichText","__experimentalUseBorderProps","useBorderProps","__experimentalUseColorProps","useColorProps","getTypographyClassesAndStyles","useTypographyProps","store","blockEditorStore","__experimentalGetElementClassName","useSettings","useDispatch","useSelect","useEffect","useRef","SelectControl","ToggleControl","ResizableBox","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalVStack","VStack","useInstanceId","Icon","search","__","sprintf","__unstableStripHTML","stripHTML","PC_WIDTH_DEFAULT","PX_WIDTH_DEFAULT","MIN_WIDTH","isPercentageUnit","useToolsPanelDropdownMenuProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_INNER_PADDING","PERCENTAGE_WIDTHS","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","select","getBlockParentsByBlockName","wasBlockJustInserted","length","__unstableMarkNextChangeAsNotPersistent","borderRadius","border","radius","borderProps","colorProps","fluidTypographySettings","layout","typographyProps","typography","fluid","wideSize","unitControlInstanceId","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","buttonRef","units","availableUnits","defaultValues","px","getBlockClassNames","undefined","buttonPositionControls","value","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","type","onChange","event","target","ref","renderButton","buttonClasses","buttonStyles","handleButtonClick","children","onClick","icon","identifier","withoutInteractiveFormatting","html","dropdownMenuProps","controls","resetAll","hasValue","onDeselect","isShownByDefault","__nextHasNoMarginBottom","checked","__next40pxDefaultSize","options","id","min","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","includes","hideLabelFromVision","isBlock","map","widthValue","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","labelClassnames","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\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\tSelectControl,\n\tToggleControl,\n\tResizableBox,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\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\tlabel: __( 'Button outside' ),\n\t\t\tvalue: 'button-outside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button inside' ),\n\t\t\tvalue: 'button-inside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'No button' ),\n\t\t\tvalue: 'no-button',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button only' ),\n\t\t\tvalue: 'button-only',\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\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst controls = (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => ! showLabel }\n\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tchecked={ showLabel }\n\t\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tshowLabel: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => buttonPosition !== 'button-outside' }\n\t\t\t\t\t\tlabel={ __( 'Button position' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tvalue={ buttonPosition }\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\tlabel={ __( 'Button position' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonPosition: value,\n\t\t\t\t\t\t\t\t\tisSearchFieldHidden:\n\t\t\t\t\t\t\t\t\t\tvalue === 'button-only',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\toptions={ buttonPositionControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ buttonPosition !== 'no-button' && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! buttonUseIcon }\n\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tchecked={ buttonUseIcon }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tbuttonUseIcon: value,\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</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! width }\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\t\tid={ unitControlInputId } // Unused, kept for backwards compatibility\n\t\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t: MIN_WIDTH\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 100\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tconst parsedNewWidth =\n\t\t\t\t\t\t\t\t\t\tnewWidth === ''\n\t\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t\t: parseInt( newWidth, 10 );\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: parsedNewWidth,\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\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\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\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\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\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tPERCENTAGE_WIDTHS.includes( width ) &&\n\t\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t\t? width\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: newWidth,\n\t\t\t\t\t\t\t\t\t\twidthUnit: '%',\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\tisBlock\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ PERCENTAGE_WIDTHS.map( ( widthValue ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %d: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\t\t\twidthValue\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} ) }\n\t\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\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":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACRC,4BAA4B,IAAIC,cAAc,EAC9CC,2BAA2B,IAAIC,aAAa,EAC5CC,6BAA6B,IAAIC,kBAAkB,EACnDC,KAAK,IAAIC,gBAAgB,EACzBC,iCAAiC,EACjCC,WAAW,QACL,yBAAyB;AAChC,SAASC,WAAW,EAAEC,S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E/E,KAAK,GAAGiH,KAAK,CAACjH,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACHwH,UAAU,EAAGvH,UAAY;MAAA8D,QAAA,GAEvB,CAAE9B,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb3C,KAAA,CAAAF,SAAA;QAAAwE,QAAA,GACGb,eAAe,CAAC,CAAC,EACjBS,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAECxB,WAAW,IAAIe,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
@@ -9,7 +9,7 @@ import clsx from 'clsx';
9
9
  import { isBlobURL } from '@wordpress/blob';
10
10
  import { createInterpolateElement, useEffect, useState } from '@wordpress/element';
11
11
  import { __, isRTL } from '@wordpress/i18n';
12
- import { PanelBody, RangeControl, ResizableBox, Spinner, ToggleControl, ToolbarButton, Placeholder, Button, DropZone, FlexItem, __experimentalItemGroup as ItemGroup, __experimentalHStack as HStack, __experimentalTruncate as Truncate } from '@wordpress/components';
12
+ import { RangeControl, ResizableBox, Spinner, ToggleControl, ToolbarButton, Placeholder, Button, DropZone, FlexItem, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalItemGroup as ItemGroup, __experimentalHStack as HStack, __experimentalTruncate as Truncate } from '@wordpress/components';
13
13
  import { useViewportMatch } from '@wordpress/compose';
14
14
  import { BlockControls, InspectorControls, MediaPlaceholder, MediaReplaceFlow, useBlockProps, store as blockEditorStore, __experimentalImageEditor as ImageEditor } from '@wordpress/block-editor';
15
15
  import { useSelect, useDispatch } from '@wordpress/data';
@@ -21,6 +21,7 @@ import { store as noticesStore } from '@wordpress/notices';
21
21
  * Internal dependencies
22
22
  */
23
23
  import { MIN_SIZE } from '../image/constants';
24
+ import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
24
25
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
25
26
  const ALLOWED_MEDIA_TYPES = ['image'];
26
27
  const ACCEPT_MEDIA_STRING = 'image/*';
@@ -55,6 +56,7 @@ const SiteLogo = ({
55
56
  const {
56
57
  toggleSelection
57
58
  } = useDispatch(blockEditorStore);
59
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
58
60
  const {
59
61
  imageEditing,
60
62
  maxWidth,
@@ -236,28 +238,51 @@ const SiteLogo = ({
236
238
  });
237
239
  return /*#__PURE__*/_jsxs(_Fragment, {
238
240
  children: [/*#__PURE__*/_jsx(InspectorControls, {
239
- children: /*#__PURE__*/_jsxs(PanelBody, {
240
- title: __('Settings'),
241
- children: [/*#__PURE__*/_jsx(RangeControl, {
242
- __nextHasNoMarginBottom: true,
243
- __next40pxDefaultSize: true,
241
+ children: /*#__PURE__*/_jsxs(ToolsPanel, {
242
+ label: __('Settings'),
243
+ dropdownMenuProps: dropdownMenuProps,
244
+ children: [/*#__PURE__*/_jsx(ToolsPanelItem, {
245
+ isShownByDefault: true,
246
+ hasValue: () => !!width,
244
247
  label: __('Image width'),
245
- onChange: newWidth => setAttributes({
246
- width: newWidth
248
+ onDeselect: () => setAttributes({
249
+ width: undefined
247
250
  }),
248
- min: minWidth,
249
- max: maxWidthBuffer,
250
- initialPosition: Math.min(defaultWidth, maxWidthBuffer),
251
- value: width || '',
252
- disabled: !isResizable
253
- }), /*#__PURE__*/_jsx(ToggleControl, {
254
- __nextHasNoMarginBottom: true,
251
+ children: /*#__PURE__*/_jsx(RangeControl, {
252
+ __nextHasNoMarginBottom: true,
253
+ __next40pxDefaultSize: true,
254
+ label: __('Image width'),
255
+ onChange: newWidth => setAttributes({
256
+ width: newWidth
257
+ }),
258
+ min: minWidth,
259
+ max: maxWidthBuffer,
260
+ initialPosition: Math.min(defaultWidth, maxWidthBuffer),
261
+ value: width || '',
262
+ disabled: !isResizable
263
+ })
264
+ }), /*#__PURE__*/_jsx(ToolsPanelItem, {
265
+ isShownByDefault: true,
266
+ hasValue: () => !isLink,
255
267
  label: __('Link image to home'),
256
- onChange: () => setAttributes({
257
- isLink: !isLink
268
+ onDeselect: () => setAttributes({
269
+ isLink: true
270
+ }),
271
+ children: /*#__PURE__*/_jsx(ToggleControl, {
272
+ __nextHasNoMarginBottom: true,
273
+ label: __('Link image to home'),
274
+ onChange: () => setAttributes({
275
+ isLink: !isLink
276
+ }),
277
+ checked: isLink
278
+ })
279
+ }), isLink && /*#__PURE__*/_jsx(ToolsPanelItem, {
280
+ isShownByDefault: true,
281
+ hasValue: () => linkTarget === '_blank',
282
+ label: __('Open in new tab'),
283
+ onDeselect: () => setAttributes({
284
+ linkTarget: '_self'
258
285
  }),
259
- checked: isLink
260
- }), isLink && /*#__PURE__*/_jsx(_Fragment, {
261
286
  children: /*#__PURE__*/_jsx(ToggleControl, {
262
287
  __nextHasNoMarginBottom: true,
263
288
  label: __('Open in new tab'),
@@ -266,7 +291,16 @@ const SiteLogo = ({
266
291
  }),
267
292
  checked: linkTarget === '_blank'
268
293
  })
269
- }), canUserEdit && /*#__PURE__*/_jsx(_Fragment, {
294
+ }), canUserEdit && /*#__PURE__*/_jsx(ToolsPanelItem, {
295
+ isShownByDefault: true,
296
+ hasValue: () => !!shouldSyncIcon,
297
+ label: __('Use as Site Icon'),
298
+ onDeselect: () => {
299
+ setAttributes({
300
+ shouldSyncIcon: false
301
+ });
302
+ setIcon(undefined);
303
+ },
270
304
  children: /*#__PURE__*/_jsx(ToggleControl, {
271
305
  __nextHasNoMarginBottom: true,
272
306
  label: __('Use as Site Icon'),
@@ -386,6 +420,7 @@ export default function LogoEdit({
386
420
  getSettings
387
421
  } = useSelect(blockEditorStore);
388
422
  const [temporaryURL, setTemporaryURL] = useState();
423
+ const dropdownMenuProps = useToolsPanelDropdownMenuProps();
389
424
  const {
390
425
  editEntityRecord
391
426
  } = useDispatch(coreStore);
@@ -531,17 +566,27 @@ export default function LogoEdit({
531
566
  className: classes
532
567
  });
533
568
  const mediaInspectorPanel = (canUserEdit || logoUrl) && /*#__PURE__*/_jsx(InspectorControls, {
534
- children: /*#__PURE__*/_jsx(PanelBody, {
535
- title: __('Media'),
536
- children: /*#__PURE__*/_jsx("div", {
569
+ children: /*#__PURE__*/_jsx(ToolsPanel, {
570
+ label: __('Media'),
571
+ dropdownMenuProps: dropdownMenuProps,
572
+ children: !canUserEdit ? /*#__PURE__*/_jsx("div", {
537
573
  className: "block-library-site-logo__inspector-media-replace-container",
538
- children: !canUserEdit ? /*#__PURE__*/_jsx(InspectorLogoPreview, {
574
+ style: {
575
+ gridColumn: '1 / -1'
576
+ },
577
+ children: /*#__PURE__*/_jsx(InspectorLogoPreview, {
539
578
  media: mediaItemData,
540
579
  itemGroupProps: {
541
580
  isBordered: true,
542
581
  className: 'block-library-site-logo__inspector-readonly-logo-preview'
543
582
  }
544
- }) : /*#__PURE__*/_jsxs(_Fragment, {
583
+ })
584
+ }) : /*#__PURE__*/_jsx(ToolsPanelItem, {
585
+ hasValue: () => !!logoUrl,
586
+ label: __('Logo'),
587
+ isShownByDefault: true,
588
+ children: /*#__PURE__*/_jsxs("div", {
589
+ className: "block-library-site-logo__inspector-media-replace-container",
545
590
  children: [/*#__PURE__*/_jsx(SiteLogoReplaceFlow, {
546
591
  ...mediaReplaceFlowProps,
547
592
  name: !!logoUrl ? /*#__PURE__*/_jsx(InspectorLogoPreview, {