@wordpress/block-library 9.29.1-next.f34ab90e9.0 → 9.30.1-next.6870dfe5b.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 (168) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/accordion/edit.js +18 -1
  3. package/build/accordion/edit.js.map +1 -1
  4. package/build/accordion/index.js +0 -3
  5. package/build/accordion/index.js.map +1 -1
  6. package/build/accordion-content/edit.js +8 -8
  7. package/build/accordion-content/edit.js.map +1 -1
  8. package/build/accordion-content/index.js +2 -5
  9. package/build/accordion-content/index.js.map +1 -1
  10. package/build/accordion-header/index.js +0 -4
  11. package/build/accordion-header/index.js.map +1 -1
  12. package/build/accordion-panel/edit.js +5 -30
  13. package/build/accordion-panel/edit.js.map +1 -1
  14. package/build/accordion-panel/index.js +2 -5
  15. package/build/accordion-panel/index.js.map +1 -1
  16. package/build/accordion-panel/save.js +3 -29
  17. package/build/accordion-panel/save.js.map +1 -1
  18. package/build/audio/edit.js +3 -1
  19. package/build/audio/edit.js.map +1 -1
  20. package/build/gallery/index.js +2 -1
  21. package/build/gallery/index.js.map +1 -1
  22. package/build/group/variations.js +0 -12
  23. package/build/group/variations.js.map +1 -1
  24. package/build/image/image.js +1 -1
  25. package/build/image/image.js.map +1 -1
  26. package/build/navigation/constants.js +5 -1
  27. package/build/navigation/constants.js.map +1 -1
  28. package/build/navigation/edit/index.js +45 -1
  29. package/build/navigation/edit/index.js.map +1 -1
  30. package/build/navigation/edit/leaf-more-menu.js +0 -1
  31. package/build/navigation/edit/leaf-more-menu.js.map +1 -1
  32. package/build/navigation/edit/menu-inspector-controls.js +40 -5
  33. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  34. package/build/navigation-link/block-inserter.js +69 -0
  35. package/build/navigation-link/block-inserter.js.map +1 -0
  36. package/build/navigation-link/dialog-wrapper.js +80 -0
  37. package/build/navigation-link/dialog-wrapper.js.map +1 -0
  38. package/build/navigation-link/link-ui.js +80 -116
  39. package/build/navigation-link/link-ui.js.map +1 -1
  40. package/build/navigation-link/page-creator.js +137 -0
  41. package/build/navigation-link/page-creator.js.map +1 -0
  42. package/build/query/edit/index.js.map +1 -1
  43. package/build/query/edit/query-content.js +7 -6
  44. package/build/query/edit/query-content.js.map +1 -1
  45. package/build/query/edit/query-placeholder.js +30 -9
  46. package/build/query/edit/query-placeholder.js.map +1 -1
  47. package/build/query/edit/query-toolbar.js +4 -2
  48. package/build/query/edit/query-toolbar.js.map +1 -1
  49. package/build/search/edit.js +22 -14
  50. package/build/search/edit.js.map +1 -1
  51. package/build/template-part/edit/placeholder.js +2 -1
  52. package/build/template-part/edit/placeholder.js.map +1 -1
  53. package/build/video/edit.js +3 -1
  54. package/build/video/edit.js.map +1 -1
  55. package/build-module/accordion/edit.js +20 -3
  56. package/build-module/accordion/edit.js.map +1 -1
  57. package/build-module/accordion/index.js +0 -3
  58. package/build-module/accordion/index.js.map +1 -1
  59. package/build-module/accordion-content/edit.js +8 -8
  60. package/build-module/accordion-content/edit.js.map +1 -1
  61. package/build-module/accordion-content/index.js +2 -5
  62. package/build-module/accordion-content/index.js.map +1 -1
  63. package/build-module/accordion-header/index.js +0 -4
  64. package/build-module/accordion-header/index.js.map +1 -1
  65. package/build-module/accordion-panel/edit.js +6 -29
  66. package/build-module/accordion-panel/edit.js.map +1 -1
  67. package/build-module/accordion-panel/index.js +2 -5
  68. package/build-module/accordion-panel/index.js.map +1 -1
  69. package/build-module/accordion-panel/save.js +4 -28
  70. package/build-module/accordion-panel/save.js.map +1 -1
  71. package/build-module/audio/edit.js +4 -2
  72. package/build-module/audio/edit.js.map +1 -1
  73. package/build-module/gallery/index.js +2 -1
  74. package/build-module/gallery/index.js.map +1 -1
  75. package/build-module/group/variations.js +0 -12
  76. package/build-module/group/variations.js.map +1 -1
  77. package/build-module/image/image.js +1 -1
  78. package/build-module/image/image.js.map +1 -1
  79. package/build-module/navigation/constants.js +5 -1
  80. package/build-module/navigation/constants.js.map +1 -1
  81. package/build-module/navigation/edit/index.js +50 -4
  82. package/build-module/navigation/edit/index.js.map +1 -1
  83. package/build-module/navigation/edit/leaf-more-menu.js +0 -1
  84. package/build-module/navigation/edit/leaf-more-menu.js.map +1 -1
  85. package/build-module/navigation/edit/menu-inspector-controls.js +40 -5
  86. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  87. package/build-module/navigation-link/block-inserter.js +61 -0
  88. package/build-module/navigation-link/block-inserter.js.map +1 -0
  89. package/build-module/navigation-link/dialog-wrapper.js +75 -0
  90. package/build-module/navigation-link/dialog-wrapper.js.map +1 -0
  91. package/build-module/navigation-link/link-ui.js +85 -121
  92. package/build-module/navigation-link/link-ui.js.map +1 -1
  93. package/build-module/navigation-link/page-creator.js +130 -0
  94. package/build-module/navigation-link/page-creator.js.map +1 -0
  95. package/build-module/query/edit/index.js.map +1 -1
  96. package/build-module/query/edit/query-content.js +8 -7
  97. package/build-module/query/edit/query-content.js.map +1 -1
  98. package/build-module/query/edit/query-placeholder.js +30 -10
  99. package/build-module/query/edit/query-placeholder.js.map +1 -1
  100. package/build-module/query/edit/query-toolbar.js +4 -2
  101. package/build-module/query/edit/query-toolbar.js.map +1 -1
  102. package/build-module/search/edit.js +22 -14
  103. package/build-module/search/edit.js.map +1 -1
  104. package/build-module/template-part/edit/placeholder.js +2 -1
  105. package/build-module/template-part/edit/placeholder.js.map +1 -1
  106. package/build-module/video/edit.js +4 -2
  107. package/build-module/video/edit.js.map +1 -1
  108. package/build-style/accordion/style-rtl.css +8 -18
  109. package/build-style/accordion/style.css +8 -18
  110. package/build-style/editor-rtl.css +18 -0
  111. package/build-style/editor.css +18 -0
  112. package/build-style/form-input/style-rtl.css +4 -3
  113. package/build-style/form-input/style.css +4 -3
  114. package/build-style/navigation-link/editor-rtl.css +14 -0
  115. package/build-style/navigation-link/editor.css +14 -0
  116. package/build-style/navigation-link/style-rtl.css +1 -1
  117. package/build-style/navigation-link/style.css +1 -1
  118. package/build-style/post-comments-form/style-rtl.css +8 -5
  119. package/build-style/post-comments-form/style.css +8 -5
  120. package/build-style/query/editor-rtl.css +4 -0
  121. package/build-style/query/editor.css +4 -0
  122. package/build-style/search/style-rtl.css +11 -12
  123. package/build-style/search/style.css +11 -12
  124. package/build-style/style-rtl.css +32 -40
  125. package/build-style/style.css +32 -40
  126. package/package.json +35 -35
  127. package/src/accordion/block.json +0 -3
  128. package/src/accordion/edit.js +20 -0
  129. package/src/accordion/style.scss +12 -21
  130. package/src/accordion-content/block.json +2 -4
  131. package/src/accordion-content/edit.js +21 -27
  132. package/src/accordion-content/index.js +0 -1
  133. package/src/accordion-header/block.json +0 -3
  134. package/src/accordion-header/index.js +0 -1
  135. package/src/accordion-panel/block.json +2 -4
  136. package/src/accordion-panel/edit.js +11 -51
  137. package/src/accordion-panel/index.js +0 -1
  138. package/src/accordion-panel/save.js +4 -45
  139. package/src/audio/edit.js +6 -1
  140. package/src/cover/test/edit.js +1 -5
  141. package/src/form-input/style.scss +3 -2
  142. package/src/gallery/block.json +2 -1
  143. package/src/gallery/index.php +1 -1
  144. package/src/gallery/test/helpers.native.js +3 -3
  145. package/src/group/variations.js +0 -12
  146. package/src/image/image.js +2 -1
  147. package/src/navigation/constants.js +4 -0
  148. package/src/navigation/edit/index.js +50 -1
  149. package/src/navigation/edit/leaf-more-menu.js +0 -1
  150. package/src/navigation/edit/menu-inspector-controls.js +40 -5
  151. package/src/navigation-link/block-inserter.js +65 -0
  152. package/src/navigation-link/dialog-wrapper.js +74 -0
  153. package/src/navigation-link/editor.scss +17 -0
  154. package/src/navigation-link/link-ui.js +108 -158
  155. package/src/navigation-link/page-creator.js +157 -0
  156. package/src/navigation-link/style.scss +1 -1
  157. package/src/post-comments-form/style.scss +11 -11
  158. package/src/post-date/index.php +2 -1
  159. package/src/query/edit/index.js +1 -0
  160. package/src/query/edit/query-content.js +8 -4
  161. package/src/query/edit/query-placeholder.js +47 -17
  162. package/src/query/edit/query-toolbar.js +10 -2
  163. package/src/query/editor.scss +6 -1
  164. package/src/search/edit.js +44 -13
  165. package/src/search/index.php +16 -2
  166. package/src/search/style.scss +15 -16
  167. package/src/template-part/edit/placeholder.js +2 -1
  168. package/src/video/edit.js +6 -1
@@ -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: %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,SAAS,QAAQ,iBAAiB;AACxD,SAASC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SACCC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,4BAA4B,IAAIC,cAAc,EAC9CC,yBAAyB,IAAIC,WAAW,EACxCC,gCAAgC,IAAIC,kBAAkB,EACtDC,sCAAsC,IAAIC,wBAAwB,EAClEC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;;AAEjE;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,gBAAgB,EA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AItC,KAAK,GAAKC,SAAS,EAAG;QAC9BwG,MAAM,EAAE;MACT,CAAG;MACHlH,SAAS,EAAGxD,IAAI,CACf,iCAAiC,EACjC4F,sBAAsB,GAAGV,WAAW,CAAC1B,SAAS,GAAG+C,SAClD,CAAG;MACH/B,KAAK,EAAGkF,gBAAgB,CAAC,CAAG;MAC5BiB,QAAQ,EAAG/H,SAAW;MACtBgI,MAAM,EAAGlE,iBAAiB,CAAC,CAAG;MAC9BmE,aAAa,EAAGA,CAAE1D,KAAK,EAAE2D,SAAS,EAAEC,GAAG,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","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","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","isNonZeroBorderRadius","padBorderRadius","getWrapperStyles","styles","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? {\n\t\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\t\tborderTopLeftRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderTopLeftRadius,\n\t\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t\t }\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? {\n\t\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\t\tborderTopLeftRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderTopLeftRadius,\n\t\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t\t }\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 isNonZeroBorderRadius = ( radius ) =>\n\t\tradius !== undefined && parseInt( radius, 10 ) !== 0;\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tisNonZeroBorderRadius( radius )\n\t\t\t? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`\n\t\t\t: 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\tif ( isButtonPositionInside ) {\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 {\n\t\t\t\t\tborderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius,\n\t\t\t\t} = borderProps.style;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( borderTopLeftRadius ),\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tpadBorderRadius( borderTopRightRadius ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius(\n\t\t\t\t\t\tborderBottomLeftRadius\n\t\t\t\t\t),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius(\n\t\t\t\t\t\tborderBottomRightRadius\n\t\t\t\t\t),\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,SAAS,QAAQ,iBAAiB;AACxD,SAASC,S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C4F,sBAAsB,GAAGV,WAAW,CAAC1B,SAAS,GAAG+C,SAClD,CAAG;MACH/B,KAAK,EAAGuF,gBAAgB,CAAC,CAAG;MAC5BQ,QAAQ,EAAG3H,SAAW;MACtB4H,MAAM,EAAG9D,iBAAiB,CAAC,CAAG;MAC9B+D,aAAa,EAAGA,CAAElD,KAAK,EAAEmD,SAAS,EAAEC,GAAG,KAAM;QAC5CjH,aAAa,CAAE;UACdO,KAAK,EAAEmF,QAAQ,CAAEuB,GAAG,CAACC,WAAW,EAAE,EAAG,CAAC;UACtC1G,SAAS,EAAE;QACZ,CAAE,CAAC;QACHP,eAAe,CAAE,KAAM,CAAC;MACzB,CAAG;MACHkH,YAAY,EAAGA,CAAEtD,KAAK,EAAEmD,SAAS,EAAEC,GAAG,EAAEG,KAAK,KAAM;QAClDpH,aAAa,CAAE;UACdO,KAAK,EAAEmF,QAAQ,CAAEnF,KAAK,GAAG6G,KAAK,CAAC7G,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACHoH,UAAU,EAAGnH,UAAY;MAAAkE,QAAA,GAEvB,CAAElC,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb3C,KAAA,CAAAF,SAAA;QAAA4E,QAAA,GACGjB,eAAe,CAAC,CAAC,EACjBa,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAEC5B,WAAW,IAAIe,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
@@ -12,6 +12,7 @@ import { store as coreStore } from '@wordpress/core-data';
12
12
  */
13
13
  import { useAlternativeBlockPatterns, useAlternativeTemplateParts, useCreateTemplatePartFromBlocks, useTemplatePartArea } from './utils/hooks';
14
14
  import TitleModal from './title-modal';
15
+ import { getTemplatePartIcon } from './utils/get-template-part-icon';
15
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
17
  export default function TemplatePartPlaceholder({
17
18
  area,
@@ -45,7 +46,7 @@ export default function TemplatePartPlaceholder({
45
46
  const areaObject = useTemplatePartArea(area);
46
47
  const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
47
48
  return /*#__PURE__*/_jsxs(Placeholder, {
48
- icon: areaObject.icon,
49
+ icon: getTemplatePartIcon(areaObject.icon),
49
50
  label: areaObject.label,
50
51
  instructions: isBlockBasedTheme ? sprintf(
51
52
  // Translators: %s as template part area title ("Header", "Footer", etc.).
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","Placeholder","Button","Spinner","useState","useSelect","store","coreStore","useAlternativeBlockPatterns","useAlternativeTemplateParts","useCreateTemplatePartFromBlocks","useTemplatePartArea","TitleModal","jsx","_jsx","jsxs","_jsxs","TemplatePartPlaceholder","area","clientId","templatePartId","onOpenSelectionModal","setAttributes","templateParts","isResolving","blockPatterns","isBlockBasedTheme","canCreateTemplatePart","select","getCurrentTheme","canUser","is_block_theme","kind","name","showTitleModal","setShowTitleModal","areaObject","createFromBlocks","icon","label","instructions","toLowerCase","children","length","__next40pxDefaultSize","variant","onClick","areaLabel","onClose","onSubmit","title"],"sources":["@wordpress/block-library/src/template-part/edit/placeholder.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Placeholder, Button, Spinner } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseAlternativeBlockPatterns,\n\tuseAlternativeTemplateParts,\n\tuseCreateTemplatePartFromBlocks,\n\tuseTemplatePartArea,\n} from './utils/hooks';\nimport TitleModal from './title-modal';\n\nexport default function TemplatePartPlaceholder( {\n\tarea,\n\tclientId,\n\ttemplatePartId,\n\tonOpenSelectionModal,\n\tsetAttributes,\n} ) {\n\tconst { templateParts, isResolving } = useAlternativeTemplateParts(\n\t\tarea,\n\t\ttemplatePartId\n\t);\n\tconst blockPatterns = useAlternativeBlockPatterns( area, clientId );\n\n\tconst { isBlockBasedTheme, canCreateTemplatePart } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentTheme, canUser } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tisBlockBasedTheme: getCurrentTheme()?.is_block_theme,\n\t\t\t\tcanCreateTemplatePart: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'wp_template_part',\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst [ showTitleModal, setShowTitleModal ] = useState( false );\n\tconst areaObject = useTemplatePartArea( area );\n\tconst createFromBlocks = useCreateTemplatePartFromBlocks(\n\t\tarea,\n\t\tsetAttributes\n\t);\n\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ areaObject.icon }\n\t\t\tlabel={ areaObject.label }\n\t\t\tinstructions={\n\t\t\t\tisBlockBasedTheme\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t__( 'Choose an existing %s or create a new one.' ),\n\t\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t__( 'Choose an existing %s.' ),\n\t\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t )\n\t\t\t}\n\t\t>\n\t\t\t{ isResolving && <Spinner /> }\n\n\t\t\t{ ! isResolving &&\n\t\t\t\t!! ( templateParts.length || blockPatterns.length ) && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ onOpenSelectionModal }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Choose' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\n\t\t\t{ ! isResolving && isBlockBasedTheme && canCreateTemplatePart && (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetShowTitleModal( true );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Start blank' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ showTitleModal && (\n\t\t\t\t<TitleModal\n\t\t\t\t\tareaLabel={ areaObject.label }\n\t\t\t\t\tonClose={ () => setShowTitleModal( false ) }\n\t\t\t\t\tonSubmit={ ( title ) => {\n\t\t\t\t\t\tcreateFromBlocks( [], title );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</Placeholder>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,EAAEC,MAAM,EAAEC,OAAO,QAAQ,uBAAuB;AACpE,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SACCC,2BAA2B,EAC3BC,2BAA2B,EAC3BC,+BAA+B,EAC/BC,mBAAmB,QACb,eAAe;AACtB,OAAOC,UAAU,MAAM,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEvC,eAAe,SAASC,uBAAuBA,CAAE;EAChDC,IAAI;EACJC,QAAQ;EACRC,cAAc;EACdC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,aAAa;IAAEC;EAAY,CAAC,GAAGf,2BAA2B,CACjES,IAAI,EACJE,cACD,CAAC;EACD,MAAMK,aAAa,GAAGjB,2BAA2B,CAAEU,IAAI,EAAEC,QAAS,CAAC;EAEnE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ACT,CACR,EAEA,CAAEyB,WAAW,IAAIE,iBAAiB,IAAIC,qBAAqB,iBAC5Db,IAAA,CAACZ,MAAM;MACN0C,qBAAqB;MACrBC,OAAO,EAAC,WAAW;MACnBC,OAAO,EAAGA,CAAA,KAAM;QACfX,iBAAiB,CAAE,IAAK,CAAC;MAC1B,CAAG;MAAAO,QAAA,EAED3C,EAAE,CAAE,aAAc;IAAC,CACd,CACR,EACCmC,cAAc,iBACfpB,IAAA,CAACF,UAAU;MACVmC,SAAS,EAAGX,UAAU,CAACG,KAAO;MAC9BS,OAAO,EAAGA,CAAA,KAAMb,iBAAiB,CAAE,KAAM,CAAG;MAC5Cc,QAAQ,EAAKC,KAAK,IAAM;QACvBb,gBAAgB,CAAE,EAAE,EAAEa,KAAM,CAAC;MAC9B;IAAG,CACH,CACD;EAAA,CACW,CAAC;AAEhB","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","Placeholder","Button","Spinner","useState","useSelect","store","coreStore","useAlternativeBlockPatterns","useAlternativeTemplateParts","useCreateTemplatePartFromBlocks","useTemplatePartArea","TitleModal","getTemplatePartIcon","jsx","_jsx","jsxs","_jsxs","TemplatePartPlaceholder","area","clientId","templatePartId","onOpenSelectionModal","setAttributes","templateParts","isResolving","blockPatterns","isBlockBasedTheme","canCreateTemplatePart","select","getCurrentTheme","canUser","is_block_theme","kind","name","showTitleModal","setShowTitleModal","areaObject","createFromBlocks","icon","label","instructions","toLowerCase","children","length","__next40pxDefaultSize","variant","onClick","areaLabel","onClose","onSubmit","title"],"sources":["@wordpress/block-library/src/template-part/edit/placeholder.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Placeholder, Button, Spinner } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tuseAlternativeBlockPatterns,\n\tuseAlternativeTemplateParts,\n\tuseCreateTemplatePartFromBlocks,\n\tuseTemplatePartArea,\n} from './utils/hooks';\nimport TitleModal from './title-modal';\nimport { getTemplatePartIcon } from './utils/get-template-part-icon';\n\nexport default function TemplatePartPlaceholder( {\n\tarea,\n\tclientId,\n\ttemplatePartId,\n\tonOpenSelectionModal,\n\tsetAttributes,\n} ) {\n\tconst { templateParts, isResolving } = useAlternativeTemplateParts(\n\t\tarea,\n\t\ttemplatePartId\n\t);\n\tconst blockPatterns = useAlternativeBlockPatterns( area, clientId );\n\n\tconst { isBlockBasedTheme, canCreateTemplatePart } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentTheme, canUser } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tisBlockBasedTheme: getCurrentTheme()?.is_block_theme,\n\t\t\t\tcanCreateTemplatePart: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'wp_template_part',\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst [ showTitleModal, setShowTitleModal ] = useState( false );\n\tconst areaObject = useTemplatePartArea( area );\n\tconst createFromBlocks = useCreateTemplatePartFromBlocks(\n\t\tarea,\n\t\tsetAttributes\n\t);\n\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ getTemplatePartIcon( areaObject.icon ) }\n\t\t\tlabel={ areaObject.label }\n\t\t\tinstructions={\n\t\t\t\tisBlockBasedTheme\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t__( 'Choose an existing %s or create a new one.' ),\n\t\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t// Translators: %s as template part area title (\"Header\", \"Footer\", etc.).\n\t\t\t\t\t\t\t__( 'Choose an existing %s.' ),\n\t\t\t\t\t\t\tareaObject.label.toLowerCase()\n\t\t\t\t\t )\n\t\t\t}\n\t\t>\n\t\t\t{ isResolving && <Spinner /> }\n\n\t\t\t{ ! isResolving &&\n\t\t\t\t!! ( templateParts.length || blockPatterns.length ) && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ onOpenSelectionModal }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Choose' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\n\t\t\t{ ! isResolving && isBlockBasedTheme && canCreateTemplatePart && (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetShowTitleModal( true );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Start blank' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ showTitleModal && (\n\t\t\t\t<TitleModal\n\t\t\t\t\tareaLabel={ areaObject.label }\n\t\t\t\t\tonClose={ () => setShowTitleModal( false ) }\n\t\t\t\t\tonSubmit={ ( title ) => {\n\t\t\t\t\t\tcreateFromBlocks( [], title );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</Placeholder>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,EAAEC,MAAM,EAAEC,OAAO,QAAQ,uBAAuB;AACpE,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SACCC,2BAA2B,EAC3BC,2BAA2B,EAC3BC,+BAA+B,EAC/BC,mBAAmB,QACb,eAAe;AACtB,OAAOC,UAAU,MAAM,eAAe;AACtC,SAASC,mBAAmB,QAAQ,gCAAgC;AAAC,SA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AAU,CAACG,KAAK,CAACE,WAAW,CAAC,CAC7B,CACH;IAAAC,QAAA,GAEClB,WAAW,iBAAIV,IAAA,CAACZ,OAAO,IAAE,CAAC,EAE1B,CAAEsB,WAAW,IACd,CAAC,EAAID,aAAa,CAACoB,MAAM,IAAIlB,aAAa,CAACkB,MAAM,CAAE,iBAClD7B,IAAA,CAACb,MAAM;MACN2C,qBAAqB;MACrBC,OAAO,EAAC,SAAS;MACjBC,OAAO,EAAGzB,oBAAsB;MAAAqB,QAAA,EAE9B5C,EAAE,CAAE,QAAS;IAAC,CACT,CACR,EAEA,CAAE0B,WAAW,IAAIE,iBAAiB,IAAIC,qBAAqB,iBAC5Db,IAAA,CAACb,MAAM;MACN2C,qBAAqB;MACrBC,OAAO,EAAC,WAAW;MACnBC,OAAO,EAAGA,CAAA,KAAM;QACfX,iBAAiB,CAAE,IAAK,CAAC;MAC1B,CAAG;MAAAO,QAAA,EAED5C,EAAE,CAAE,aAAc;IAAC,CACd,CACR,EACCoC,cAAc,iBACfpB,IAAA,CAACH,UAAU;MACVoC,SAAS,EAAGX,UAAU,CAACG,KAAO;MAC9BS,OAAO,EAAGA,CAAA,KAAMb,iBAAiB,CAAE,KAAM,CAAG;MAC5Cc,QAAQ,EAAKC,KAAK,IAAM;QACvBb,gBAAgB,CAAE,EAAE,EAAEa,KAAM,CAAC;MAC9B;IAAG,CACH,CACD;EAAA,CACW,CAAC;AAEhB","ignoreList":[]}
@@ -8,7 +8,7 @@ import clsx from 'clsx';
8
8
  */
9
9
  import { isBlobURL } from '@wordpress/blob';
10
10
  import { Disabled, Spinner, Placeholder, __experimentalToolsPanel as ToolsPanel } from '@wordpress/components';
11
- import { BlockControls, BlockIcon, InspectorControls, MediaPlaceholder, MediaReplaceFlow, useBlockProps } from '@wordpress/block-editor';
11
+ import { BlockControls, BlockIcon, InspectorControls, MediaPlaceholder, MediaReplaceFlow, useBlockProps, useBlockEditingMode } from '@wordpress/block-editor';
12
12
  import { useRef, useEffect, useState } from '@wordpress/element';
13
13
  import { __ } from '@wordpress/i18n';
14
14
  import { useDispatch } from '@wordpress/data';
@@ -45,6 +45,8 @@ function VideoEdit({
45
45
  } = attributes;
46
46
  const [temporaryURL, setTemporaryURL] = useState(attributes.blob);
47
47
  const dropdownMenuProps = useToolsPanelDropdownMenuProps();
48
+ const blockEditingMode = useBlockEditingMode();
49
+ const hasNonContentControls = blockEditingMode === 'default';
48
50
  useUploadMediaFromBlobURL({
49
51
  url: temporaryURL,
50
52
  allowedTypes: ALLOWED_MEDIA_TYPES,
@@ -222,7 +224,7 @@ function VideoEdit({
222
224
  isSelected: isSingleSelected,
223
225
  insertBlocksAfter: insertBlocksAfter,
224
226
  label: __('Video caption text'),
225
- showToolbarButton: isSingleSelected
227
+ showToolbarButton: isSingleSelected && hasNonContentControls
226
228
  })]
227
229
  })]
228
230
  });
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","isBlobURL","Disabled","Spinner","Placeholder","__experimentalToolsPanel","ToolsPanel","BlockControls","BlockIcon","InspectorControls","MediaPlaceholder","MediaReplaceFlow","useBlockProps","useRef","useEffect","useState","__","useDispatch","video","icon","store","noticesStore","createUpgradedEmbedBlock","useUploadMediaFromBlobURL","useToolsPanelDropdownMenuProps","VideoCommonSettings","TracksEditor","Tracks","Caption","PosterImage","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ALLOWED_MEDIA_TYPES","VideoEdit","isSelected","isSingleSelected","attributes","className","setAttributes","insertBlocksAfter","onReplace","videoPlayer","id","controls","poster","src","tracks","temporaryURL","setTemporaryURL","blob","dropdownMenuProps","url","allowedTypes","onChange","onSelectVideo","onError","onUploadError","current","load","media","undefined","caption","image","onSelectURL","newSrc","embedBlock","createErrorNotice","message","type","placeholder","content","withIllustration","label","instructions","children","classes","blockProps","onSelect","accept","value","newTracks","group","mediaId","mediaURL","onReset","resetAll","autoplay","loop","muted","playsInline","preload","posterImage","isDisabled","ref","showToolbarButton"],"sources":["@wordpress/block-library/src/video/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tDisabled,\n\tSpinner,\n\tPlaceholder,\n\t__experimentalToolsPanel as ToolsPanel,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { useRef, useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { video as icon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport {\n\tuseUploadMediaFromBlobURL,\n\tuseToolsPanelDropdownMenuProps,\n} from '../utils/hooks';\nimport VideoCommonSettings from './edit-common-settings';\nimport TracksEditor from './tracks-editor';\nimport Tracks from './tracks';\nimport { Caption } from '../utils/caption';\nimport PosterImage from '../utils/poster-image';\n\nconst ALLOWED_MEDIA_TYPES = [ 'video' ];\n\nfunction VideoEdit( {\n\tisSelected: isSingleSelected,\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tonReplace,\n} ) {\n\tconst videoPlayer = useRef();\n\tconst { id, controls, poster, src, tracks } = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectVideo,\n\t\tonError: onUploadError,\n\t} );\n\n\tuseEffect( () => {\n\t\t// Placeholder may be rendered.\n\t\tif ( videoPlayer.current ) {\n\t\t\tvideoPlayer.current.load();\n\t\t}\n\t}, [ poster ] );\n\n\t// TODO: Whether the video was obtained from the media library or was provided by URL, obtain the `videoWidth` and `videoHeight` of the video once its metadata has loaded and persist in the block attributes.\n\tfunction onSelectVideo( media ) {\n\t\tif ( ! media || ! media.url ) {\n\t\t\t// In this case there was an error\n\t\t\t// previous attributes should be removed\n\t\t\t// because they may be temporary blob urls.\n\t\t\tsetAttributes( {\n\t\t\t\tsrc: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t\tblob: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetTemporaryURL( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\t// Sets the block's attribute and updates the edit component from the\n\t\t// selected media.\n\t\tsetAttributes( {\n\t\t\tblob: undefined,\n\t\t\tsrc: media.url,\n\t\t\tid: media.id,\n\t\t\tposter:\n\t\t\t\tmedia.image?.src !== media.icon ? media.image?.src : undefined,\n\t\t\tcaption: media.caption,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onSelectURL( newSrc ) {\n\t\tif ( newSrc !== src ) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tconst embedBlock = createUpgradedEmbedBlock( {\n\t\t\t\tattributes: { url: newSrc },\n\t\t\t} );\n\t\t\tif ( undefined !== embedBlock && onReplace ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( {\n\t\t\t\tblob: undefined,\n\t\t\t\tsrc: newSrc,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\t// Much of this description is duplicated from MediaPlaceholder.\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"block-editor-media-placeholder\"\n\t\t\t\twithIllustration={ ! isSingleSelected }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ __( 'Video' ) }\n\t\t\t\tinstructions={ __(\n\t\t\t\t\t'Drag and drop a video, upload, or choose from your library.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': !! temporaryURL,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tvalue={ attributes }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isSingleSelected && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<TracksEditor\n\t\t\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\t\t\tonChange={ ( newTracks ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { tracks: newTracks } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\tonReset={ () => onSelectVideo( undefined ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\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\tautoplay: false,\n\t\t\t\t\t\t\tcontrols: true,\n\t\t\t\t\t\t\tloop: false,\n\t\t\t\t\t\t\tmuted: false,\n\t\t\t\t\t\t\tplaysInline: false,\n\t\t\t\t\t\t\tpreload: 'metadata',\n\t\t\t\t\t\t\tposter: undefined,\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<VideoCommonSettings\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t\t<PosterImage\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tonChange={ ( posterImage ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tposter: posterImage?.url,\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</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /*\n Disable the video tag if the block is not selected\n so the user clicking on it won't play the\n video when the controls are enabled.\n */ }\n\t\t\t\t<Disabled isDisabled={ ! isSingleSelected }>\n\t\t\t\t\t<video\n\t\t\t\t\t\tcontrols={ controls }\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tsrc={ src || temporaryURL }\n\t\t\t\t\t\tref={ videoPlayer }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Tracks tracks={ tracks } />\n\t\t\t\t\t</video>\n\t\t\t\t</Disabled>\n\t\t\t\t{ !! temporaryURL && <Spinner /> }\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Video caption text' ) }\n\t\t\t\t\tshowToolbarButton={ isSingleSelected }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default VideoEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,QAAQ,EACRC,OAAO,EACPC,WAAW,EACXC,wBAAwB,IAAIC,UAAU,QAChC,uBAAuB;AAC9B,SACCC,aAAa,EACbC,SAAS,EACTC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,QACP,yBAAyB;AAChC,SAASC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,IAAI,QAAQ,kBAAkB;AAChD,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,eAAe;AACxD,SACCC,yBAAyB,EACzBC,8BAA8B,QACxB,gBAAgB;AACvB,OAAOC,mBAAmB,MAAM,wBAAwB;AACxD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,MAAM,MAAM,UAAU;AAC7B,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,OAAOC,WAAW,MAAM,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,E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AGpD,WAAa;UAAAiC,QAAA,eAEnB/C,IAAA,CAACJ,MAAM;YAACuB,MAAM,EAAGA;UAAQ,CAAE;QAAC,CACtB;MAAC,CACC,CAAC,EACT,CAAC,CAAEC,YAAY,iBAAIpB,IAAA,CAAC5B,OAAO,IAAE,CAAC,eAChC4B,IAAA,CAACH,OAAO;QACPY,UAAU,EAAGA,UAAY;QACzBE,aAAa,EAAGA,aAAe;QAC/BJ,UAAU,EAAGC,gBAAkB;QAC/BI,iBAAiB,EAAGA,iBAAmB;QACvCiC,KAAK,EAAG5D,EAAE,CAAE,oBAAqB,CAAG;QACpCkF,iBAAiB,EAAG3D;MAAkB,CACtC,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,eAAeF,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["clsx","isBlobURL","Disabled","Spinner","Placeholder","__experimentalToolsPanel","ToolsPanel","BlockControls","BlockIcon","InspectorControls","MediaPlaceholder","MediaReplaceFlow","useBlockProps","useBlockEditingMode","useRef","useEffect","useState","__","useDispatch","video","icon","store","noticesStore","createUpgradedEmbedBlock","useUploadMediaFromBlobURL","useToolsPanelDropdownMenuProps","VideoCommonSettings","TracksEditor","Tracks","Caption","PosterImage","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ALLOWED_MEDIA_TYPES","VideoEdit","isSelected","isSingleSelected","attributes","className","setAttributes","insertBlocksAfter","onReplace","videoPlayer","id","controls","poster","src","tracks","temporaryURL","setTemporaryURL","blob","dropdownMenuProps","blockEditingMode","hasNonContentControls","url","allowedTypes","onChange","onSelectVideo","onError","onUploadError","current","load","media","undefined","caption","image","onSelectURL","newSrc","embedBlock","createErrorNotice","message","type","placeholder","content","withIllustration","label","instructions","children","classes","blockProps","onSelect","accept","value","newTracks","group","mediaId","mediaURL","onReset","resetAll","autoplay","loop","muted","playsInline","preload","posterImage","isDisabled","ref","showToolbarButton"],"sources":["@wordpress/block-library/src/video/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tDisabled,\n\tSpinner,\n\tPlaceholder,\n\t__experimentalToolsPanel as ToolsPanel,\n} from '@wordpress/components';\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { useRef, useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { video as icon } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport {\n\tuseUploadMediaFromBlobURL,\n\tuseToolsPanelDropdownMenuProps,\n} from '../utils/hooks';\nimport VideoCommonSettings from './edit-common-settings';\nimport TracksEditor from './tracks-editor';\nimport Tracks from './tracks';\nimport { Caption } from '../utils/caption';\nimport PosterImage from '../utils/poster-image';\n\nconst ALLOWED_MEDIA_TYPES = [ 'video' ];\n\nfunction VideoEdit( {\n\tisSelected: isSingleSelected,\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tonReplace,\n} ) {\n\tconst videoPlayer = useRef();\n\tconst { id, controls, poster, src, tracks } = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tuseUploadMediaFromBlobURL( {\n\t\turl: temporaryURL,\n\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\tonChange: onSelectVideo,\n\t\tonError: onUploadError,\n\t} );\n\n\tuseEffect( () => {\n\t\t// Placeholder may be rendered.\n\t\tif ( videoPlayer.current ) {\n\t\t\tvideoPlayer.current.load();\n\t\t}\n\t}, [ poster ] );\n\n\t// TODO: Whether the video was obtained from the media library or was provided by URL, obtain the `videoWidth` and `videoHeight` of the video once its metadata has loaded and persist in the block attributes.\n\tfunction onSelectVideo( media ) {\n\t\tif ( ! media || ! media.url ) {\n\t\t\t// In this case there was an error\n\t\t\t// previous attributes should be removed\n\t\t\t// because they may be temporary blob urls.\n\t\t\tsetAttributes( {\n\t\t\t\tsrc: undefined,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t\tcaption: undefined,\n\t\t\t\tblob: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetTemporaryURL( media.url );\n\t\t\treturn;\n\t\t}\n\n\t\t// Sets the block's attribute and updates the edit component from the\n\t\t// selected media.\n\t\tsetAttributes( {\n\t\t\tblob: undefined,\n\t\t\tsrc: media.url,\n\t\t\tid: media.id,\n\t\t\tposter:\n\t\t\t\tmedia.image?.src !== media.icon ? media.image?.src : undefined,\n\t\t\tcaption: media.caption,\n\t\t} );\n\t\tsetTemporaryURL();\n\t}\n\n\tfunction onSelectURL( newSrc ) {\n\t\tif ( newSrc !== src ) {\n\t\t\t// Check if there's an embed block that handles this URL.\n\t\t\tconst embedBlock = createUpgradedEmbedBlock( {\n\t\t\t\tattributes: { url: newSrc },\n\t\t\t} );\n\t\t\tif ( undefined !== embedBlock && onReplace ) {\n\t\t\t\tonReplace( embedBlock );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetAttributes( {\n\t\t\t\tblob: undefined,\n\t\t\t\tsrc: newSrc,\n\t\t\t\tid: undefined,\n\t\t\t\tposter: undefined,\n\t\t\t} );\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\t// Much of this description is duplicated from MediaPlaceholder.\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"block-editor-media-placeholder\"\n\t\t\t\twithIllustration={ ! isSingleSelected }\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ __( 'Video' ) }\n\t\t\t\tinstructions={ __(\n\t\t\t\t\t'Drag and drop a video, upload, or choose from your library.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = clsx( className, {\n\t\t'is-transient': !! temporaryURL,\n\t} );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classes,\n\t} );\n\n\tif ( ! src && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tvalue={ attributes }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isSingleSelected && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls>\n\t\t\t\t\t\t<TracksEditor\n\t\t\t\t\t\t\ttracks={ tracks }\n\t\t\t\t\t\t\tonChange={ ( newTracks ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { tracks: newTracks } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\tmediaURL={ src }\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\taccept=\"video/*\"\n\t\t\t\t\t\t\tonSelect={ onSelectVideo }\n\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\tonReset={ () => onSelectVideo( undefined ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t</>\n\t\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\tautoplay: false,\n\t\t\t\t\t\t\tcontrols: true,\n\t\t\t\t\t\t\tloop: false,\n\t\t\t\t\t\t\tmuted: false,\n\t\t\t\t\t\t\tplaysInline: false,\n\t\t\t\t\t\t\tpreload: 'metadata',\n\t\t\t\t\t\t\tposter: undefined,\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<VideoCommonSettings\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t/>\n\t\t\t\t\t<PosterImage\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tonChange={ ( posterImage ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tposter: posterImage?.url,\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</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /*\n Disable the video tag if the block is not selected\n so the user clicking on it won't play the\n video when the controls are enabled.\n */ }\n\t\t\t\t<Disabled isDisabled={ ! isSingleSelected }>\n\t\t\t\t\t<video\n\t\t\t\t\t\tcontrols={ controls }\n\t\t\t\t\t\tposter={ poster }\n\t\t\t\t\t\tsrc={ src || temporaryURL }\n\t\t\t\t\t\tref={ videoPlayer }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Tracks tracks={ tracks } />\n\t\t\t\t\t</video>\n\t\t\t\t</Disabled>\n\t\t\t\t{ !! temporaryURL && <Spinner /> }\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Video caption text' ) }\n\t\t\t\t\tshowToolbarButton={\n\t\t\t\t\t\tisSingleSelected && hasNonContentControls\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n\nexport default VideoEdit;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,QAAQ,EACRC,OAAO,EACPC,WAAW,EACXC,wBAAwB,IAAIC,UAAU,QAChC,uBAAuB;AAC9B,SACCC,aAAa,EACbC,SAAS,EACTC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,IAAI,QAAQ,kBAAkB;AAChD,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,eAAe;AACxD,SACCC,yBAAyB,EACzBC,8BAA8B,QACxB,gBAAgB;AACvB,OAAOC,mBAAmB,MAAM,wBAAwB;AACxD,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,OAAOC,MAAM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AAU;MAAAF,QAAA,gBAMtBjD,IAAA,CAAC9B,QAAQ;QAACiG,UAAU,EAAG,CAAE3D,gBAAkB;QAAAyC,QAAA,eAC1CjD,IAAA;UACCgB,QAAQ,EAAGA,QAAU;UACrBC,MAAM,EAAGA,MAAQ;UACjBC,GAAG,EAAGA,GAAG,IAAIE,YAAc;UAC3BgD,GAAG,EAAGtD,WAAa;UAAAmC,QAAA,eAEnBjD,IAAA,CAACJ,MAAM;YAACuB,MAAM,EAAGA;UAAQ,CAAE;QAAC,CACtB;MAAC,CACC,CAAC,EACT,CAAC,CAAEC,YAAY,iBAAIpB,IAAA,CAAC7B,OAAO,IAAE,CAAC,eAChC6B,IAAA,CAACH,OAAO;QACPY,UAAU,EAAGA,UAAY;QACzBE,aAAa,EAAGA,aAAe;QAC/BJ,UAAU,EAAGC,gBAAkB;QAC/BI,iBAAiB,EAAGA,iBAAmB;QACvCmC,KAAK,EAAG9D,EAAE,CAAE,oBAAqB,CAAG;QACpCoF,iBAAiB,EAChB7D,gBAAgB,IAAIiB;MACpB,CACD,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAEA,eAAenB,SAAS","ignoreList":[]}
@@ -142,10 +142,8 @@
142
142
  .wp-block-accordion-content.is-open {
143
143
  grid-template-rows: max-content 1fr;
144
144
  }
145
-
146
- .accordion-content__heading {
147
- margin-block-start: 0;
148
- margin-block-end: 0;
145
+ .wp-block-accordion-content.is-open > .wp-block-accordion-header .accordion-content__toggle-icon.has-icon-plus {
146
+ transform: rotate(-45deg);
149
147
  }
150
148
 
151
149
  .accordion-content__toggle {
@@ -163,6 +161,7 @@
163
161
  padding: var(--wp--preset--spacing--20, 1em) 0;
164
162
  cursor: pointer;
165
163
  outline: none;
164
+ overflow: hidden;
166
165
  display: flex;
167
166
  align-items: center;
168
167
  text-align: inherit;
@@ -177,7 +176,11 @@
177
176
  .is-layout-flow > .wp-block-accordion-panel,
178
177
  .wp-block-accordion-panel {
179
178
  overflow: hidden;
180
- margin: 0;
179
+ }
180
+
181
+ .wp-block-accordion-panel[inert],
182
+ .wp-block-accordion-panel[aria-hidden=true] {
183
+ margin-block-start: 0;
181
184
  }
182
185
 
183
186
  .accordion-panel__wrapper {
@@ -194,16 +197,6 @@
194
197
  flex-direction: row-reverse;
195
198
  }
196
199
 
197
- /* RTL language support */
198
- [dir=rtl] .wp-block-accordion-header:not(.icon-position-left) .accordion-content__toggle {
199
- /* stylelint-disable-next-line declaration-property-value-allowed-list -- Automatically adjust icon position for RTL languages. */
200
- flex-direction: row-reverse;
201
- }
202
-
203
- [dir=rtl] .wp-block-accordion-header.icon-position-left .accordion-content__toggle {
204
- flex-direction: row;
205
- }
206
-
207
200
  .accordion-content__toggle:focus-visible {
208
201
  outline: 2px solid -webkit-focus-ring-color;
209
202
  outline-offset: 2px;
@@ -217,7 +210,4 @@
217
210
  .wp-block-accordion-content {
218
211
  transition: grid-template-rows 0.3s ease-out;
219
212
  }
220
- }
221
- .is-open .accordion-content__toggle-icon.has-icon-plus {
222
- transform: rotate(-45deg);
223
213
  }
@@ -142,10 +142,8 @@
142
142
  .wp-block-accordion-content.is-open {
143
143
  grid-template-rows: max-content 1fr;
144
144
  }
145
-
146
- .accordion-content__heading {
147
- margin-block-start: 0;
148
- margin-block-end: 0;
145
+ .wp-block-accordion-content.is-open > .wp-block-accordion-header .accordion-content__toggle-icon.has-icon-plus {
146
+ transform: rotate(45deg);
149
147
  }
150
148
 
151
149
  .accordion-content__toggle {
@@ -163,6 +161,7 @@
163
161
  padding: var(--wp--preset--spacing--20, 1em) 0;
164
162
  cursor: pointer;
165
163
  outline: none;
164
+ overflow: hidden;
166
165
  display: flex;
167
166
  align-items: center;
168
167
  text-align: inherit;
@@ -177,7 +176,11 @@
177
176
  .is-layout-flow > .wp-block-accordion-panel,
178
177
  .wp-block-accordion-panel {
179
178
  overflow: hidden;
180
- margin: 0;
179
+ }
180
+
181
+ .wp-block-accordion-panel[inert],
182
+ .wp-block-accordion-panel[aria-hidden=true] {
183
+ margin-block-start: 0;
181
184
  }
182
185
 
183
186
  .accordion-panel__wrapper {
@@ -194,16 +197,6 @@
194
197
  flex-direction: row-reverse;
195
198
  }
196
199
 
197
- /* RTL language support */
198
- [dir=rtl] .wp-block-accordion-header:not(.icon-position-left) .accordion-content__toggle {
199
- /* stylelint-disable-next-line declaration-property-value-allowed-list -- Automatically adjust icon position for RTL languages. */
200
- flex-direction: row-reverse;
201
- }
202
-
203
- [dir=rtl] .wp-block-accordion-header.icon-position-left .accordion-content__toggle {
204
- flex-direction: row;
205
- }
206
-
207
200
  .accordion-content__toggle:focus-visible {
208
201
  outline: 2px solid -webkit-focus-ring-color;
209
202
  outline-offset: 2px;
@@ -217,7 +210,4 @@
217
210
  .wp-block-accordion-content {
218
211
  transition: grid-template-rows 0.3s ease-out;
219
212
  }
220
- }
221
- .is-open .accordion-content__toggle-icon.has-icon-plus {
222
- transform: rotate(45deg);
223
213
  }
@@ -1994,6 +1994,20 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
1994
1994
  height: auto;
1995
1995
  }
1996
1996
 
1997
+ .link-ui-page-creator {
1998
+ max-width: 350px;
1999
+ min-width: auto;
2000
+ width: 90vw;
2001
+ padding-top: 8px;
2002
+ }
2003
+ .link-ui-page-creator__inner {
2004
+ padding: 16px;
2005
+ }
2006
+ .link-ui-page-creator__back {
2007
+ margin-right: 8px;
2008
+ text-transform: uppercase;
2009
+ }
2010
+
1997
2011
  .wp-block-navigation-submenu {
1998
2012
  display: block;
1999
2013
  }
@@ -2660,6 +2674,10 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2660
2674
  margin-bottom: 0;
2661
2675
  }
2662
2676
 
2677
+ .wp-block-query > .block-editor-media-placeholder.is-small {
2678
+ min-height: 60px;
2679
+ }
2680
+
2663
2681
  .wp-block[data-align=center] > .wp-block-query-pagination {
2664
2682
  justify-content: center;
2665
2683
  }
@@ -2001,6 +2001,20 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2001
2001
  height: auto;
2002
2002
  }
2003
2003
 
2004
+ .link-ui-page-creator {
2005
+ max-width: 350px;
2006
+ min-width: auto;
2007
+ width: 90vw;
2008
+ padding-top: 8px;
2009
+ }
2010
+ .link-ui-page-creator__inner {
2011
+ padding: 16px;
2012
+ }
2013
+ .link-ui-page-creator__back {
2014
+ margin-left: 8px;
2015
+ text-transform: uppercase;
2016
+ }
2017
+
2004
2018
  .wp-block-navigation-submenu {
2005
2019
  display: block;
2006
2020
  }
@@ -2667,6 +2681,10 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2667
2681
  margin-bottom: 0;
2668
2682
  }
2669
2683
 
2684
+ .wp-block-query > .block-editor-media-placeholder.is-small {
2685
+ min-height: 60px;
2686
+ }
2687
+
2670
2688
  .wp-block[data-align=center] > .wp-block-query-pagination {
2671
2689
  justify-content: center;
2672
2690
  }
@@ -165,15 +165,16 @@
165
165
  width: fit-content;
166
166
  }
167
167
 
168
- .wp-block-form-input__input {
168
+ :where(.wp-block-form-input__input) {
169
169
  padding: 0 0.5em;
170
170
  font-size: 1em;
171
171
  margin-bottom: 0.5em;
172
172
  }
173
- .wp-block-form-input__input[type=text], .wp-block-form-input__input[type=password], .wp-block-form-input__input[type=date], .wp-block-form-input__input[type=datetime], .wp-block-form-input__input[type=datetime-local], .wp-block-form-input__input[type=email], .wp-block-form-input__input[type=month], .wp-block-form-input__input[type=number], .wp-block-form-input__input[type=search], .wp-block-form-input__input[type=tel], .wp-block-form-input__input[type=time], .wp-block-form-input__input[type=url], .wp-block-form-input__input[type=week] {
173
+ :where(.wp-block-form-input__input)[type=text], :where(.wp-block-form-input__input)[type=password], :where(.wp-block-form-input__input)[type=date], :where(.wp-block-form-input__input)[type=datetime], :where(.wp-block-form-input__input)[type=datetime-local], :where(.wp-block-form-input__input)[type=email], :where(.wp-block-form-input__input)[type=month], :where(.wp-block-form-input__input)[type=number], :where(.wp-block-form-input__input)[type=search], :where(.wp-block-form-input__input)[type=tel], :where(.wp-block-form-input__input)[type=time], :where(.wp-block-form-input__input)[type=url], :where(.wp-block-form-input__input)[type=week] {
174
174
  min-height: 2em;
175
175
  line-height: 2;
176
- border: 1px solid;
176
+ border-width: 1px;
177
+ border-style: solid;
177
178
  }
178
179
 
179
180
  textarea.wp-block-form-input__input {
@@ -165,15 +165,16 @@
165
165
  width: fit-content;
166
166
  }
167
167
 
168
- .wp-block-form-input__input {
168
+ :where(.wp-block-form-input__input) {
169
169
  padding: 0 0.5em;
170
170
  font-size: 1em;
171
171
  margin-bottom: 0.5em;
172
172
  }
173
- .wp-block-form-input__input[type=text], .wp-block-form-input__input[type=password], .wp-block-form-input__input[type=date], .wp-block-form-input__input[type=datetime], .wp-block-form-input__input[type=datetime-local], .wp-block-form-input__input[type=email], .wp-block-form-input__input[type=month], .wp-block-form-input__input[type=number], .wp-block-form-input__input[type=search], .wp-block-form-input__input[type=tel], .wp-block-form-input__input[type=time], .wp-block-form-input__input[type=url], .wp-block-form-input__input[type=week] {
173
+ :where(.wp-block-form-input__input)[type=text], :where(.wp-block-form-input__input)[type=password], :where(.wp-block-form-input__input)[type=date], :where(.wp-block-form-input__input)[type=datetime], :where(.wp-block-form-input__input)[type=datetime-local], :where(.wp-block-form-input__input)[type=email], :where(.wp-block-form-input__input)[type=month], :where(.wp-block-form-input__input)[type=number], :where(.wp-block-form-input__input)[type=search], :where(.wp-block-form-input__input)[type=tel], :where(.wp-block-form-input__input)[type=time], :where(.wp-block-form-input__input)[type=url], :where(.wp-block-form-input__input)[type=week] {
174
174
  min-height: 2em;
175
175
  line-height: 2;
176
- border: 1px solid;
176
+ border-width: 1px;
177
+ border-style: solid;
177
178
  }
178
179
 
179
180
  textarea.wp-block-form-input__input {
@@ -228,4 +228,18 @@
228
228
  flex-direction: column;
229
229
  gap: 8px;
230
230
  height: auto;
231
+ }
232
+
233
+ .link-ui-page-creator {
234
+ max-width: 350px;
235
+ min-width: auto;
236
+ width: 90vw;
237
+ padding-top: 8px;
238
+ }
239
+ .link-ui-page-creator__inner {
240
+ padding: 16px;
241
+ }
242
+ .link-ui-page-creator__back {
243
+ margin-right: 8px;
244
+ text-transform: uppercase;
231
245
  }
@@ -228,4 +228,18 @@
228
228
  flex-direction: column;
229
229
  gap: 8px;
230
230
  height: auto;
231
+ }
232
+
233
+ .link-ui-page-creator {
234
+ max-width: 350px;
235
+ min-width: auto;
236
+ width: 90vw;
237
+ padding-top: 8px;
238
+ }
239
+ .link-ui-page-creator__inner {
240
+ padding: 16px;
241
+ }
242
+ .link-ui-page-creator__back {
243
+ margin-left: 8px;
244
+ text-transform: uppercase;
231
245
  }
@@ -142,7 +142,7 @@
142
142
  }
143
143
 
144
144
  .link-ui-tools {
145
- border-top: 1px solid #f0f0f0;
145
+ outline: 1px solid #f0f0f0;
146
146
  padding: 8px;
147
147
  }
148
148
 
@@ -142,7 +142,7 @@
142
142
  }
143
143
 
144
144
  .link-ui-tools {
145
- border-top: 1px solid #f0f0f0;
145
+ outline: 1px solid #f0f0f0;
146
146
  padding: 8px;
147
147
  }
148
148