@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
@@ -11,6 +11,7 @@ var _blockEditor = require("@wordpress/block-editor");
11
11
  var _i18n = require("@wordpress/i18n");
12
12
  var _data = require("@wordpress/data");
13
13
  var _coreData = require("@wordpress/core-data");
14
+ var _hooks = require("../utils/hooks");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  /**
16
17
  * External dependencies
@@ -20,6 +21,10 @@ var _jsxRuntime = require("react/jsx-runtime");
20
21
  * WordPress dependencies
21
22
  */
22
23
 
24
+ /**
25
+ * Internal dependencies
26
+ */
27
+
23
28
  function PostNavigationLinkEdit({
24
29
  context: {
25
30
  postType
@@ -82,46 +87,80 @@ function PostNavigationLinkEdit({
82
87
  });
83
88
  return [selectOption, ...taxonomyOptions];
84
89
  };
90
+ const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
85
91
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
86
92
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
87
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.PanelBody, {
88
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
89
- __nextHasNoMarginBottom: true,
93
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
94
+ label: (0, _i18n.__)('Settings'),
95
+ resetAll: () => {
96
+ setAttributes({
97
+ showTitle: false,
98
+ linkLabel: false,
99
+ arrow: 'none'
100
+ });
101
+ },
102
+ dropdownMenuProps: dropdownMenuProps,
103
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
90
104
  label: (0, _i18n.__)('Display the title as a link'),
91
- help: (0, _i18n.__)('If you have entered a custom label, it will be prepended before the title.'),
92
- checked: !!showTitle,
93
- onChange: () => setAttributes({
94
- showTitle: !showTitle
105
+ isShownByDefault: true,
106
+ hasValue: () => showTitle,
107
+ onDeselect: () => setAttributes({
108
+ showTitle: false
109
+ }),
110
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
111
+ __nextHasNoMarginBottom: true,
112
+ label: (0, _i18n.__)('Display the title as a link'),
113
+ help: (0, _i18n.__)('If you have entered a custom label, it will be prepended before the title.'),
114
+ checked: !!showTitle,
115
+ onChange: () => setAttributes({
116
+ showTitle: !showTitle
117
+ })
95
118
  })
96
- }), showTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
97
- __nextHasNoMarginBottom: true,
119
+ }), showTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
98
120
  label: (0, _i18n.__)('Include the label as part of the link'),
99
- checked: !!linkLabel,
100
- onChange: () => setAttributes({
101
- linkLabel: !linkLabel
121
+ isShownByDefault: true,
122
+ hasValue: () => !!linkLabel,
123
+ onDeselect: () => setAttributes({
124
+ linkLabel: false
125
+ }),
126
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
127
+ __nextHasNoMarginBottom: true,
128
+ label: (0, _i18n.__)('Include the label as part of the link'),
129
+ checked: !!linkLabel,
130
+ onChange: () => setAttributes({
131
+ linkLabel: !linkLabel
132
+ })
102
133
  })
103
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToggleGroupControl, {
104
- __next40pxDefaultSize: true,
105
- __nextHasNoMarginBottom: true,
134
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
106
135
  label: (0, _i18n.__)('Arrow'),
107
- value: arrow,
108
- onChange: value => {
109
- setAttributes({
110
- arrow: value
111
- });
112
- },
113
- help: (0, _i18n.__)('A decorative arrow for the next and previous link.'),
114
- isBlock: true,
115
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
116
- value: "none",
117
- label: (0, _i18n._x)('None', 'Arrow option for Next/Previous link')
118
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
119
- value: "arrow",
120
- label: (0, _i18n._x)('Arrow', 'Arrow option for Next/Previous link')
121
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
122
- value: "chevron",
123
- label: (0, _i18n._x)('Chevron', 'Arrow option for Next/Previous link')
124
- })]
136
+ isShownByDefault: true,
137
+ hasValue: () => arrow !== 'none',
138
+ onDeselect: () => setAttributes({
139
+ arrow: 'none'
140
+ }),
141
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToggleGroupControl, {
142
+ __next40pxDefaultSize: true,
143
+ __nextHasNoMarginBottom: true,
144
+ label: (0, _i18n.__)('Arrow'),
145
+ value: arrow,
146
+ onChange: value => {
147
+ setAttributes({
148
+ arrow: value
149
+ });
150
+ },
151
+ help: (0, _i18n.__)('A decorative arrow for the next and previous link.'),
152
+ isBlock: true,
153
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
154
+ value: "none",
155
+ label: (0, _i18n._x)('None', 'Arrow option for Next/Previous link')
156
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
157
+ value: "arrow",
158
+ label: (0, _i18n._x)('Arrow', 'Arrow option for Next/Previous link')
159
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
160
+ value: "chevron",
161
+ label: (0, _i18n._x)('Chevron', 'Arrow option for Next/Previous link')
162
+ })]
163
+ })
125
164
  })]
126
165
  })
127
166
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_blockEditor","_i18n","_data","_coreData","_jsxRuntime","PostNavigationLinkEdit","context","postType","attributes","type","label","showTitle","textAlign","linkLabel","arrow","taxonomy","setAttributes","blockEditingMode","useBlockEditingMode","showControls","isNext","placeholder","__","arrowMap","none","chevron","displayArrow","ariaLabel","blockProps","useBlockProps","className","clsx","taxonomies","useSelect","select","getTaxonomies","coreStore","filteredTaxonomies","per_page","getTaxonomyOptions","selectOption","value","taxonomyOptions","filter","visibility","publicly_queryable","map","item","slug","name","jsxs","Fragment","children","jsx","InspectorControls","PanelBody","ToggleControl","__nextHasNoMarginBottom","help","checked","onChange","__experimentalToggleGroupControl","__next40pxDefaultSize","isBlock","__experimentalToggleGroupControlOption","_x","group","SelectControl","options","BlockControls","AlignmentToolbar","nextAlign","RichText","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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,YAAA,GAAAF,OAAA;AAQA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAA0D,IAAAM,WAAA,GAAAN,OAAA;AAzB1D;AACA;AACA;;AAGA;AACA;AACA;;AAoBe,SAASO,sBAAsBA,CAAE;EAC/CC,OAAO,EAAE;IAAEC;EAAS,CAAC;EACrBC,UAAU,EAAE;IACXC,IAAI;IACJC,KAAK;IACLC,SAAS;IACTC,SAAS;IACTC,S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,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;QAAA5B,QAAA,EAE7C,IAAA9B,QAAE,EAAE,kBAAmB;MAAC,CACxB,CACH,EACCF,MAAM,IAAIM,YAAY,iBACvB,IAAAtB,WAAA,CAAAiD,GAAA;QACCvB,SAAS,EAAG,sDAAuDhB,KAAK,EAAK;QAC7E,mBAAW;QAAAsC,QAAA,EAET1B;MAAY,CACT,CACN;IAAA,CACG,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_blockEditor","_i18n","_data","_coreData","_hooks","_jsxRuntime","PostNavigationLinkEdit","context","postType","attributes","type","label","showTitle","textAlign","linkLabel","arrow","taxonomy","setAttributes","blockEditingMode","useBlockEditingMode","showControls","isNext","placeholder","__","arrowMap","none","chevron","displayArrow","ariaLabel","blockProps","useBlockProps","className","clsx","taxonomies","useSelect","select","getTaxonomies","coreStore","filteredTaxonomies","per_page","getTaxonomyOptions","selectOption","value","taxonomyOptions","filter","visibility","publicly_queryable","map","item","slug","name","dropdownMenuProps","useToolsPanelDropdownMenuProps","jsxs","Fragment","children","jsx","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","ToggleControl","__nextHasNoMarginBottom","help","checked","onChange","__experimentalToggleGroupControl","__next40pxDefaultSize","isBlock","__experimentalToggleGroupControlOption","_x","group","SelectControl","options","BlockControls","AlignmentToolbar","nextAlign","RichText","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={ `w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,CAAAgD,IAAA;MAAA,GAAUxB,UAAU;MAAA0B,QAAA,GACjB,CAAElC,MAAM,IAAIM,YAAY,iBACzB,IAAAtB,WAAA,CAAAmD,GAAA;QACCzB,SAAS,EAAG,0DAA2DhB,KAAK,EAAK;QAAAwC,QAAA,EAE/E5B;MAAY,CACT,CACN,eACD,IAAAtB,WAAA,CAAAmD,GAAA,EAACxD,YAAA,CAAAgF,QAAQ;QACRC,OAAO,EAAC,GAAG;QACXC,UAAU,EAAC,OAAO;QAClB,cAAatD,SAAW;QACxBN,WAAW,EAAGA,WAAa;QAC3BoB,KAAK,EAAG/B,KAAO;QACfwE,4BAA4B;QAC5Bf,QAAQ,EAAKgB,QAAQ,IACpBnE,aAAa,CAAE;UAAEN,KAAK,EAAEyE;QAAS,CAAE;MACnC,CACD,CAAC,EACAxE,SAAS,iBACV,IAAAP,WAAA,CAAAmD,GAAA;QACC6B,IAAI,EAAC,8BAA8B;QACnCC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;QAAAjC,QAAA,EAE7C,IAAAhC,QAAE,EAAE,kBAAmB;MAAC,CACxB,CACH,EACCF,MAAM,IAAIM,YAAY,iBACvB,IAAAtB,WAAA,CAAAmD,GAAA;QACCzB,SAAS,EAAG,sDAAuDhB,KAAK,EAAK;QAC7E,mBAAW;QAAAwC,QAAA,EAET5B;MAAY,CACT,CACN;IAAA,CACG,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
@@ -350,7 +350,7 @@ function SearchEdit({
350
350
  children: PERCENTAGE_WIDTHS.map(widthValue => {
351
351
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
352
352
  value: widthValue,
353
- label: (0, _i18n.sprintf)(/* translators: Percentage value. */
353
+ label: (0, _i18n.sprintf)(/* translators: %d: Percentage value. */
354
354
  (0, _i18n.__)('%d%%'), widthValue)
355
355
  }, widthValue);
356
356
  })
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_element","_components","_compose","_icons","_i18n","_dom","_utils","_hooks","_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","__","value","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","jsx","type","onChange","event","target","ref","renderButton","buttonClasses","__experimentalGetElementClassName","buttonStyles","handleButtonClick","jsxs","Fragment","children","stripHTML","onClick","Icon","icon","search","RichText","identifier","withoutInteractiveFormatting","html","dropdownMenuProps","useToolsPanelDropdownMenuProps","controls","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked","SelectControl","__next40pxDefaultSize","options","__experimentalVStack","__experimentalUnitControl","id","min","isPercentageUnit","MIN_WIDTH","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","__experimentalToggleGroupControl","includes","hideLabelFromVision","isBlock","map","widthValue","__experimentalToggleGroupControlOption","sprintf","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\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\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AAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_element","_components","_compose","_icons","_i18n","_dom","_utils","_hooks","_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","__","value","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","jsx","type","onChange","event","target","ref","renderButton","buttonClasses","__experimentalGetElementClassName","buttonStyles","handleButtonClick","jsxs","Fragment","children","stripHTML","onClick","Icon","icon","search","RichText","identifier","withoutInteractiveFormatting","html","dropdownMenuProps","useToolsPanelDropdownMenuProps","controls","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked","SelectControl","__next40pxDefaultSize","options","__experimentalVStack","__experimentalUnitControl","id","min","isPercentageUnit","MIN_WIDTH","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","__experimentalToggleGroupControl","includes","hideLabelFromVision","isBlock","map","widthValue","__experimentalToggleGroupControlOption","sprintf","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\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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAWA,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,MAAA,GAAAT,OAAA;AAMA,IAAAU,MAAA,GAAAV,OAAA;AAAgE,IAAAW,WAAA,GAAAX,OAAA;AA/ChE;AACA;AACA;;AAGA;AACA;AACA;;AA+BA;AACA;AACA;;AASA;AACA;AACA,MAAMY,qBAAqB,GAAG,KAAK;AACnC,MAAMC,iBAAiB,GAAG,CAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAE;AAE9B,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;IAAqB,CAAC,GACzDF,MAAM,CAAEG,kBAAiB,CAAC;IAC3B,OACC,CAAC,CAAEF,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,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAEC/B,WAAW,IAAIqB,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
@@ -17,6 +17,7 @@ var _coreData = require("@wordpress/core-data");
17
17
  var _icons = require("@wordpress/icons");
18
18
  var _notices = require("@wordpress/notices");
19
19
  var _constants = require("../image/constants");
20
+ var _hooks = require("../utils/hooks");
20
21
  var _jsxRuntime = require("react/jsx-runtime");
21
22
  /**
22
23
  * External dependencies
@@ -63,6 +64,7 @@ const SiteLogo = ({
63
64
  const {
64
65
  toggleSelection
65
66
  } = (0, _data.useDispatch)(_blockEditor.store);
67
+ const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
66
68
  const {
67
69
  imageEditing,
68
70
  maxWidth,
@@ -244,28 +246,51 @@ const SiteLogo = ({
244
246
  });
245
247
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
246
248
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
247
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.PanelBody, {
248
- title: (0, _i18n.__)('Settings'),
249
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
250
- __nextHasNoMarginBottom: true,
251
- __next40pxDefaultSize: true,
249
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
250
+ label: (0, _i18n.__)('Settings'),
251
+ dropdownMenuProps: dropdownMenuProps,
252
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
253
+ isShownByDefault: true,
254
+ hasValue: () => !!width,
252
255
  label: (0, _i18n.__)('Image width'),
253
- onChange: newWidth => setAttributes({
254
- width: newWidth
256
+ onDeselect: () => setAttributes({
257
+ width: undefined
255
258
  }),
256
- min: minWidth,
257
- max: maxWidthBuffer,
258
- initialPosition: Math.min(defaultWidth, maxWidthBuffer),
259
- value: width || '',
260
- disabled: !isResizable
261
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
262
- __nextHasNoMarginBottom: true,
259
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.RangeControl, {
260
+ __nextHasNoMarginBottom: true,
261
+ __next40pxDefaultSize: true,
262
+ label: (0, _i18n.__)('Image width'),
263
+ onChange: newWidth => setAttributes({
264
+ width: newWidth
265
+ }),
266
+ min: minWidth,
267
+ max: maxWidthBuffer,
268
+ initialPosition: Math.min(defaultWidth, maxWidthBuffer),
269
+ value: width || '',
270
+ disabled: !isResizable
271
+ })
272
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
273
+ isShownByDefault: true,
274
+ hasValue: () => !isLink,
263
275
  label: (0, _i18n.__)('Link image to home'),
264
- onChange: () => setAttributes({
265
- isLink: !isLink
276
+ onDeselect: () => setAttributes({
277
+ isLink: true
278
+ }),
279
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
280
+ __nextHasNoMarginBottom: true,
281
+ label: (0, _i18n.__)('Link image to home'),
282
+ onChange: () => setAttributes({
283
+ isLink: !isLink
284
+ }),
285
+ checked: isLink
286
+ })
287
+ }), isLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
288
+ isShownByDefault: true,
289
+ hasValue: () => linkTarget === '_blank',
290
+ label: (0, _i18n.__)('Open in new tab'),
291
+ onDeselect: () => setAttributes({
292
+ linkTarget: '_self'
266
293
  }),
267
- checked: isLink
268
- }), isLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
269
294
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
270
295
  __nextHasNoMarginBottom: true,
271
296
  label: (0, _i18n.__)('Open in new tab'),
@@ -274,7 +299,16 @@ const SiteLogo = ({
274
299
  }),
275
300
  checked: linkTarget === '_blank'
276
301
  })
277
- }), canUserEdit && /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
302
+ }), canUserEdit && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
303
+ isShownByDefault: true,
304
+ hasValue: () => !!shouldSyncIcon,
305
+ label: (0, _i18n.__)('Use as Site Icon'),
306
+ onDeselect: () => {
307
+ setAttributes({
308
+ shouldSyncIcon: false
309
+ });
310
+ setIcon(undefined);
311
+ },
278
312
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
279
313
  __nextHasNoMarginBottom: true,
280
314
  label: (0, _i18n.__)('Use as Site Icon'),
@@ -394,6 +428,7 @@ function LogoEdit({
394
428
  getSettings
395
429
  } = (0, _data.useSelect)(_blockEditor.store);
396
430
  const [temporaryURL, setTemporaryURL] = (0, _element.useState)();
431
+ const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
397
432
  const {
398
433
  editEntityRecord
399
434
  } = (0, _data.useDispatch)(_coreData.store);
@@ -539,17 +574,27 @@ function LogoEdit({
539
574
  className: classes
540
575
  });
541
576
  const mediaInspectorPanel = (canUserEdit || logoUrl) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
542
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
543
- title: (0, _i18n.__)('Media'),
544
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
577
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanel, {
578
+ label: (0, _i18n.__)('Media'),
579
+ dropdownMenuProps: dropdownMenuProps,
580
+ children: !canUserEdit ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
545
581
  className: "block-library-site-logo__inspector-media-replace-container",
546
- children: !canUserEdit ? /*#__PURE__*/(0, _jsxRuntime.jsx)(InspectorLogoPreview, {
582
+ style: {
583
+ gridColumn: '1 / -1'
584
+ },
585
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InspectorLogoPreview, {
547
586
  media: mediaItemData,
548
587
  itemGroupProps: {
549
588
  isBordered: true,
550
589
  className: 'block-library-site-logo__inspector-readonly-logo-preview'
551
590
  }
552
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
591
+ })
592
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
593
+ hasValue: () => !!logoUrl,
594
+ label: (0, _i18n.__)('Logo'),
595
+ isShownByDefault: true,
596
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
597
+ className: "block-library-site-logo__inspector-media-replace-container",
553
598
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SiteLogoReplaceFlow, {
554
599
  ...mediaReplaceFlowProps,
555
600
  name: !!logoUrl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(InspectorLogoPreview, {