@wordpress/block-library 9.30.0 → 9.30.1-next.836ecdcae.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 (75) hide show
  1. package/build/accordion-content/edit.js +8 -8
  2. package/build/accordion-content/edit.js.map +1 -1
  3. package/build/accordion-content/index.js +2 -1
  4. package/build/accordion-content/index.js.map +1 -1
  5. package/build/accordion-panel/index.js +2 -1
  6. package/build/accordion-panel/index.js.map +1 -1
  7. package/build/navigation/constants.js +5 -1
  8. package/build/navigation/constants.js.map +1 -1
  9. package/build/navigation/edit/index.js +45 -1
  10. package/build/navigation/edit/index.js.map +1 -1
  11. package/build/navigation/edit/leaf-more-menu.js +0 -1
  12. package/build/navigation/edit/leaf-more-menu.js.map +1 -1
  13. package/build/navigation/edit/menu-inspector-controls.js +40 -5
  14. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  15. package/build/navigation-link/link-ui.js +64 -56
  16. package/build/navigation-link/link-ui.js.map +1 -1
  17. package/build/navigation-link/page-creator.js +143 -0
  18. package/build/navigation-link/page-creator.js.map +1 -0
  19. package/build/search/edit.js +22 -14
  20. package/build/search/edit.js.map +1 -1
  21. package/build-module/accordion-content/edit.js +8 -8
  22. package/build-module/accordion-content/edit.js.map +1 -1
  23. package/build-module/accordion-content/index.js +2 -1
  24. package/build-module/accordion-content/index.js.map +1 -1
  25. package/build-module/accordion-panel/index.js +2 -1
  26. package/build-module/accordion-panel/index.js.map +1 -1
  27. package/build-module/navigation/constants.js +5 -1
  28. package/build-module/navigation/constants.js.map +1 -1
  29. package/build-module/navigation/edit/index.js +50 -4
  30. package/build-module/navigation/edit/index.js.map +1 -1
  31. package/build-module/navigation/edit/leaf-more-menu.js +0 -1
  32. package/build-module/navigation/edit/leaf-more-menu.js.map +1 -1
  33. package/build-module/navigation/edit/menu-inspector-controls.js +40 -5
  34. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  35. package/build-module/navigation-link/link-ui.js +68 -60
  36. package/build-module/navigation-link/link-ui.js.map +1 -1
  37. package/build-module/navigation-link/page-creator.js +137 -0
  38. package/build-module/navigation-link/page-creator.js.map +1 -0
  39. package/build-module/search/edit.js +22 -14
  40. package/build-module/search/edit.js.map +1 -1
  41. package/build-style/accordion/style-rtl.css +5 -6
  42. package/build-style/accordion/style.css +5 -6
  43. package/build-style/editor-rtl.css +14 -0
  44. package/build-style/editor.css +14 -0
  45. package/build-style/form-input/style-rtl.css +4 -3
  46. package/build-style/form-input/style.css +4 -3
  47. package/build-style/navigation-link/editor-rtl.css +14 -0
  48. package/build-style/navigation-link/editor.css +14 -0
  49. package/build-style/navigation-link/style-rtl.css +1 -1
  50. package/build-style/navigation-link/style.css +1 -1
  51. package/build-style/post-comments-form/style-rtl.css +8 -5
  52. package/build-style/post-comments-form/style.css +8 -5
  53. package/build-style/search/style-rtl.css +11 -12
  54. package/build-style/search/style.css +11 -12
  55. package/build-style/style-rtl.css +29 -27
  56. package/build-style/style.css +29 -27
  57. package/package.json +35 -35
  58. package/src/accordion/style.scss +6 -6
  59. package/src/accordion-content/block.json +2 -1
  60. package/src/accordion-content/edit.js +21 -27
  61. package/src/accordion-panel/block.json +2 -1
  62. package/src/cover/test/edit.js +1 -5
  63. package/src/form-input/style.scss +3 -2
  64. package/src/navigation/constants.js +4 -0
  65. package/src/navigation/edit/index.js +50 -1
  66. package/src/navigation/edit/leaf-more-menu.js +0 -1
  67. package/src/navigation/edit/menu-inspector-controls.js +40 -5
  68. package/src/navigation-link/editor.scss +17 -0
  69. package/src/navigation-link/link-ui.js +88 -81
  70. package/src/navigation-link/page-creator.js +164 -0
  71. package/src/navigation-link/style.scss +1 -1
  72. package/src/post-comments-form/style.scss +11 -11
  73. package/src/search/edit.js +44 -13
  74. package/src/search/index.php +16 -2
  75. package/src/search/style.scss +15 -16
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_components","require","_i18n","_data","_coreData","_htmlEntities","_element","_icons","_compose","_jsxRuntime","LinkUIPageCreator","postType","onBack","onPageCreated","initialTitle","title","setTitle","useState","shouldPublish","setShouldPublish","focusOnMountRef","useFocusOnMount","isTitleValid","trim","length","lastError","isSaving","useSelect","select","coreStore","getLastEntitySaveError","isSavingEntityRecord","saveEntityRecord","useDispatch","createPage","event","preventDefault","savedRecord","status","throwOnError","pageLink","id","type","decodeEntities","rendered","url","link","kind","error","isSubmitDisabled","jsxs","className","ref","children","jsx","Button","icon","isRTL","chevronRightSmall","chevronLeftSmall","onClick","e","size","__","__experimentalVStack","spacing","onSubmit","TextControl","__next40pxDefaultSize","__nextHasNoMarginBottom","label","onChange","placeholder","value","CheckboxControl","help","checked","Notice","isDismissible","message","__experimentalHStack","justify","variant","disabled","accessibleWhenDisabled","isBusy"],"sources":["@wordpress/block-library/src/navigation-link/page-creator.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tTextControl,\n\tNotice,\n\tCheckboxControl,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useState } from '@wordpress/element';\nimport { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';\nimport { useFocusOnMount } from '@wordpress/compose';\n\n/**\n * Component for creating new pages within the Navigation Link UI.\n *\n * @param {Object} props Component props.\n * @param {string} props.postType The post type to create.\n * @param {Function} props.onBack Callback when user wants to go back.\n * @param {Function} props.onPageCreated Callback when page is successfully created.\n * @param {string} [props.initialTitle] Initial title to pre-fill the form.\n */\nexport function LinkUIPageCreator( {\n\tpostType,\n\tonBack,\n\tonPageCreated,\n\tinitialTitle = '',\n} ) {\n\tconst [ title, setTitle ] = useState( initialTitle );\n\tconst [ shouldPublish, setShouldPublish ] = useState( false );\n\n\t// Focus the first element when the component mounts\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\t// Check if the title is valid for submission\n\tconst isTitleValid = title.trim().length > 0;\n\n\t// Get the last created entity record (without ID) to track creation state\n\tconst { lastError, isSaving } = useSelect(\n\t\t( select ) => ( {\n\t\t\tlastError: select( coreStore ).getLastEntitySaveError(\n\t\t\t\t'postType',\n\t\t\t\tpostType\n\t\t\t),\n\t\t\tisSaving: select( coreStore ).isSavingEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType\n\t\t\t),\n\t\t} ),\n\t\t[ postType ]\n\t);\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tasync function createPage( event ) {\n\t\tevent.preventDefault();\n\t\tif ( isSaving || ! isTitleValid ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle,\n\t\t\t\t\tstatus: shouldPublish ? 'publish' : 'draft',\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\t// Create the page link object from the saved record\n\t\t\t\tconst pageLink = {\n\t\t\t\t\tid: savedRecord.id,\n\t\t\t\t\ttype: postType,\n\t\t\t\t\ttitle: decodeEntities( savedRecord.title.rendered ),\n\t\t\t\t\turl: savedRecord.link,\n\t\t\t\t\tkind: 'post-type',\n\t\t\t\t};\n\n\t\t\t\tonPageCreated( pageLink );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\t// Error handling is done via the data store selectors\n\t\t}\n\t}\n\n\tconst isSubmitDisabled = isSaving || ! isTitleValid;\n\n\treturn (\n\t\t<div className=\"link-ui-page-creator\" ref={ focusOnMountRef }>\n\t\t\t<Button\n\t\t\t\tclassName=\"link-ui-page-creator__back\"\n\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tonBack();\n\t\t\t\t} }\n\t\t\t\tsize=\"small\"\n\t\t\t>\n\t\t\t\t{ __( 'Back' ) }\n\t\t\t</Button>\n\n\t\t\t<VStack className=\"link-ui-page-creator__inner\" spacing={ 4 }>\n\t\t\t\t<form onSubmit={ createPage }>\n\t\t\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t\t\t<TextControl\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={ __( 'Title' ) }\n\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\tplaceholder={ __( 'No title' ) }\n\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Publish immediately' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'If unchecked, the page will be created as a draft.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tchecked={ shouldPublish }\n\t\t\t\t\t\t\tonChange={ setShouldPublish }\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{ lastError && (\n\t\t\t\t\t\t\t<Notice status=\"error\" isDismissible={ false }>\n\t\t\t\t\t\t\t\t{ lastError.message }\n\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<HStack spacing={ 2 } justify=\"flex-end\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\tonClick={ onBack }\n\t\t\t\t\t\t\t\tdisabled={ isSaving }\n\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t\t\t\taria-disabled={ isSubmitDisabled }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Create page' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</VStack>\n\t\t\t\t</form>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAQA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAAqD,IAAAQ,WAAA,GAAAR,OAAA;AAjBrD;AACA;AACA;;AAiBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASS,iBAAiBA,CAAE;EAClCC,QAAQ;EACRC,MAAM;EACNC,aAAa;EACbC,YAAY,GAAG;AAChB,CAAC,EAAG;EACH,MAAM,CAAEC,KAAK,EAAEC,QAAQ,CAAE,GAAG,IAAAC,iBAAQ,EAAEH,YAAa,CAAC;EACpD,MAAM,CAAEI,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAF,iBAAQ,EAAE,KAAM,CAAC;;EAE7D;EACA,MAAMG,eAAe,GAAG,IAAAC,wBAAe,EAAE,cAAe,CAAC;;EAEzD;EACA,MAAMC,YAAY,GAAGP,KAAK,CAACQ,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC;;EAE5C;EACA,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EACtCC,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;YAACwC,aAAa,EAAG,KAAO;YAAAzB,QAAA,EAC3C5B,SAAS,CAACsD;UAAO,CACZ,CACR,eAED,IAAAtE,WAAA,CAAAyC,IAAA,EAAClD,WAAA,CAAAgF,oBAAM;YAACf,OAAO,EAAG,CAAG;YAACgB,OAAO,EAAC,UAAU;YAAA5B,QAAA,gBACvC,IAAA5C,WAAA,CAAA6C,GAAA,EAACtD,WAAA,CAAAuD,MAAM;cACNa,qBAAqB;cACrBc,OAAO,EAAC,UAAU;cAClBtB,OAAO,EAAGhD,MAAQ;cAClBuE,QAAQ,EAAGzD,QAAU;cACrB0D,sBAAsB;cAAA/B,QAAA,EAEpB,IAAAU,QAAE,EAAE,QAAS;YAAC,CACT,CAAC,eACT,IAAAtD,WAAA,CAAA6C,GAAA,EAACtD,WAAA,CAAAuD,MAAM;cACNa,qBAAqB;cACrBc,OAAO,EAAC,SAAS;cACjBxC,IAAI,EAAC,QAAQ;cACb2C,MAAM,EAAG3D,QAAU;cACnB,iBAAgBuB,gBAAkB;cAAAI,QAAA,EAEhC,IAAAU,QAAE,EAAE,aAAc;YAAC,CACd,CAAC;UAAA,CACF,CAAC;QAAA,CACF;MAAC,CACJ;IAAC,CACA,CAAC;EAAA,CACL,CAAC;AAER","ignoreList":[]}
@@ -162,7 +162,11 @@ function SearchEdit({
162
162
  const textFieldClasses = (0, _clsx.default)('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className, typographyProps.className);
163
163
  const textFieldStyles = {
164
164
  ...(isButtonPositionInside ? {
165
- borderRadius
165
+ borderRadius: borderProps.style?.borderRadius,
166
+ borderTopLeftRadius: borderProps.style?.borderTopLeftRadius,
167
+ borderTopRightRadius: borderProps.style?.borderTopRightRadius,
168
+ borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius,
169
+ borderBottomRightRadius: borderProps.style?.borderBottomRightRadius
166
170
  } : borderProps.style),
167
171
  ...typographyProps.style,
168
172
  textDecoration: undefined
@@ -191,7 +195,11 @@ function SearchEdit({
191
195
  ...colorProps.style,
192
196
  ...typographyProps.style,
193
197
  ...(isButtonPositionInside ? {
194
- borderRadius
198
+ borderRadius: borderProps.style?.borderRadius,
199
+ borderTopLeftRadius: borderProps.style?.borderTopLeftRadius,
200
+ borderTopRightRadius: borderProps.style?.borderTopRightRadius,
201
+ borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius,
202
+ borderBottomRightRadius: borderProps.style?.borderBottomRightRadius
195
203
  } : borderProps.style)
196
204
  };
197
205
  const handleButtonClick = () => {
@@ -360,7 +368,8 @@ function SearchEdit({
360
368
  })
361
369
  })
362
370
  });
363
- const padBorderRadius = radius => radius ? `calc(${radius} + ${DEFAULT_INNER_PADDING})` : undefined;
371
+ const isNonZeroBorderRadius = radius => radius !== undefined && parseInt(radius, 10) !== 0;
372
+ const padBorderRadius = radius => isNonZeroBorderRadius(radius) ? `calc(${radius} + ${DEFAULT_INNER_PADDING})` : undefined;
364
373
  const getWrapperStyles = () => {
365
374
  const styles = isButtonPositionInside ? borderProps.style : {
366
375
  borderRadius: borderProps.style?.borderRadius,
@@ -369,8 +378,7 @@ function SearchEdit({
369
378
  borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius,
370
379
  borderBottomRightRadius: borderProps.style?.borderBottomRightRadius
371
380
  };
372
- const isNonZeroBorderRadius = borderRadius !== undefined && parseInt(borderRadius, 10) !== 0;
373
- if (isButtonPositionInside && isNonZeroBorderRadius) {
381
+ if (isButtonPositionInside) {
374
382
  // We have button inside wrapper and a border radius value to apply.
375
383
  // Add default padding so we don't get "fat" corners.
376
384
  //
@@ -380,17 +388,17 @@ function SearchEdit({
380
388
  if (typeof borderRadius === 'object') {
381
389
  // Individual corner border radii present.
382
390
  const {
383
- topLeft,
384
- topRight,
385
- bottomLeft,
386
- bottomRight
387
- } = borderRadius;
391
+ borderTopLeftRadius,
392
+ borderTopRightRadius,
393
+ borderBottomLeftRadius,
394
+ borderBottomRightRadius
395
+ } = borderProps.style;
388
396
  return {
389
397
  ...styles,
390
- borderTopLeftRadius: padBorderRadius(topLeft),
391
- borderTopRightRadius: padBorderRadius(topRight),
392
- borderBottomLeftRadius: padBorderRadius(bottomLeft),
393
- borderBottomRightRadius: padBorderRadius(bottomRight)
398
+ borderTopLeftRadius: padBorderRadius(borderTopLeftRadius),
399
+ borderTopRightRadius: padBorderRadius(borderTopRightRadius),
400
+ borderBottomLeftRadius: padBorderRadius(borderBottomLeftRadius),
401
+ borderBottomRightRadius: padBorderRadius(borderBottomRightRadius)
394
402
  };
395
403
  }
396
404
 
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_element","_components","_compose","_icons","_i18n","_dom","_utils","_hooks","_jsxRuntime","DEFAULT_INNER_PADDING","PERCENTAGE_WIDTHS","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","useSelect","select","getBlockParentsByBlockName","wasBlockJustInserted","blockEditorStore","length","__unstableMarkNextChangeAsNotPersistent","useDispatch","useEffect","borderRadius","border","radius","borderProps","useBorderProps","colorProps","useColorProps","fluidTypographySettings","layout","useSettings","typographyProps","useTypographyProps","typography","fluid","wideSize","unitControlInstanceId","useInstanceId","UnitControl","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","useRef","buttonRef","units","useCustomUnits","availableUnits","defaultValues","PC_WIDTH_DEFAULT","px","PX_WIDTH_DEFAULT","getBlockClassNames","clsx","undefined","buttonPositionControls","__","value","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","textDecoration","jsx","type","onChange","event","target","ref","renderButton","buttonClasses","__experimentalGetElementClassName","buttonStyles","handleButtonClick","jsxs","Fragment","children","stripHTML","onClick","Icon","icon","search","RichText","identifier","withoutInteractiveFormatting","html","dropdownMenuProps","useToolsPanelDropdownMenuProps","controls","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked","SelectControl","__next40pxDefaultSize","options","__experimentalVStack","__experimentalUnitControl","id","min","isPercentageUnit","MIN_WIDTH","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","__experimentalToggleGroupControl","includes","hideLabelFromVision","isBlock","map","widthValue","__experimentalToggleGroupControlOption","sprintf","padBorderRadius","getWrapperStyles","styles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","isNonZeroBorderRadius","topLeft","topRight","bottomLeft","bottomRight","Number","isInteger","blockProps","useBlockProps","labelClassnames","ResizableBox","size","height","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tSelectControl,\n\tToggleControl,\n\tResizableBox,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\nconst PERCENTAGE_WIDTHS = [ 25, 50, 75, 100 ];\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst wasJustInsertedIntoNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( wasJustInsertedIntoNavigationBlock ) {\n\t\t\t// This side-effect should not create an undo level.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tshowLabel: false,\n\t\t\t\tbuttonUseIcon: true,\n\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t} );\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\twasJustInsertedIntoNavigationBlock,\n\t\tsetAttributes,\n\t] );\n\n\tconst borderRadius = style?.border?.radius;\n\tlet borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps = {\n\t\t\t...borderProps,\n\t\t\tstyle: {\n\t\t\t\t...borderProps.style,\n\t\t\t\tborderRadius: `${ borderRadius }px`,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst colorProps = useColorProps( attributes );\n\tconst [ fluidTypographySettings, layout ] = useSettings(\n\t\t'typography.fluid',\n\t\t'layout'\n\t);\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn clsx(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\tlabel: __( 'Button outside' ),\n\t\t\tvalue: 'button-outside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button inside' ),\n\t\t\tvalue: 'button-inside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'No button' ),\n\t\t\tvalue: 'no-button',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button only' ),\n\t\t\tvalue: 'button-only',\n\t\t},\n\t];\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = clsx(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t\t...typographyProps.style,\n\t\t\ttextDecoration: undefined,\n\t\t};\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tclassName={ textFieldClasses }\n\t\t\t\tstyle={ textFieldStyles }\n\t\t\t\taria-label={ __( 'Optional placeholder text' ) }\n\t\t\t\t// We hide the placeholder field's placeholder when there is a value. This\n\t\t\t\t// stops screen readers from reading the placeholder field's placeholder\n\t\t\t\t// which is confusing.\n\t\t\t\tplaceholder={\n\t\t\t\t\tplaceholder ? undefined : __( 'Optional placeholder…' )\n\t\t\t\t}\n\t\t\t\tvalue={ placeholder }\n\t\t\t\tonChange={ ( event ) =>\n\t\t\t\t\tsetAttributes( { placeholder: event.target.value } )\n\t\t\t\t}\n\t\t\t\tref={ searchFieldRef }\n\t\t\t/>\n\t\t);\n\t};\n\n\tconst renderButton = () => {\n\t\t// If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button.\n\t\tconst buttonClasses = clsx(\n\t\t\t'wp-block-search__button',\n\t\t\tcolorProps.className,\n\t\t\ttypographyProps.className,\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\tbuttonUseIcon ? 'has-icon' : undefined,\n\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t);\n\t\tconst buttonStyles = {\n\t\t\t...colorProps.style,\n\t\t\t...typographyProps.style,\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? { borderRadius }\n\t\t\t\t: borderProps.style ),\n\t\t};\n\t\tconst handleButtonClick = () => {\n\t\t\tif ( hasOnlyButton ) {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tisSearchFieldHidden: ! isSearchFieldHidden,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ buttonUseIcon && (\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\tbuttonText\n\t\t\t\t\t\t\t\t? stripHTML( buttonText )\n\t\t\t\t\t\t\t\t: __( 'Search' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t\tref={ buttonRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon icon={ search } />\n\t\t\t\t\t</button>\n\t\t\t\t) }\n\n\t\t\t\t{ ! buttonUseIcon && (\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"buttonText\"\n\t\t\t\t\t\tclassName={ buttonClasses }\n\t\t\t\t\t\tstyle={ buttonStyles }\n\t\t\t\t\t\taria-label={ __( 'Button text' ) }\n\t\t\t\t\t\tplaceholder={ __( 'Add button text…' ) }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tvalue={ buttonText }\n\t\t\t\t\t\tonChange={ ( html ) =>\n\t\t\t\t\t\t\tsetAttributes( { buttonText: html } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t};\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst controls = (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => ! showLabel }\n\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tshowLabel: true,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tchecked={ showLabel }\n\t\t\t\t\t\t\tlabel={ __( 'Show label' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tshowLabel: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => buttonPosition !== 'button-outside' }\n\t\t\t\t\t\tlabel={ __( 'Button position' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tbuttonPosition: 'button-outside',\n\t\t\t\t\t\t\t\tisSearchFieldHidden: false,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tvalue={ buttonPosition }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Button position' ) }\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonPosition: value,\n\t\t\t\t\t\t\t\t\tisSearchFieldHidden:\n\t\t\t\t\t\t\t\t\t\tvalue === 'button-only',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\toptions={ buttonPositionControls }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ buttonPosition !== 'no-button' && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => !! buttonUseIcon }\n\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tbuttonUseIcon: false,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tchecked={ buttonUseIcon }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use button with icon' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tbuttonUseIcon: value,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! width }\n\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\t\twidthUnit: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack>\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\t\tid={ unitControlInputId } // Unused, kept for backwards compatibility\n\t\t\t\t\t\t\t\tmin={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t\t\t\t: MIN_WIDTH\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\t\tisPercentageUnit( widthUnit )\n\t\t\t\t\t\t\t\t\t\t? 100\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tstep={ 1 }\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tconst parsedNewWidth =\n\t\t\t\t\t\t\t\t\t\tnewWidth === ''\n\t\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t\t: parseInt( newWidth, 10 );\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: parsedNewWidth,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tonUnitChange={ ( newUnit ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\t'%' === newUnit\n\t\t\t\t\t\t\t\t\t\t\t\t? PC_WIDTH_DEFAULT\n\t\t\t\t\t\t\t\t\t\t\t\t: PX_WIDTH_DEFAULT,\n\t\t\t\t\t\t\t\t\t\twidthUnit: newUnit,\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\tvalue={ `${ width }${ widthUnit }` }\n\t\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Percentage Width' ) }\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tPERCENTAGE_WIDTHS.includes( width ) &&\n\t\t\t\t\t\t\t\t\twidthUnit === '%'\n\t\t\t\t\t\t\t\t\t\t? width\n\t\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\tonChange={ ( newWidth ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\twidth: newWidth,\n\t\t\t\t\t\t\t\t\t\twidthUnit: '%',\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ PERCENTAGE_WIDTHS.map( ( widthValue ) => {\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\tkey={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tvalue={ widthValue }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t/* translators: %d: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\t\t\twidthValue\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst padBorderRadius = ( radius ) =>\n\t\tradius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;\n\n\tconst getWrapperStyles = () => {\n\t\tconst styles = isButtonPositionInside\n\t\t\t? borderProps.style\n\t\t\t: {\n\t\t\t\t\tborderRadius: borderProps.style?.borderRadius,\n\t\t\t\t\tborderTopLeftRadius: borderProps.style?.borderTopLeftRadius,\n\t\t\t\t\tborderTopRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderTopRightRadius,\n\t\t\t\t\tborderBottomLeftRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomLeftRadius,\n\t\t\t\t\tborderBottomRightRadius:\n\t\t\t\t\t\tborderProps.style?.borderBottomRightRadius,\n\t\t\t };\n\n\t\tconst isNonZeroBorderRadius =\n\t\t\tborderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;\n\n\t\tif ( isButtonPositionInside && isNonZeroBorderRadius ) {\n\t\t\t// We have button inside wrapper and a border radius value to apply.\n\t\t\t// Add default padding so we don't get \"fat\" corners.\n\t\t\t//\n\t\t\t// CSS calc() is used here to support non-pixel units. The inline\n\t\t\t// style using calc() will only apply if both values have units.\n\n\t\t\tif ( typeof borderRadius === 'object' ) {\n\t\t\t\t// Individual corner border radii present.\n\t\t\t\tconst { topLeft, topRight, bottomLeft, bottomRight } =\n\t\t\t\t\tborderRadius;\n\n\t\t\t\treturn {\n\t\t\t\t\t...styles,\n\t\t\t\t\tborderTopLeftRadius: padBorderRadius( topLeft ),\n\t\t\t\t\tborderTopRightRadius: padBorderRadius( topRight ),\n\t\t\t\t\tborderBottomLeftRadius: padBorderRadius( bottomLeft ),\n\t\t\t\t\tborderBottomRightRadius: padBorderRadius( bottomRight ),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t// The inline style using calc() will only apply if both values\n\t\t\t// supplied to calc() have units. Deprecated block's may have\n\t\t\t// unitless integer.\n\t\t\tconst radius = Number.isInteger( borderRadius )\n\t\t\t\t? `${ borderRadius }px`\n\t\t\t\t: borderRadius;\n\n\t\t\tstyles.borderRadius = `calc(${ radius } + ${ DEFAULT_INNER_PADDING })`;\n\t\t}\n\n\t\treturn styles;\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: getBlockClassNames(),\n\t\tstyle: {\n\t\t\t...typographyProps.style,\n\t\t\t// Input opts out of text decoration.\n\t\t\ttextDecoration: undefined,\n\t\t},\n\t} );\n\n\tconst labelClassnames = clsx(\n\t\t'wp-block-search__label',\n\t\ttypographyProps.className\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\n\t\t\t{ showLabel && (\n\t\t\t\t<RichText\n\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\tclassName={ labelClassnames }\n\t\t\t\t\taria-label={ __( 'Label text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add label…' ) }\n\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\tvalue={ label }\n\t\t\t\t\tonChange={ ( html ) => setAttributes( { label: html } ) }\n\t\t\t\t\tstyle={ typographyProps.style }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth:\n\t\t\t\t\t\twidth === undefined\n\t\t\t\t\t\t\t? 'auto'\n\t\t\t\t\t\t\t: `${ width }${ widthUnit }`,\n\t\t\t\t\theight: 'auto',\n\t\t\t\t} }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'wp-block-search__inside-wrapper',\n\t\t\t\t\tisButtonPositionInside ? borderProps.className : undefined\n\t\t\t\t) }\n\t\t\t\tstyle={ getWrapperStyles() }\n\t\t\t\tminWidth={ MIN_WIDTH }\n\t\t\t\tenable={ getResizableSides() }\n\t\t\t\tonResizeStart={ ( event, direction, elt ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( elt.offsetWidth, 10 ),\n\t\t\t\t\t\twidthUnit: 'px',\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( width + delta.width, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected }\n\t\t\t>\n\t\t\t\t{ ( isButtonPositionInside ||\n\t\t\t\t\tisButtonPositionOutside ||\n\t\t\t\t\thasOnlyButton ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ renderTextField() }\n\t\t\t\t\t\t{ renderButton() }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t{ hasNoButton && renderTextField() }\n\t\t\t</ResizableBox>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAWA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAYA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AAMA,IAAAU,MAAA,GAAAV,OAAA;AAAgE,IAAAW,WAAA,GAAAX,OAAA;AA/ChE;AACA;AACA;;AAGA;AACA;AACA;;AA+BA;AACA;AACA;;AASA;AACA;AACA,MAAMY,qBAAqB,GAAG,KAAK;AACnC,MAAMC,iBAAiB,GAAG,CAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAE;AAE9B,SAASC,UAAUA,CAAE;EACnCC,SAAS;EACTC,UAAU;EACVC,aAAa;EACbC,eAAe;EACfC,UAAU;EACVC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,KAAK;IACLC,SAAS;IACTC,WA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,CAACxJ,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACH+J,UAAU,EAAG9J,UAAY;MAAAkF,QAAA,GAEvB,CAAExC,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb,IAAArD,WAAA,CAAAwF,IAAA,EAAAxF,WAAA,CAAAyF,QAAA;QAAAC,QAAA,GACGjB,eAAe,CAAC,CAAC,EACjBU,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAEC/B,WAAW,IAAIqB,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_data","_element","_components","_compose","_icons","_i18n","_dom","_utils","_hooks","_jsxRuntime","DEFAULT_INNER_PADDING","PERCENTAGE_WIDTHS","SearchEdit","className","attributes","setAttributes","toggleSelection","isSelected","clientId","label","showLabel","placeholder","width","widthUnit","align","buttonText","buttonPosition","buttonUseIcon","isSearchFieldHidden","style","wasJustInsertedIntoNavigationBlock","useSelect","select","getBlockParentsByBlockName","wasBlockJustInserted","blockEditorStore","length","__unstableMarkNextChangeAsNotPersistent","useDispatch","useEffect","borderRadius","border","radius","borderProps","useBorderProps","colorProps","useColorProps","fluidTypographySettings","layout","useSettings","typographyProps","useTypographyProps","typography","fluid","wideSize","unitControlInstanceId","useInstanceId","UnitControl","unitControlInputId","isButtonPositionInside","isButtonPositionOutside","hasNoButton","hasOnlyButton","searchFieldRef","useRef","buttonRef","units","useCustomUnits","availableUnits","defaultValues","PC_WIDTH_DEFAULT","px","PX_WIDTH_DEFAULT","getBlockClassNames","clsx","undefined","buttonPositionControls","__","value","getResizableSides","right","left","renderTextField","textFieldClasses","textFieldStyles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","textDecoration","jsx","type","onChange","event","target","ref","renderButton","buttonClasses","__experimentalGetElementClassName","buttonStyles","handleButtonClick","jsxs","Fragment","children","stripHTML","onClick","Icon","icon","search","RichText","identifier","withoutInteractiveFormatting","html","dropdownMenuProps","useToolsPanelDropdownMenuProps","controls","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked","SelectControl","__next40pxDefaultSize","options","__experimentalVStack","__experimentalUnitControl","id","min","isPercentageUnit","MIN_WIDTH","max","step","newWidth","parsedNewWidth","parseInt","onUnitChange","newUnit","__unstableInputWidth","__experimentalToggleGroupControl","includes","hideLabelFromVision","isBlock","map","widthValue","__experimentalToggleGroupControlOption","sprintf","isNonZeroBorderRadius","padBorderRadius","getWrapperStyles","styles","Number","isInteger","blockProps","useBlockProps","labelClassnames","ResizableBox","size","height","minWidth","enable","onResizeStart","direction","elt","offsetWidth","onResizeStop","delta","showHandle"],"sources":["@wordpress/block-library/src/search/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseBlockProps,\n\tInspectorControls,\n\tRichText,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalUseColorProps as useColorProps,\n\tgetTypographyClassesAndStyles as useTypographyProps,\n\tstore as blockEditorStore,\n\t__experimentalGetElementClassName,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tSelectControl,\n\tToggleControl,\n\tResizableBox,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { Icon, search } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPC_WIDTH_DEFAULT,\n\tPX_WIDTH_DEFAULT,\n\tMIN_WIDTH,\n\tisPercentageUnit,\n} from './utils.js';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n// Used to calculate border radius adjustment to avoid \"fat\" corners when\n// button is placed inside wrapper.\nconst DEFAULT_INNER_PADDING = '4px';\nconst PERCENTAGE_WIDTHS = [ 25, 50, 75, 100 ];\n\nexport default function SearchEdit( {\n\tclassName,\n\tattributes,\n\tsetAttributes,\n\ttoggleSelection,\n\tisSelected,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\tshowLabel,\n\t\tplaceholder,\n\t\twidth,\n\t\twidthUnit,\n\t\talign,\n\t\tbuttonText,\n\t\tbuttonPosition,\n\t\tbuttonUseIcon,\n\t\tisSearchFieldHidden,\n\t\tstyle,\n\t} = attributes;\n\n\tconst wasJustInsertedIntoNavigationBlock = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParentsByBlockName, wasBlockJustInserted } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn (\n\t\t\t\t!! getBlockParentsByBlockName( clientId, 'core/navigation' )\n\t\t\t\t\t?.length && wasBlockJustInserted( clientId )\n\t\t\t);\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( wasJustInsertedIntoNavigationBlock ) {\n\t\t\t// This side-effect should not create an undo level.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tshowLabel: false,\n\t\t\t\tbuttonUseIcon: true,\n\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t} );\n\t\t}\n\t}, [\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\twasJustInsertedIntoNavigationBlock,\n\t\tsetAttributes,\n\t] );\n\n\tconst borderRadius = style?.border?.radius;\n\tlet borderProps = useBorderProps( attributes );\n\n\t// Check for old deprecated numerical border radius. Done as a separate\n\t// check so that a borderRadius style won't overwrite the longhand\n\t// per-corner styles.\n\tif ( typeof borderRadius === 'number' ) {\n\t\tborderProps = {\n\t\t\t...borderProps,\n\t\t\tstyle: {\n\t\t\t\t...borderProps.style,\n\t\t\t\tborderRadius: `${ borderRadius }px`,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst colorProps = useColorProps( attributes );\n\tconst [ fluidTypographySettings, layout ] = useSettings(\n\t\t'typography.fluid',\n\t\t'layout'\n\t);\n\tconst typographyProps = useTypographyProps( attributes, {\n\t\ttypography: {\n\t\t\tfluid: fluidTypographySettings,\n\t\t},\n\t\tlayout: {\n\t\t\twideSize: layout?.wideSize,\n\t\t},\n\t} );\n\tconst unitControlInstanceId = useInstanceId( UnitControl );\n\tconst unitControlInputId = `wp-block-search__width-${ unitControlInstanceId }`;\n\tconst isButtonPositionInside = 'button-inside' === buttonPosition;\n\tconst isButtonPositionOutside = 'button-outside' === buttonPosition;\n\tconst hasNoButton = 'no-button' === buttonPosition;\n\tconst hasOnlyButton = 'button-only' === buttonPosition;\n\tconst searchFieldRef = useRef();\n\tconst buttonRef = useRef();\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: [ '%', 'px' ],\n\t\tdefaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT },\n\t} );\n\n\tuseEffect( () => {\n\t\tif ( hasOnlyButton && ! isSelected ) {\n\t\t\tsetAttributes( {\n\t\t\t\tisSearchFieldHidden: true,\n\t\t\t} );\n\t\t}\n\t}, [ hasOnlyButton, isSelected, setAttributes ] );\n\n\t// Show the search field when width changes.\n\tuseEffect( () => {\n\t\tif ( ! hasOnlyButton || ! isSelected ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tisSearchFieldHidden: false,\n\t\t} );\n\t}, [ hasOnlyButton, isSelected, setAttributes, width ] );\n\n\tconst getBlockClassNames = () => {\n\t\treturn clsx(\n\t\t\tclassName,\n\t\t\tisButtonPositionInside\n\t\t\t\t? 'wp-block-search__button-inside'\n\t\t\t\t: undefined,\n\t\t\tisButtonPositionOutside\n\t\t\t\t? 'wp-block-search__button-outside'\n\t\t\t\t: undefined,\n\t\t\thasNoButton ? 'wp-block-search__no-button' : undefined,\n\t\t\thasOnlyButton ? 'wp-block-search__button-only' : undefined,\n\t\t\t! buttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__text-button'\n\t\t\t\t: undefined,\n\t\t\tbuttonUseIcon && ! hasNoButton\n\t\t\t\t? 'wp-block-search__icon-button'\n\t\t\t\t: undefined,\n\t\t\thasOnlyButton && isSearchFieldHidden\n\t\t\t\t? 'wp-block-search__searchfield-hidden'\n\t\t\t\t: undefined\n\t\t);\n\t};\n\n\tconst buttonPositionControls = [\n\t\t{\n\t\t\tlabel: __( 'Button outside' ),\n\t\t\tvalue: 'button-outside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button inside' ),\n\t\t\tvalue: 'button-inside',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'No button' ),\n\t\t\tvalue: 'no-button',\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Button only' ),\n\t\t\tvalue: 'button-only',\n\t\t},\n\t];\n\n\tconst getResizableSides = () => {\n\t\tif ( hasOnlyButton ) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tright: align !== 'right',\n\t\t\tleft: align === 'right',\n\t\t};\n\t};\n\n\tconst renderTextField = () => {\n\t\t// If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control.\n\t\tconst textFieldClasses = clsx(\n\t\t\t'wp-block-search__input',\n\t\t\tisButtonPositionInside ? undefined : borderProps.className,\n\t\t\ttypographyProps.className\n\t\t);\n\t\tconst textFieldStyles = {\n\t\t\t...( isButtonPositionInside\n\t\t\t\t? {\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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B,GAAG,CAACC,WAAW,EAAE,EAAG,CAAC;UACtCjJ,SAAS,EAAE;QACZ,CAAE,CAAC;QACHP,eAAe,CAAE,KAAM,CAAC;MACzB,CAAG;MACHyJ,YAAY,EAAGA,CAAE5E,KAAK,EAAEyE,SAAS,EAAEC,GAAG,EAAEG,KAAK,KAAM;QAClD3J,aAAa,CAAE;UACdO,KAAK,EAAEqH,QAAQ,CAAErH,KAAK,GAAGoJ,KAAK,CAACpJ,KAAK,EAAE,EAAG;QAC1C,CAAE,CAAC;QACHN,eAAe,CAAE,IAAK,CAAC;MACxB,CAAG;MACH2J,UAAU,EAAG1J,UAAY;MAAAsF,QAAA,GAEvB,CAAE5C,sBAAsB,IACzBC,uBAAuB,IACvBE,aAAa,kBACb,IAAArD,WAAA,CAAA4F,IAAA,EAAA5F,WAAA,CAAA6F,QAAA;QAAAC,QAAA,GACGrB,eAAe,CAAC,CAAC,EACjBc,YAAY,CAAC,CAAC;MAAA,CACf,CACF,EAECnC,WAAW,IAAIqB,eAAe,CAAC,CAAC;IAAA,CACrB,CAAC;EAAA,CACX,CAAC;AAER","ignoreList":[]}
@@ -17,12 +17,13 @@ import clsx from 'clsx';
17
17
  import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
18
18
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  export default function Edit({
20
- attributes: {
21
- openByDefault
22
- },
20
+ attributes,
23
21
  clientId,
24
22
  setAttributes
25
23
  }) {
24
+ const {
25
+ openByDefault
26
+ } = attributes;
26
27
  const dropdownMenuProps = useToolsPanelDropdownMenuProps();
27
28
  const {
28
29
  isSelected,
@@ -51,13 +52,12 @@ export default function Edit({
51
52
  });
52
53
  }
53
54
  }, [isSelected, contentBlockClientId, __unstableMarkNextChangeAsNotPersistent, updateBlockAttributes]);
54
- const blockProps = useBlockProps();
55
- const innerBlocksProps = useInnerBlocksProps({
56
- ...blockProps,
57
- className: clsx(blockProps.className, {
55
+ const blockProps = useBlockProps({
56
+ className: clsx({
58
57
  'is-open': openByDefault || isSelected
59
58
  })
60
- }, {
59
+ });
60
+ const innerBlocksProps = useInnerBlocksProps(blockProps, {
61
61
  template: [['core/accordion-header', {}], ['core/accordion-panel', {
62
62
  openByDefault
63
63
  }]],
@@ -1 +1 @@
1
- {"version":3,"names":["__","useBlockProps","useInnerBlocksProps","InspectorControls","store","blockEditorStore","useDispatch","useSelect","useEffect","ToggleControl","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","clsx","useToolsPanelDropdownMenuProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","attributes","openByDefault","clientId","setAttributes","dropdownMenuProps","isSelected","getBlockOrder","select","isBlockSelected","hasSelectedInnerBlock","getBlockOrderSelector","contentBlockClientId","updateBlockAttributes","__unstableMarkNextChangeAsNotPersistent","blockProps","innerBlocksProps","className","template","templateLock","directInsert","templateInsertUpdatesSelection","children","label","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","onChange","value","checked","help"],"sources":["@wordpress/block-library/src/accordion-content/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function Edit( {\n\tattributes: { openByDefault },\n\tclientId,\n\tsetAttributes,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst { isSelected, getBlockOrder } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockSelected,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockOrder: getBlockOrderSelector,\n\t\t\t} = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tisSelected:\n\t\t\t\t\tisBlockSelected( clientId ) ||\n\t\t\t\t\thasSelectedInnerBlock( clientId, true ),\n\t\t\t\tgetBlockOrder: getBlockOrderSelector,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst contentBlockClientId = getBlockOrder( clientId )[ 1 ];\n\tconst { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( contentBlockClientId ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateBlockAttributes( contentBlockClientId, {\n\t\t\t\tisSelected,\n\t\t\t} );\n\t\t}\n\t}, [\n\t\tisSelected,\n\t\tcontentBlockClientId,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tupdateBlockAttributes,\n\t] );\n\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\t...blockProps,\n\t\t\tclassName: clsx( blockProps.className, {\n\t\t\t\t'is-open': openByDefault || isSelected,\n\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\ttemplate: [\n\t\t\t\t[ 'core/accordion-header', {} ],\n\t\t\t\t[\n\t\t\t\t\t'core/accordion-panel',\n\t\t\t\t\t{\n\t\t\t\t\t\topenByDefault,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t],\n\t\t\ttemplateLock: 'all',\n\t\t\tdirectInsert: true,\n\t\t\ttemplateInsertUpdatesSelection: true,\n\t\t}\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls key=\"setting\">\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( { openByDefault: false } );\n\t\t\t\t\t\tif ( contentBlockClientId ) {\n\t\t\t\t\t\t\tupdateBlockAttributes( contentBlockClientId, {\n\t\t\t\t\t\t\t\topenByDefault: false,\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\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Open by default' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! openByDefault }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( { openByDefault: false } );\n\t\t\t\t\t\t\tif ( contentBlockClientId ) {\n\t\t\t\t\t\t\t\tupdateBlockAttributes( contentBlockClientId, {\n\t\t\t\t\t\t\t\t\topenByDefault: 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} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Open by default' ) }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\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\topenByDefault: value,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tif ( contentBlockClientId ) {\n\t\t\t\t\t\t\t\t\tupdateBlockAttributes(\n\t\t\t\t\t\t\t\t\t\tcontentBlockClientId,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\topenByDefault: value,\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} }\n\t\t\t\t\t\t\tchecked={ openByDefault }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Accordion content will be displayed by default.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,cAAc;UACdgC,KAAK,EAAG7C,EAAE,CAAE,iBAAkB,CAAG;UACjC+C,gBAAgB;UAChBC,QAAQ,EAAGA,CAAA,KAAM,CAAC,CAAExB,aAAe;UACnCyB,UAAU,EAAGA,CAAA,KAAM;YAClBvB,aAAa,CAAE;cAAEF,aAAa,EAAE;YAAM,CAAE,CAAC;YACzC,IAAKU,oBAAoB,EAAG;cAC3BC,qBAAqB,CAAED,oBAAoB,EAAE;gBAC5CV,aAAa,EAAE;cAChB,CAAE,CAAC;YACJ;UACD,CAAG;UAAAoB,QAAA,eAEH3B,IAAA,CAACR,aAAa;YACboC,KAAK,EAAG7C,EAAE,CAAE,iBAAkB,CAAG;YACjCkD,uBAAuB;YACvBC,QAAQ,EAAKC,KAAK,IAAM;cACvB1B,aAAa,CAAE;gBACdF,aAAa,EAAE4B;cAChB,CAAE,CAAC;cACH,IAAKlB,oBAAoB,EAAG;gBAC3BC,qBAAqB,CACpBD,oBAAoB,EACpB;kBACCV,aAAa,EAAE4B;gBAChB,CACD,CAAC;cACF;YACD,CAAG;YACHC,OAAO,EAAG7B,aAAe;YACzB8B,IAAI,EAAGtD,EAAE,CACR,iDACD;UAAG,CACH;QAAC,CACa;MAAC,CACN;IAAC,GAhDS,SAiDJ,CAAC,eACpBiB,IAAA;MAAA,GAAUqB;IAAgB,CAAI,CAAC;EAAA,CAC9B,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","useBlockProps","useInnerBlocksProps","InspectorControls","store","blockEditorStore","useDispatch","useSelect","useEffect","ToggleControl","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","clsx","useToolsPanelDropdownMenuProps","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Edit","attributes","clientId","setAttributes","openByDefault","dropdownMenuProps","isSelected","getBlockOrder","select","isBlockSelected","hasSelectedInnerBlock","getBlockOrderSelector","contentBlockClientId","updateBlockAttributes","__unstableMarkNextChangeAsNotPersistent","blockProps","className","innerBlocksProps","template","templateLock","directInsert","templateInsertUpdatesSelection","children","label","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","onChange","value","checked","help"],"sources":["@wordpress/block-library/src/accordion-content/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function Edit( { attributes, clientId, setAttributes } ) {\n\tconst { openByDefault } = attributes;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst { isSelected, getBlockOrder } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockSelected,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockOrder: getBlockOrderSelector,\n\t\t\t} = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tisSelected:\n\t\t\t\t\tisBlockSelected( clientId ) ||\n\t\t\t\t\thasSelectedInnerBlock( clientId, true ),\n\t\t\t\tgetBlockOrder: getBlockOrderSelector,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst contentBlockClientId = getBlockOrder( clientId )[ 1 ];\n\tconst { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tuseEffect( () => {\n\t\tif ( contentBlockClientId ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateBlockAttributes( contentBlockClientId, {\n\t\t\t\tisSelected,\n\t\t\t} );\n\t\t}\n\t}, [\n\t\tisSelected,\n\t\tcontentBlockClientId,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tupdateBlockAttributes,\n\t] );\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t'is-open': openByDefault || isSelected,\n\t\t} ),\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: [\n\t\t\t[ 'core/accordion-header', {} ],\n\t\t\t[\n\t\t\t\t'core/accordion-panel',\n\t\t\t\t{\n\t\t\t\t\topenByDefault,\n\t\t\t\t},\n\t\t\t],\n\t\t],\n\t\ttemplateLock: 'all',\n\t\tdirectInsert: true,\n\t\ttemplateInsertUpdatesSelection: true,\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls key=\"setting\">\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( { openByDefault: false } );\n\t\t\t\t\t\tif ( contentBlockClientId ) {\n\t\t\t\t\t\t\tupdateBlockAttributes( contentBlockClientId, {\n\t\t\t\t\t\t\t\topenByDefault: false,\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\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Open by default' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! openByDefault }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tsetAttributes( { openByDefault: false } );\n\t\t\t\t\t\t\tif ( contentBlockClientId ) {\n\t\t\t\t\t\t\t\tupdateBlockAttributes( contentBlockClientId, {\n\t\t\t\t\t\t\t\t\topenByDefault: 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} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Open by default' ) }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\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\topenByDefault: value,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tif ( contentBlockClientId ) {\n\t\t\t\t\t\t\t\t\tupdateBlockAttributes(\n\t\t\t\t\t\t\t\t\t\tcontentBlockClientId,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\topenByDefault: value,\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} }\n\t\t\t\t\t\t\tchecked={ openByDefault }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Accordion content will be displayed by default.'\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</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,aAAa,EACbC,mBAAmB,EACnBC,iBAAiB,EACjBC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SACCC,aAAa,EACbC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B;AACA;AACA;AACA,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,I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CAAC;cACF;YACD,CAAG;YACHC,OAAO,EAAG3B,aAAe;YACzB4B,IAAI,EAAGtD,EAAE,CACR,iDACD;UAAG,CACH;QAAC,CACa;MAAC,CACN;IAAC,GAhDS,SAiDJ,CAAC,eACpBiB,IAAA;MAAA,GAAUsB;IAAgB,CAAI,CAAC;EAAA,CAC9B,CAAC;AAEL","ignoreList":[]}
@@ -35,7 +35,8 @@ const metadata = {
35
35
  width: true
36
36
  }
37
37
  },
38
- shadow: true
38
+ shadow: true,
39
+ layout: true
39
40
  },
40
41
  attributes: {
41
42
  openByDefault: {
@@ -1 +1 @@
1
- {"version":3,"names":["edit","save","metadata","$schema","apiVersion","name","title","category","description","__experimental","parent","allowedBlocks","supports","color","background","gradient","interactivity","spacing","margin","blockGap","__experimentalBorder","radius","style","width","__experimentalDefaultControls","shadow","attributes","openByDefault","type","textdomain","initBlock","icon","settings","init"],"sources":["@wordpress/block-library/src/accordion-content/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport save from './save';\nimport metadata from './block.json';\nimport initBlock from '../utils/init-block';\nimport icon from './icon';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,QAAQ;AACzB,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,cAAA;EAAAC,MAAA;EAAAC,aAAA;EAAAC,QAAA;IAAAC,KAAA;MAAAC,UAAA;MAAAC,QAAA;IAAA;IAAAC,aAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,QAAA;IAAA;IAAAC,oBAAA;MAAAP,KAAA;MAAAQ,MAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAC,6BAAA;QAAAX,KAAA;QAAAQ,MAAA;QAAAC,KAAA;QAAAC,KAAA;MAAA;IAAA;IAAAE,MAAA;EAAA;EAAAC,UAAA;IAAAC,aAAA;MAAAC,IAAA;MAAA;IAAA;EAAA;EAAAC,UAAA;AAAA;AAE1B,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAE1B;AAAK,CAAC,GAAGH,QAAQ;AAEzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAM2B,QAAQ,GAAG;EACvBD,IAAI;EACJ/B,IAAI;EACJC;AACD,CAAC;AAED,OAAO,MAAMgC,IAAI,GAAGA,CAAA,KAAMH,SAAS,CAAE;EAAEzB,IAAI;EAAEH,QAAQ;EAAE8B;AAAS,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["edit","save","metadata","$schema","apiVersion","name","title","category","description","__experimental","parent","allowedBlocks","supports","color","background","gradient","interactivity","spacing","margin","blockGap","__experimentalBorder","radius","style","width","__experimentalDefaultControls","shadow","layout","attributes","openByDefault","type","textdomain","initBlock","icon","settings","init"],"sources":["@wordpress/block-library/src/accordion-content/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport save from './save';\nimport metadata from './block.json';\nimport initBlock from '../utils/init-block';\nimport icon from './icon';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,QAAQ;AACzB,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,cAAA;EAAAC,MAAA;EAAAC,aAAA;EAAAC,QAAA;IAAAC,KAAA;MAAAC,UAAA;MAAAC,QAAA;IAAA;IAAAC,aAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,QAAA;IAAA;IAAAC,oBAAA;MAAAP,KAAA;MAAAQ,MAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAC,6BAAA;QAAAX,KAAA;QAAAQ,MAAA;QAAAC,KAAA;QAAAC,KAAA;MAAA;IAAA;IAAAE,MAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAC,aAAA;MAAAC,IAAA;MAAA;IAAA;EAAA;EAAAC,UAAA;AAAA;AAE1B,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAE3B;AAAK,CAAC,GAAGH,QAAQ;AAEzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAM4B,QAAQ,GAAG;EACvBD,IAAI;EACJhC,IAAI;EACJC;AACD,CAAC;AAED,OAAO,MAAMiC,IAAI,GAAGA,CAAA,KAAMH,SAAS,CAAE;EAAE1B,IAAI;EAAEH,QAAQ;EAAE+B;AAAS,CAAE,CAAC","ignoreList":[]}
@@ -52,7 +52,8 @@ const metadata = {
52
52
  fontSize: true
53
53
  }
54
54
  },
55
- shadow: true
55
+ shadow: true,
56
+ layout: true
56
57
  },
57
58
  attributes: {
58
59
  allowedBlocks: {
@@ -1 +1 @@
1
- {"version":3,"names":["edit","save","metadata","$schema","apiVersion","name","title","category","description","__experimental","parent","supports","color","background","gradient","interactivity","spacing","padding","margin","blockGap","__experimentalDefaultControls","__experimentalBorder","radius","style","width","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","shadow","attributes","allowedBlocks","type","templateLock","openByDefault","isSelected","textdomain","initBlock","icon","settings","init"],"sources":["@wordpress/block-library/src/accordion-panel/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport save from './save';\nimport metadata from './block.json';\nimport initBlock from '../utils/init-block';\nimport icon from './icon';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,QAAQ;AACzB,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,cAAA;EAAAC,MAAA;EAAAC,QAAA;IAAAC,KAAA;MAAAC,UAAA;MAAAC,QAAA;IAAA;IAAAC,aAAA;IAAAC,OAAA;MAAAC,OAAA;MAAAC,MAAA;MAAAC,QAAA;MAAAC,6BAAA;QAAAH,OAAA;QAAAE,QAAA;MAAA;IAAA;IAAAE,oBAAA;MAAAT,KAAA;MAAAU,MAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAJ,6BAAA;QAAAR,KAAA;QAAAU,MAAA;QAAAC,KAAA;QAAAC,KAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAb,6BAAA;QAAAM,QAAA;MAAA;IAAA;IAAAQ,MAAA;EAAA;EAAAC,UAAA;IAAAC,aAAA;MAAAC,IAAA;IAAA;IAAAC,YAAA;MAAAD,IAAA;MAAA;MAAA;IAAA;IAAAE,aAAA;MAAAF,IAAA;MAAA;IAAA;IAAAG,UAAA;MAAAH,IAAA;MAAA;IAAA;EAAA;EAAAI,UAAA;AAAA;AAE1B,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAEtC;AAAK,CAAC,GAAGH,QAAQ;AAEzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAMuC,QAAQ,GAAG;EACvBD,IAAI;EACJ3C,IAAI;EACJC;AACD,CAAC;AAED,OAAO,MAAM4C,IAAI,GAAGA,CAAA,KAAMH,SAAS,CAAE;EAAErC,IAAI;EAAEH,QAAQ;EAAE0C;AAAS,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["edit","save","metadata","$schema","apiVersion","name","title","category","description","__experimental","parent","supports","color","background","gradient","interactivity","spacing","padding","margin","blockGap","__experimentalDefaultControls","__experimentalBorder","radius","style","width","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","shadow","layout","attributes","allowedBlocks","type","templateLock","openByDefault","isSelected","textdomain","initBlock","icon","settings","init"],"sources":["@wordpress/block-library/src/accordion-panel/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport edit from './edit';\nimport save from './save';\nimport metadata from './block.json';\nimport initBlock from '../utils/init-block';\nimport icon from './icon';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n\tsave,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,QAAQ;AACzB,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,cAAA;EAAAC,MAAA;EAAAC,QAAA;IAAAC,KAAA;MAAAC,UAAA;MAAAC,QAAA;IAAA;IAAAC,aAAA;IAAAC,OAAA;MAAAC,OAAA;MAAAC,MAAA;MAAAC,QAAA;MAAAC,6BAAA;QAAAH,OAAA;QAAAE,QAAA;MAAA;IAAA;IAAAE,oBAAA;MAAAT,KAAA;MAAAU,MAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAJ,6BAAA;QAAAR,KAAA;QAAAU,MAAA;QAAAC,KAAA;QAAAC,KAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAb,6BAAA;QAAAM,QAAA;MAAA;IAAA;IAAAQ,MAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAC,aAAA;MAAAC,IAAA;IAAA;IAAAC,YAAA;MAAAD,IAAA;MAAA;MAAA;IAAA;IAAAE,aAAA;MAAAF,IAAA;MAAA;IAAA;IAAAG,UAAA;MAAAH,IAAA;MAAA;IAAA;EAAA;EAAAI,UAAA;AAAA;AAE1B,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,IAAI,MAAM,QAAQ;AAEzB,MAAM;EAAEvC;AAAK,CAAC,GAAGH,QAAQ;AAEzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAMwC,QAAQ,GAAG;EACvBD,IAAI;EACJ5C,IAAI;EACJC;AACD,CAAC;AAED,OAAO,MAAM6C,IAAI,GAAGA,CAAA,KAAMH,SAAS,CAAE;EAAEtC,IAAI;EAAEH,QAAQ;EAAE2C;AAAS,CAAE,CAAC","ignoreList":[]}
@@ -1,5 +1,9 @@
1
1
  export const DEFAULT_BLOCK = {
2
- name: 'core/navigation-link'
2
+ name: 'core/navigation-link',
3
+ attributes: {
4
+ kind: 'post-type',
5
+ type: 'page'
6
+ }
3
7
  };
4
8
  export const PRIORITIZED_INSERTER_BLOCKS = ['core/navigation-link/page', 'core/navigation-link'];
5
9
 
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_BLOCK","name","PRIORITIZED_INSERTER_BLOCKS","PRELOADED_NAVIGATION_MENUS_QUERY","per_page","status","order","orderby","SELECT_NAVIGATION_MENUS_ARGS"],"sources":["@wordpress/block-library/src/navigation/constants.js"],"sourcesContent":["export const DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n};\n\nexport const PRIORITIZED_INSERTER_BLOCKS = [\n\t'core/navigation-link/page',\n\t'core/navigation-link',\n];\n\n// These parameters must be kept aligned with those in\n// lib/compat/wordpress-6.3/navigation-block-preloading.php\n// and\n// edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js\nexport const PRELOADED_NAVIGATION_MENUS_QUERY = {\n\tper_page: 100,\n\tstatus: [ 'publish', 'draft' ],\n\torder: 'desc',\n\torderby: 'date',\n};\n\nexport const SELECT_NAVIGATION_MENUS_ARGS = [\n\t'postType',\n\t'wp_navigation',\n\tPRELOADED_NAVIGATION_MENUS_QUERY,\n];\n"],"mappings":"AAAA,OAAO,MAAMA,aAAa,GAAG;EAC5BC,IAAI,EAAE;AACP,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAG,CAC1C,2BAA2B,EAC3B,sBAAsB,CACtB;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,gCAAgC,GAAG;EAC/CC,QAAQ,EAAE,GAAG;EACbC,MAAM,EAAE,CAAE,SAAS,EAAE,OAAO,CAAE;EAC9BC,KAAK,EAAE,MAAM;EACbC,OAAO,EAAE;AACV,CAAC;AAED,OAAO,MAAMC,4BAA4B,GAAG,CAC3C,UAAU,EACV,eAAe,EACfL,gCAAgC,CAChC","ignoreList":[]}
1
+ {"version":3,"names":["DEFAULT_BLOCK","name","attributes","kind","type","PRIORITIZED_INSERTER_BLOCKS","PRELOADED_NAVIGATION_MENUS_QUERY","per_page","status","order","orderby","SELECT_NAVIGATION_MENUS_ARGS"],"sources":["@wordpress/block-library/src/navigation/constants.js"],"sourcesContent":["export const DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n\tattributes: {\n\t\tkind: 'post-type',\n\t\ttype: 'page',\n\t},\n};\n\nexport const PRIORITIZED_INSERTER_BLOCKS = [\n\t'core/navigation-link/page',\n\t'core/navigation-link',\n];\n\n// These parameters must be kept aligned with those in\n// lib/compat/wordpress-6.3/navigation-block-preloading.php\n// and\n// edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js\nexport const PRELOADED_NAVIGATION_MENUS_QUERY = {\n\tper_page: 100,\n\tstatus: [ 'publish', 'draft' ],\n\torder: 'desc',\n\torderby: 'date',\n};\n\nexport const SELECT_NAVIGATION_MENUS_ARGS = [\n\t'postType',\n\t'wp_navigation',\n\tPRELOADED_NAVIGATION_MENUS_QUERY,\n];\n"],"mappings":"AAAA,OAAO,MAAMA,aAAa,GAAG;EAC5BC,IAAI,EAAE,sBAAsB;EAC5BC,UAAU,EAAE;IACXC,IAAI,EAAE,WAAW;IACjBC,IAAI,EAAE;EACP;AACD,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAG,CAC1C,2BAA2B,EAC3B,sBAAsB,CACtB;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,gCAAgC,GAAG;EAC/CC,QAAQ,EAAE,GAAG;EACbC,MAAM,EAAE,CAAE,SAAS,EAAE,OAAO,CAAE;EAC9BC,KAAK,EAAE,MAAM;EACbC,OAAO,EAAE;AACV,CAAC;AAED,OAAO,MAAMC,4BAA4B,GAAG,CAC3C,UAAU,EACV,eAAe,EACfL,gCAAgC,CAChC","ignoreList":[]}
@@ -7,13 +7,14 @@ import clsx from 'clsx';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { useCallback, useState, useEffect, useRef, Platform } from '@wordpress/element';
10
- import { InspectorControls, useBlockProps, RecursionProvider, useHasRecursion, store as blockEditorStore, withColors, ContrastChecker, getColorClassName, Warning, __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown, __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients, useBlockEditingMode } from '@wordpress/block-editor';
10
+ import { InspectorControls, useBlockProps, RecursionProvider, useHasRecursion, store as blockEditorStore, withColors, ContrastChecker, getColorClassName, Warning, __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown, __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients, useBlockEditingMode, BlockControls } from '@wordpress/block-editor';
11
11
  import { EntityProvider, store as coreStore } from '@wordpress/core-data';
12
12
  import { useDispatch, useSelect } from '@wordpress/data';
13
- import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, __experimentalVStack as VStack, ToggleControl, Button, Spinner, Notice } from '@wordpress/components';
13
+ import { __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, __experimentalVStack as VStack, ToggleControl, Button, Spinner, Notice, ToolbarButton, ToolbarGroup } from '@wordpress/components';
14
14
  import { __ } from '@wordpress/i18n';
15
15
  import { speak } from '@wordpress/a11y';
16
- import { close, Icon } from '@wordpress/icons';
16
+ import { close, Icon, page } from '@wordpress/icons';
17
+ import { createBlock } from '@wordpress/blocks';
17
18
  import { useInstanceId } from '@wordpress/compose';
18
19
 
19
20
  /**
@@ -41,7 +42,50 @@ import AccessibleDescription from './accessible-description';
41
42
  import AccessibleMenuDescription from './accessible-menu-description';
42
43
  import { unlock } from '../../lock-unlock';
43
44
  import { useToolsPanelDropdownMenuProps } from '../../utils/hooks';
45
+ import { DEFAULT_BLOCK } from '../constants';
46
+
47
+ /**
48
+ * Component that renders the Add page button for the Navigation block.
49
+ *
50
+ * @param {Object} props Component props.
51
+ * @param {string} props.clientId Block client ID.
52
+ * @return {JSX.Element|null} The Add page button component or null if not applicable.
53
+ */
44
54
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
55
+ function NavigationAddPageButton({
56
+ clientId
57
+ }) {
58
+ const {
59
+ insertBlock
60
+ } = useDispatch(blockEditorStore);
61
+ const {
62
+ getBlockCount
63
+ } = useSelect(blockEditorStore);
64
+ const onAddPage = useCallback(() => {
65
+ // Get the current number of blocks to insert at the end
66
+ const blockCount = getBlockCount(clientId);
67
+
68
+ // Create a new navigation link block (default block)
69
+ const newBlock = createBlock(DEFAULT_BLOCK.name, {
70
+ kind: DEFAULT_BLOCK.attributes.kind,
71
+ type: DEFAULT_BLOCK.attributes.type
72
+ });
73
+
74
+ // Insert the block at the end of the navigation
75
+ insertBlock(newBlock, blockCount, clientId);
76
+ }, [clientId, insertBlock, getBlockCount]);
77
+ return /*#__PURE__*/_jsx(BlockControls, {
78
+ children: /*#__PURE__*/_jsx(ToolbarGroup, {
79
+ children: /*#__PURE__*/_jsx(ToolbarButton, {
80
+ name: "add-page",
81
+ icon: page,
82
+ title: __('Add page'),
83
+ onClick: onAddPage,
84
+ children: __('Add page')
85
+ })
86
+ })
87
+ });
88
+ }
45
89
  function ColorTools({
46
90
  textColor,
47
91
  setTextColor,
@@ -643,7 +687,9 @@ function Navigation({
643
687
  onSelectNavigationMenu: onSelectNavigationMenu,
644
688
  isLoading: isLoading,
645
689
  blockEditingMode: blockEditingMode
646
- }), blockEditingMode === 'default' && stylingInspectorControls, blockEditingMode === 'default' && isEntityAvailable && /*#__PURE__*/_jsxs(InspectorControls, {
690
+ }), blockEditingMode === 'default' && stylingInspectorControls, blockEditingMode === 'contentOnly' && isEntityAvailable && /*#__PURE__*/_jsx(NavigationAddPageButton, {
691
+ clientId: clientId
692
+ }), blockEditingMode === 'default' && isEntityAvailable && /*#__PURE__*/_jsxs(InspectorControls, {
647
693
  group: "advanced",
648
694
  children: [hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && /*#__PURE__*/_jsx(NavigationMenuNameControl, {}), hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && /*#__PURE__*/_jsx(NavigationMenuDeleteControl, {
649
695
  onDelete: () => {