@wordpress/block-editor 14.19.0 → 14.20.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 (32) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/html-element-control/index.js +1 -1
  3. package/build/components/html-element-control/index.js.map +1 -1
  4. package/build/components/html-element-control/messages.js +2 -0
  5. package/build/components/html-element-control/messages.js.map +1 -1
  6. package/build/components/image-size-control/index.js +5 -6
  7. package/build/components/image-size-control/index.js.map +1 -1
  8. package/build/layouts/flex.js +5 -1
  9. package/build/layouts/flex.js.map +1 -1
  10. package/build/store/selectors.js +3 -3
  11. package/build/store/selectors.js.map +1 -1
  12. package/build-module/components/html-element-control/index.js +1 -1
  13. package/build-module/components/html-element-control/index.js.map +1 -1
  14. package/build-module/components/html-element-control/messages.js +2 -0
  15. package/build-module/components/html-element-control/messages.js.map +1 -1
  16. package/build-module/components/image-size-control/index.js +6 -7
  17. package/build-module/components/image-size-control/index.js.map +1 -1
  18. package/build-module/layouts/flex.js +5 -1
  19. package/build-module/layouts/flex.js.map +1 -1
  20. package/build-module/store/selectors.js +3 -3
  21. package/build-module/store/selectors.js.map +1 -1
  22. package/build-style/style-rtl.css +4 -10
  23. package/build-style/style.css +4 -10
  24. package/package.json +34 -34
  25. package/src/components/block-inspector/style.scss +4 -2
  26. package/src/components/html-element-control/index.js +1 -1
  27. package/src/components/html-element-control/messages.js +6 -0
  28. package/src/components/image-size-control/index.js +6 -7
  29. package/src/layouts/flex.js +7 -2
  30. package/src/store/selectors.js +3 -3
  31. package/src/style.scss +0 -1
  32. package/src/components/image-size-control/style.scss +0 -8
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 14.20.0 (2025-06-04)
6
+
5
7
  ## 14.19.0 (2025-05-22)
6
8
 
7
9
  ## 14.18.0 (2025-05-07)
@@ -25,7 +25,7 @@ var _jsxRuntime = require("react/jsx-runtime");
25
25
  * @param {Object} props Component props.
26
26
  * @param {string} props.tagName The current HTML tag name.
27
27
  * @param {Function} props.onChange Function to call when the tag is changed.
28
- * @param {string} props.clientId The client ID of the current block.
28
+ * @param {string} props.clientId Optional. The client ID of the block. Used to check for existing <main> elements.
29
29
  * @param {Array} props.options SelectControl options (optional).
30
30
  *
31
31
  * @return {Component} The HTML element select control with validation.
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_store","_messages","_jsxRuntime","HTMLElementControl","tagName","onChange","clientId","options","label","__","value","checkForMainTag","some","option","hasMainElementElsewhere","useSelect","select","getClientIdsWithDescendants","getBlockAttributes","blockEditorStore","id","modifiedOptions","map","disabled","sprintf","jsxs","__experimentalVStack","spacing","className","children","jsx","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","help","htmlElementMessages","Notice","status","isDismissible"],"sources":["@wordpress/block-editor/src/components/html-element-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tSelectControl,\n\tNotice,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { htmlElementMessages } from './messages';\n\n/**\n * Renders a SelectControl for choosing HTML elements with validation\n * to prevent duplicate <main> elements.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The current HTML tag name.\n * @param {Function} props.onChange Function to call when the tag is changed.\n * @param {string} props.clientId The client ID of the current block.\n * @param {Array} props.options SelectControl options (optional).\n *\n * @return {Component} The HTML element select control with validation.\n */\nexport default function HTMLElementControl( {\n\ttagName,\n\tonChange,\n\tclientId,\n\toptions = [\n\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t{ label: '<header>', value: 'header' },\n\t\t{ label: '<main>', value: 'main' },\n\t\t{ label: '<section>', value: 'section' },\n\t\t{ label: '<article>', value: 'article' },\n\t\t{ label: '<aside>', value: 'aside' },\n\t\t{ label: '<footer>', value: 'footer' },\n\t],\n} ) {\n\tconst checkForMainTag =\n\t\t!! clientId && options.some( ( option ) => option.value === 'main' );\n\n\tconst hasMainElementElsewhere = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! checkForMainTag ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst { getClientIdsWithDescendants, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn getClientIdsWithDescendants().some( ( id ) => {\n\t\t\t\t// Skip the current block.\n\t\t\t\tif ( id === clientId ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn getBlockAttributes( id )?.tagName === 'main';\n\t\t\t} );\n\t\t},\n\t\t[ clientId, checkForMainTag ]\n\t);\n\n\t// Create a modified options array that disables the main option if needed.\n\tconst modifiedOptions = options.map( ( option ) => {\n\t\tif (\n\t\t\toption.value === 'main' &&\n\t\t\thasMainElementElsewhere &&\n\t\t\ttagName !== 'main'\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\tdisabled: true,\n\t\t\t\tlabel: sprintf(\n\t\t\t\t\t/* translators: %s: HTML element name */\n\t\t\t\t\t__( '%s (Already in use)' ),\n\t\t\t\t\toption.label\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn option;\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 2 } className=\"block-editor-html-element-control\">\n\t\t\t<SelectControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\toptions={ modifiedOptions }\n\t\t\t\tvalue={ tagName }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t/>\n\n\t\t\t{ tagName === 'main' && hasMainElementElsewhere && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues. Please change this HTML element.'\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AAAiD,IAAAK,WAAA,GAAAL,OAAA;AAfjD;AACA;AACA;;AASA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACe,SAASM,kBAAkBA,CAAE;EAC3CC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,OAAO,GAAG,CACT;IAAEC,KAAK,EAAE,IAAAC,QAAE,EAAE,iBAAkB,CAAC;IAAEC,KAAK,EAAE;EAAM,CAAC,EAChD;IAAEF,KAAK,EAAE,UAAU;IAAEE,KAAK,EAAE;EAAS,CAAC,EACtC;IAAEF,KAAK,EAAE,QAAQ;IAAEE,KAAK,EAAE;EAAO,CAAC,EAClC;IAAEF,KAAK,EAAE,WAAW;IAAEE,KAAK,EAAE;EAAU,CAAC,EACxC;IAAEF,KAAK,EAAE,WAAW;IAAEE,KAAK,EAAE;EAAU,CAAC,EACxC;IAAEF,KAAK,EAAE,SAAS;IAAEE,KAAK,EAAE;EAAQ,CAAC,EACpC;IAAEF,KAAK,EAAE,UAAU;IAAEE,KAAK,EAAE;EAAS,CAAC;AAExC,CAAC,EAAG;EACH,MAAMC,eAAe,GACpB,CAAC,CAAEL,QAAQ,IAAIC,OAAO,CAACK,IAAI,CAAIC,MAAM,IAAMA,MAAM,CAACH,KAAK,KAAK,MAAO,CAAC;EAErE,MAAMI,uBAAuB,GAAG,IAAAC,eAAS,EACtCC,MAAM,IAAM;IACb,IAAK,CAAEL,eAAe,EAAG;MACx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CAAA4B,GAAA,EAAChC,WAAA,CAAAsC,MAAM;MAACC,MAAM,EAAC,SAAS;MAACC,aAAa,EAAG,KAAO;MAAAT,QAAA,EAC7C,IAAApB,QAAE,EACH,kLACD;IAAC,CACM,CACR;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_store","_messages","_jsxRuntime","HTMLElementControl","tagName","onChange","clientId","options","label","__","value","checkForMainTag","some","option","hasMainElementElsewhere","useSelect","select","getClientIdsWithDescendants","getBlockAttributes","blockEditorStore","id","modifiedOptions","map","disabled","sprintf","jsxs","__experimentalVStack","spacing","className","children","jsx","SelectControl","__nextHasNoMarginBottom","__next40pxDefaultSize","help","htmlElementMessages","Notice","status","isDismissible"],"sources":["@wordpress/block-editor/src/components/html-element-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tSelectControl,\n\tNotice,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { htmlElementMessages } from './messages';\n\n/**\n * Renders a SelectControl for choosing HTML elements with validation\n * to prevent duplicate <main> elements.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The current HTML tag name.\n * @param {Function} props.onChange Function to call when the tag is changed.\n * @param {string} props.clientId Optional. The client ID of the block. Used to check for existing <main> elements.\n * @param {Array} props.options SelectControl options (optional).\n *\n * @return {Component} The HTML element select control with validation.\n */\nexport default function HTMLElementControl( {\n\ttagName,\n\tonChange,\n\tclientId,\n\toptions = [\n\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t{ label: '<header>', value: 'header' },\n\t\t{ label: '<main>', value: 'main' },\n\t\t{ label: '<section>', value: 'section' },\n\t\t{ label: '<article>', value: 'article' },\n\t\t{ label: '<aside>', value: 'aside' },\n\t\t{ label: '<footer>', value: 'footer' },\n\t],\n} ) {\n\tconst checkForMainTag =\n\t\t!! clientId && options.some( ( option ) => option.value === 'main' );\n\n\tconst hasMainElementElsewhere = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! checkForMainTag ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst { getClientIdsWithDescendants, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn getClientIdsWithDescendants().some( ( id ) => {\n\t\t\t\t// Skip the current block.\n\t\t\t\tif ( id === clientId ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn getBlockAttributes( id )?.tagName === 'main';\n\t\t\t} );\n\t\t},\n\t\t[ clientId, checkForMainTag ]\n\t);\n\n\t// Create a modified options array that disables the main option if needed.\n\tconst modifiedOptions = options.map( ( option ) => {\n\t\tif (\n\t\t\toption.value === 'main' &&\n\t\t\thasMainElementElsewhere &&\n\t\t\ttagName !== 'main'\n\t\t) {\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\tdisabled: true,\n\t\t\t\tlabel: sprintf(\n\t\t\t\t\t/* translators: %s: HTML element name */\n\t\t\t\t\t__( '%s (Already in use)' ),\n\t\t\t\t\toption.label\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn option;\n\t} );\n\n\treturn (\n\t\t<VStack spacing={ 2 } className=\"block-editor-html-element-control\">\n\t\t\t<SelectControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\toptions={ modifiedOptions }\n\t\t\t\tvalue={ tagName }\n\t\t\t\tonChange={ onChange }\n\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t/>\n\n\t\t\t{ tagName === 'main' && hasMainElementElsewhere && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Multiple <main> elements detected. The duplicate may be in your content or template. This is not valid HTML and may cause accessibility issues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,EAAC,SAAS;MAACC,aAAa,EAAG,KAAO;MAAAT,QAAA,EAC7C,IAAApB,QAAE,EACH,kLACD;IAAC,CACM,CACR;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
@@ -13,8 +13,10 @@ var _i18n = require("@wordpress/i18n");
13
13
  * Messages providing helpful descriptions for HTML elements.
14
14
  */
15
15
  const htmlElementMessages = exports.htmlElementMessages = {
16
+ a: (0, _i18n.__)('The <a> element should be used for links that navigate to a different page or to a different section within the same page.'),
16
17
  article: (0, _i18n.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'),
17
18
  aside: (0, _i18n.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),
19
+ button: (0, _i18n.__)('The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility.'),
18
20
  div: (0, _i18n.__)('The <div> element should only be used if the block is a design element with no semantic meaning.'),
19
21
  footer: (0, _i18n.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'),
20
22
  header: (0, _i18n.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'),
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","htmlElementMessages","exports","article","__","aside","div","footer","header","main","nav","section"],"sources":["@wordpress/block-editor/src/components/html-element-control/messages.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Messages providing helpful descriptions for HTML elements.\n */\nexport const htmlElementMessages = {\n\tarticle: __(\n\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t),\n\taside: __(\n\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t),\n\tdiv: __(\n\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t),\n\tfooter: __(\n\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t),\n\theader: __(\n\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t),\n\tmain: __(\n\t\t'The <main> element should be used for the primary content of your document only.'\n\t),\n\tnav: __(\n\t\t'The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'\n\t),\n\tsection: __(\n\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t),\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EAClCE,OAAO,EAAE,IAAAC,QAAE,EACV,gGACD,CAAC;EACDC,KAAK,EAAE,IAAAD,QAAE,EACR,uIACD,CAAC;EACDE,GAAG,EAAE,IAAAF,QAAE,EACN,kGACD,CAAC;EACDG,MAAM,EAAE,IAAAH,QAAE,EACT,8HACD,CAAC;EACDI,MAAM,EAAE,IAAAJ,QAAE,EACT,qHACD,CAAC;EACDK,IAAI,EAAE,IAAAL,QAAE,EACP,kFACD,CAAC;EACDM,GAAG,EAAE,IAAAN,QAAE,EACN,mIACD,CAAC;EACDO,OAAO,EAAE,IAAAP,QAAE,EACV,kIACD;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","htmlElementMessages","exports","a","__","article","aside","button","div","footer","header","main","nav","section"],"sources":["@wordpress/block-editor/src/components/html-element-control/messages.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Messages providing helpful descriptions for HTML elements.\n */\nexport const htmlElementMessages = {\n\ta: __(\n\t\t'The <a> element should be used for links that navigate to a different page or to a different section within the same page.'\n\t),\n\tarticle: __(\n\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t),\n\taside: __(\n\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t),\n\tbutton: __(\n\t\t'The <button> element should be used for interactive controls that perform an action on the current page, such as opening a modal or toggling content visibility.'\n\t),\n\tdiv: __(\n\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t),\n\tfooter: __(\n\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t),\n\theader: __(\n\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t),\n\tmain: __(\n\t\t'The <main> element should be used for the primary content of your document only.'\n\t),\n\tnav: __(\n\t\t'The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'\n\t),\n\tsection: __(\n\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t),\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG;EAClCE,CAAC,EAAE,IAAAC,QAAE,EACJ,4HACD,CAAC;EACDC,OAAO,EAAE,IAAAD,QAAE,EACV,gGACD,CAAC;EACDE,KAAK,EAAE,IAAAF,QAAE,EACR,uIACD,CAAC;EACDG,MAAM,EAAE,IAAAH,QAAE,EACT,kKACD,CAAC;EACDI,GAAG,EAAE,IAAAJ,QAAE,EACN,kGACD,CAAC;EACDK,MAAM,EAAE,IAAAL,QAAE,EACT,8HACD,CAAC;EACDM,MAAM,EAAE,IAAAN,QAAE,EACT,qHACD,CAAC;EACDO,IAAI,EAAE,IAAAP,QAAE,EACP,kFACD,CAAC;EACDQ,GAAG,EAAE,IAAAR,QAAE,EACN,mIACD,CAAC;EACDS,OAAO,EAAE,IAAAT,QAAE,EACV,kIACD;AACD,CAAC","ignoreList":[]}
@@ -84,7 +84,9 @@ function ImageSizeControl({
84
84
  } = getScaledWidthAndHeight(scale, imageWidth, imageHeight);
85
85
  return currentWidth === scaledWidth && currentHeight === scaledHeight;
86
86
  });
87
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
87
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
88
+ className: "block-editor-image-size-control",
89
+ spacing: "4",
88
90
  children: [imageSizeOptions && imageSizeOptions.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
89
91
  __nextHasNoMarginBottom: true,
90
92
  label: (0, _i18n.__)('Resolution'),
@@ -93,20 +95,17 @@ function ImageSizeControl({
93
95
  onChange: onChangeImage,
94
96
  help: imageSizeHelp,
95
97
  size: "__unstable-large"
96
- }), isResizable && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
97
- className: "block-editor-image-size-control",
98
+ }), isResizable && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
98
99
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
99
100
  align: "baseline",
100
- spacing: "3",
101
+ spacing: "4",
101
102
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalNumberControl, {
102
- className: "block-editor-image-size-control__width",
103
103
  label: (0, _i18n.__)('Width'),
104
104
  value: currentWidth,
105
105
  min: 1,
106
106
  onChange: value => updateDimension('width', value),
107
107
  size: "__unstable-large"
108
108
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalNumberControl, {
109
- className: "block-editor-image-size-control__height",
110
109
  label: (0, _i18n.__)('Height'),
111
110
  value: currentHeight,
112
111
  min: 1,
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_useDimensionHandler","_interopRequireDefault","_jsxRuntime","IMAGE_SIZE_PRESETS","noop","getScaledWidthAndHeight","scale","imageWidth","imageHeight","scaledWidth","Math","round","scaledHeight","ImageSizeControl","imageSizeHelp","imageSizeOptions","isResizable","slug","width","height","onChange","onChangeImage","currentHeight","currentWidth","updateDimension","updateDimensions","useDimensionHandler","handleUpdateDimensions","undefined","selectedValue","find","jsxs","Fragment","children","length","jsx","SelectControl","__nextHasNoMarginBottom","label","__","value","options","help","size","className","__experimentalHStack","align","spacing","__experimentalNumberControl","min","__experimentalToggleGroupControl","hideLabelFromVision","isBlock","__next40pxDefaultSize","map","__experimentalToggleGroupControlOption","sprintf"],"sources":["@wordpress/block-editor/src/components/image-size-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tSelectControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalHStack as HStack,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDimensionHandler from './use-dimension-handler';\n\nconst IMAGE_SIZE_PRESETS = [ 25, 50, 75, 100 ];\nconst noop = () => {};\n\n/**\n * Get scaled width and height for the given scale.\n *\n * @param {number} scale The scale to get the scaled width and height for.\n * @param {number} imageWidth The image width.\n * @param {number} imageHeight The image height.\n *\n * @return {Object} The scaled width and height.\n */\nfunction getScaledWidthAndHeight( scale, imageWidth, imageHeight ) {\n\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\treturn {\n\t\tscaledWidth,\n\t\tscaledHeight,\n\t};\n}\n\nexport default function ImageSizeControl( {\n\timageSizeHelp,\n\timageWidth,\n\timageHeight,\n\timageSizeOptions = [],\n\tisResizable = true,\n\tslug,\n\twidth,\n\theight,\n\tonChange,\n\tonChangeImage = noop,\n} ) {\n\tconst { currentHeight, currentWidth, updateDimension, updateDimensions } =\n\t\tuseDimensionHandler( height, width, imageHeight, imageWidth, onChange );\n\n\t/**\n\t * Updates the dimensions for the given scale.\n\t * Handler for toggle group control change.\n\t *\n\t * @param {number} scale The scale to update the dimensions for.\n\t */\n\tconst handleUpdateDimensions = ( scale ) => {\n\t\tif ( undefined === scale ) {\n\t\t\tupdateDimensions();\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\tupdateDimensions( scaledHeight, scaledWidth );\n\t};\n\n\t/**\n\t * Add the stored image preset value to toggle group control.\n\t */\n\tconst selectedValue = IMAGE_SIZE_PRESETS.find( ( scale ) => {\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\treturn currentWidth === scaledWidth && currentHeight === scaledHeight;\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t{ imageSizeOptions && imageSizeOptions.length > 0 && (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tvalue={ slug }\n\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\tonChange={ onChangeImage }\n\t\t\t\t\thelp={ imageSizeHelp }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isResizable && (\n\t\t\t\t<div className=\"block-editor-image-size-control\">\n\t\t\t\t\t<HStack align=\"baseline\" spacing=\"3\">\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tclassName=\"block-editor-image-size-control__width\"\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tvalue={ currentWidth }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'width', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tclassName=\"block-editor-image-size-control__height\"\n\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\tvalue={ currentHeight }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'height', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Image size presets' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tonChange={ handleUpdateDimensions }\n\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t{ IMAGE_SIZE_PRESETS.map( ( scale ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\tvalue={ scale }\n\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\tscale\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} ) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,oBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA0D,IAAAI,WAAA,GAAAJ,OAAA;AAf1D;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAMK,kBAAkB,GAAG,CAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAE;AAC9C,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA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E,QAAQ,EAAEgB,KAAM,CACjC;UACDG,IAAI,EAAC;QAAkB,CACvB,CAAC;MAAA,CACK,CAAC,eACT,IAAAzC,WAAA,CAAAiC,GAAA,EAACtC,WAAA,CAAAqD,gCAAkB;QAClBZ,KAAK,EAAG,IAAAC,QAAE,EAAE,oBAAqB,CAAG;QACpCY,mBAAmB;QACnB/B,QAAQ,EAAGO,sBAAwB;QACnCa,KAAK,EAAGX,aAAe;QACvBuB,OAAO;QACPC,qBAAqB;QACrBhB,uBAAuB;QAAAJ,QAAA,EAErB9B,kBAAkB,CAACmD,GAAG,CAAIhD,KAAK,IAAM;UACtC,oBACC,IAAAJ,WAAA,CAAAiC,GAAA,EAACtC,WAAA,CAAA0D,sCAAwB;YAExBf,KAAK,EAAGlC,KAAO;YACfgC,KAAK,EAAG,IAAAkB,aAAO,EACd;YACA,IAAAjB,QAAE,EAAE,MAAO,CAAC,EACZjC,KACD;UAAG,GANGA,KAON,CAAC;QAEJ,CAAE;MAAC,CACgB,CAAC;IAAA,CACjB,CACL;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_useDimensionHandler","_interopRequireDefault","_jsxRuntime","IMAGE_SIZE_PRESETS","noop","getScaledWidthAndHeight","scale","imageWidth","imageHeight","scaledWidth","Math","round","scaledHeight","ImageSizeControl","imageSizeHelp","imageSizeOptions","isResizable","slug","width","height","onChange","onChangeImage","currentHeight","currentWidth","updateDimension","updateDimensions","useDimensionHandler","handleUpdateDimensions","undefined","selectedValue","find","jsxs","__experimentalVStack","className","spacing","children","length","jsx","SelectControl","__nextHasNoMarginBottom","label","__","value","options","help","size","Fragment","__experimentalHStack","align","__experimentalNumberControl","min","__experimentalToggleGroupControl","hideLabelFromVision","isBlock","__next40pxDefaultSize","map","__experimentalToggleGroupControlOption","sprintf"],"sources":["@wordpress/block-editor/src/components/image-size-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tSelectControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDimensionHandler from './use-dimension-handler';\n\nconst IMAGE_SIZE_PRESETS = [ 25, 50, 75, 100 ];\nconst noop = () => {};\n\n/**\n * Get scaled width and height for the given scale.\n *\n * @param {number} scale The scale to get the scaled width and height for.\n * @param {number} imageWidth The image width.\n * @param {number} imageHeight The image height.\n *\n * @return {Object} The scaled width and height.\n */\nfunction getScaledWidthAndHeight( scale, imageWidth, imageHeight ) {\n\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\treturn {\n\t\tscaledWidth,\n\t\tscaledHeight,\n\t};\n}\n\nexport default function ImageSizeControl( {\n\timageSizeHelp,\n\timageWidth,\n\timageHeight,\n\timageSizeOptions = [],\n\tisResizable = true,\n\tslug,\n\twidth,\n\theight,\n\tonChange,\n\tonChangeImage = noop,\n} ) {\n\tconst { currentHeight, currentWidth, updateDimension, updateDimensions } =\n\t\tuseDimensionHandler( height, width, imageHeight, imageWidth, onChange );\n\n\t/**\n\t * Updates the dimensions for the given scale.\n\t * Handler for toggle group control change.\n\t *\n\t * @param {number} scale The scale to update the dimensions for.\n\t */\n\tconst handleUpdateDimensions = ( scale ) => {\n\t\tif ( undefined === scale ) {\n\t\t\tupdateDimensions();\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\tupdateDimensions( scaledHeight, scaledWidth );\n\t};\n\n\t/**\n\t * Add the stored image preset value to toggle group control.\n\t */\n\tconst selectedValue = IMAGE_SIZE_PRESETS.find( ( scale ) => {\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\treturn currentWidth === scaledWidth && currentHeight === scaledHeight;\n\t} );\n\n\treturn (\n\t\t<VStack className=\"block-editor-image-size-control\" spacing=\"4\">\n\t\t\t{ imageSizeOptions && imageSizeOptions.length > 0 && (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tvalue={ slug }\n\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\tonChange={ onChangeImage }\n\t\t\t\t\thelp={ imageSizeHelp }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isResizable && (\n\t\t\t\t<>\n\t\t\t\t\t<HStack align=\"baseline\" spacing=\"4\">\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tvalue={ currentWidth }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'width', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\tvalue={ currentHeight }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'height', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Image size presets' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tonChange={ handleUpdateDimensions }\n\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t{ IMAGE_SIZE_PRESETS.map( ( scale ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\tvalue={ scale }\n\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\tscale\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} ) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAQA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,oBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA0D,IAAAI,WAAA,GAAAJ,OAAA;AAhB1D;AACA;AACA;;AAWA;AACA;AACA;;AAGA,MAAMK,kBAAkB,GAAG,CAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAE;AAC9C,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuBA,CAAEC,KAAK,EAAEC,UAAU,EAAEC,WAAW,EAAG;EAClE,MAAMC,WAAW,GAAGC,IAAI,CAACC,KAAK,CAAEJ,UAAU,IAAKD,KAAK,GAAG,GAAG,CAAG,CAAC;EAC9D,MAAMM,YAAY,GAAGF,IAAI,CAACC,KA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QACnBhC,QAAQ,EAAGO,sBAAwB;QACnCe,KAAK,EAAGb,aAAe;QACvBwB,OAAO;QACPC,qBAAqB;QACrBf,uBAAuB;QAAAJ,QAAA,EAErBhC,kBAAkB,CAACoD,GAAG,CAAIjD,KAAK,IAAM;UACtC,oBACC,IAAAJ,WAAA,CAAAmC,GAAA,EAACxC,WAAA,CAAA2D,sCAAwB;YAExBd,KAAK,EAAGpC,KAAO;YACfkC,KAAK,EAAG,IAAAiB,aAAO,EACd;YACA,IAAAhB,QAAE,EAAE,MAAO,CAAC,EACZnC,KACD;UAAG,GANGA,KAON,CAAC;QAEJ,CAAE;MAAC,CACgB,CAAC;IAAA,CACpB,CACF;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
@@ -43,6 +43,10 @@ const verticalAlignmentMap = {
43
43
  stretch: 'stretch',
44
44
  'space-between': 'space-between'
45
45
  };
46
+ const defaultAlignments = {
47
+ horizontal: 'center',
48
+ vertical: 'top'
49
+ };
46
50
  const flexWrapOptions = ['wrap', 'nowrap'];
47
51
  var _default = exports.default = {
48
52
  name: 'flex',
@@ -167,7 +171,7 @@ function FlexLayoutVerticalAlignmentControl({
167
171
  const {
168
172
  orientation = 'horizontal'
169
173
  } = layout;
170
- const defaultVerticalAlignment = orientation === 'horizontal' ? verticalAlignmentMap.center : verticalAlignmentMap.top;
174
+ const defaultVerticalAlignment = orientation === 'horizontal' ? defaultAlignments.horizontal : defaultAlignments.vertical;
171
175
  const {
172
176
  verticalAlignment = defaultVerticalAlignment
173
177
  } = layout;
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_icons","_components","_utils","_gap","_components2","_utils2","_definitions","_jsxRuntime","justifyContentMap","left","right","center","alignItemsMap","stretch","verticalAlignmentMap","top","bottom","flexWrapOptions","_default","exports","default","name","label","__","inspectorControls","FlexLayoutInspectorControls","layout","onChange","layoutBlockSupport","allowOrientation","allowJustification","jsxs","Fragment","children","Flex","jsx","FlexItem","FlexLayoutJustifyContentControl","OrientationControl","FlexWrapControl","toolBarControls","FlexLayoutToolbarControls","allowVerticalAlignment","BlockControls","group","__experimentalShareWithChildBlocks","isToolbar","FlexLayoutVerticalAlignmentControl","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","LAYOUT_DEFINITIONS","orientation","blockGapValue","spacing","blockGap","shouldSkipSerialization","getGapCSSValue","undefined","justifyContent","flexWrap","includes","verticalAlignment","alignItems","output","rules","push","length","appendSelectors","join","getBlockGapCSS","getOrientation","getAlignments","defaultVerticalAlignment","onVerticalAlignmentChange","value","BlockVerticalAlignmentControl","controls","POPOVER_PROPS","placement","onJustificationChange","allowedControls","JustifyContentControl","popoverProps","justificationOptions","icon","justifyLeft","justifyCenter","justifyRight","justifySpaceBetween","justifyStretch","__experimentalToggleGroupControl","__next40pxDefaultSize","__nextHasNoMarginBottom","className","map","__experimentalToggleGroupControlOptionIcon","ToggleControl","checked","newVerticalAlignment","newJustification","arrowRight","arrowDown"],"sources":["@wordpress/block-editor/src/layouts/flex.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n\tjustifySpaceBetween,\n\tjustifyStretch,\n\tarrowRight,\n\tarrowDown,\n} from '@wordpress/icons';\nimport {\n\tToggleControl,\n\tFlex,\n\tFlexItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport {\n\tBlockControls,\n\tJustifyContentControl,\n\tBlockVerticalAlignmentControl,\n} from '../components';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\n// Used with the default, horizontal flex orientation.\nconst justifyContentMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\t'space-between': 'space-between',\n};\n\n// Used with the vertical (column) flex orientation.\nconst alignItemsMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\tstretch: 'stretch',\n};\n\nconst verticalAlignmentMap = {\n\ttop: 'flex-start',\n\tcenter: 'center',\n\tbottom: 'flex-end',\n\tstretch: 'stretch',\n\t'space-between': 'space-between',\n};\n\nconst flexWrapOptions = [ 'wrap', 'nowrap' ];\n\nexport default {\n\tname: 'flex',\n\tlabel: __( 'Flex' ),\n\tinspectorControls: function FlexLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowOrientation = true, allowJustification = true } =\n\t\t\tlayoutBlockSupport;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Flex>\n\t\t\t\t\t{ allowJustification && (\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ allowOrientation && (\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<OrientationControl\n\t\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\t\t\t\t</Flex>\n\t\t\t\t<FlexWrapControl layout={ layout } onChange={ onChange } />\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function FlexLayoutToolbarControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport,\n\t} ) {\n\t\tconst { allowVerticalAlignment = true, allowJustification = true } =\n\t\t\tlayoutBlockSupport;\n\n\t\tif ( ! allowJustification && ! allowVerticalAlignment ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t{ allowJustification && (\n\t\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tisToolbar\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ allowVerticalAlignment && (\n\t\t\t\t\t<FlexLayoutVerticalAlignmentControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t);\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\t\tconst justifyContent = justifyContentMap[ layout.justifyContent ];\n\t\tconst flexWrap = flexWrapOptions.includes( layout.flexWrap )\n\t\t\t? layout.flexWrap\n\t\t\t: 'wrap';\n\t\tconst verticalAlignment =\n\t\t\tverticalAlignmentMap[ layout.verticalAlignment ];\n\t\tconst alignItems =\n\t\t\talignItemsMap[ layout.justifyContent ] || alignItemsMap.left;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( flexWrap && flexWrap !== 'wrap' ) {\n\t\t\trules.push( `flex-wrap: ${ flexWrap }` );\n\t\t}\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `align-items: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\tif ( justifyContent ) {\n\t\t\t\trules.push( `justify-content: ${ justifyContent }` );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `justify-content: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\trules.push( 'flex-direction: column' );\n\t\t\trules.push( `align-items: ${ alignItems }` );\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\toutput = `${ appendSelectors( selector ) } {\n\t\t\t\t${ rules.join( '; ' ) };\n\t\t\t}`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'flex',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation( layout ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\t\treturn orientation;\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\nfunction FlexLayoutVerticalAlignmentControl( { layout, onChange } ) {\n\tconst { orientation = 'horizontal' } = layout;\n\n\tconst defaultVerticalAlignment =\n\t\torientation === 'horizontal'\n\t\t\t? verticalAlignmentMap.center\n\t\t\t: verticalAlignmentMap.top;\n\n\tconst { verticalAlignment = defaultVerticalAlignment } = layout;\n\n\tconst onVerticalAlignmentChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tverticalAlignment: value,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<BlockVerticalAlignmentControl\n\t\t\tonChange={ onVerticalAlignmentChange }\n\t\t\tvalue={ verticalAlignment }\n\t\t\tcontrols={\n\t\t\t\torientation === 'horizontal'\n\t\t\t\t\t? [ 'top', 'center', 'bottom', 'stretch' ]\n\t\t\t\t\t: [ 'top', 'center', 'bottom', 'space-between' ]\n\t\t\t}\n\t\t/>\n\t);\n}\n\nconst POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\nfunction FlexLayoutJustifyContentControl( {\n\tlayout,\n\tonChange,\n\tisToolbar = false,\n} ) {\n\tconst { justifyContent = 'left', orientation = 'horizontal' } = layout;\n\tconst onJustificationChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tjustifyContent: value,\n\t\t} );\n\t};\n\tconst allowedControls = [ 'left', 'center', 'right' ];\n\tif ( orientation === 'horizontal' ) {\n\t\tallowedControls.push( 'space-between' );\n\t} else {\n\t\tallowedControls.push( 'stretch' );\n\t}\n\tif ( isToolbar ) {\n\t\treturn (\n\t\t\t<JustifyContentControl\n\t\t\t\tallowedControls={ allowedControls }\n\t\t\t\tvalue={ justifyContent }\n\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst justificationOptions = [\n\t\t{\n\t\t\tvalue: 'left',\n\t\t\ticon: justifyLeft,\n\t\t\tlabel: __( 'Justify items left' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'center',\n\t\t\ticon: justifyCenter,\n\t\t\tlabel: __( 'Justify items center' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'right',\n\t\t\ticon: justifyRight,\n\t\t\tlabel: __( 'Justify items right' ),\n\t\t},\n\t];\n\tif ( orientation === 'horizontal' ) {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'space-between',\n\t\t\ticon: justifySpaceBetween,\n\t\t\tlabel: __( 'Space between items' ),\n\t\t} );\n\t} else {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'stretch',\n\t\t\ticon: justifyStretch,\n\t\t\tlabel: __( 'Stretch items' ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Justification' ) }\n\t\t\tvalue={ justifyContent }\n\t\t\tonChange={ onJustificationChange }\n\t\t\tclassName=\"block-editor-hooks__flex-layout-justification-controls\"\n\t\t>\n\t\t\t{ justificationOptions.map( ( { value, icon, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n\nfunction FlexWrapControl( { layout, onChange } ) {\n\tconst { flexWrap = 'wrap' } = layout;\n\treturn (\n\t\t<ToggleControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Allow to wrap to multiple lines' ) }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tonChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\tflexWrap: value ? 'wrap' : 'nowrap',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tchecked={ flexWrap === 'wrap' }\n\t\t/>\n\t);\n}\n\nfunction OrientationControl( { layout, onChange } ) {\n\tconst {\n\t\torientation = 'horizontal',\n\t\tverticalAlignment,\n\t\tjustifyContent,\n\t} = layout;\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"block-editor-hooks__flex-layout-orientation-controls\"\n\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\tvalue={ orientation }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\t// Make sure the vertical alignment and justification are compatible with the new orientation.\n\t\t\t\tlet newVerticalAlignment = verticalAlignment;\n\t\t\t\tlet newJustification = justifyContent;\n\t\t\t\tif ( value === 'horizontal' ) {\n\t\t\t\t\tif ( verticalAlignment === 'space-between' ) {\n\t\t\t\t\t\tnewVerticalAlignment = 'center';\n\t\t\t\t\t}\n\t\t\t\t\tif ( justifyContent === 'stretch' ) {\n\t\t\t\t\t\tnewJustification = 'left';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( verticalAlignment === 'stretch' ) {\n\t\t\t\t\t\tnewVerticalAlignment = 'top';\n\t\t\t\t\t}\n\t\t\t\t\tif ( justifyContent === 'space-between' ) {\n\t\t\t\t\t\tnewJustification = 'left';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn onChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\torientation: value,\n\t\t\t\t\tverticalAlignment: newVerticalAlignment,\n\t\t\t\t\tjustifyContent: newJustification,\n\t\t\t\t} );\n\t\t\t} }\n\t\t>\n\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\ticon={ arrowRight }\n\t\t\t\tvalue=\"horizontal\"\n\t\t\t\tlabel={ __( 'Horizontal' ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\ticon={ arrowDown }\n\t\t\t\tvalue=\"vertical\"\n\t\t\t\tlabel={ __( 'Vertical' ) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,WAAA,GAAAF,OAAA;AAWA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAAmD,IAAAQ,WAAA,GAAAR,OAAA;AAhCnD;AACA;AACA;;AAmBA;AACA;AACA;;AAWA;AACA,MAAMS,iBAAiB,GAAG;EACzBC,IAAI,EAAE,YAAY;EAClBC,KAAK,EAAE,UAAU;EACjBC,MAAM,EAAE,QAAQ;EAChB,eAAe,EAAE;AAClB,CAAC;;AAED;AACA,MAAMC,aAAa,GAAG;EACrBH,IAAI,EAAE,YAA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YAAa;IAAG,CAC5B,CAAC,eACF,IAAAhB,WAAA,CAAA4B,GAAA,EAAClC,WAAA,CAAAkG,0CAA4B;MAC5BX,IAAI,EAAGiB,gBAAW;MAClB3B,KAAK,EAAC,UAAU;MAChBxD,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW;IAAG,CAC1B,CAAC;EAAA,CACiB,CAAC;AAEvB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_icons","_components","_utils","_gap","_components2","_utils2","_definitions","_jsxRuntime","justifyContentMap","left","right","center","alignItemsMap","stretch","verticalAlignmentMap","top","bottom","defaultAlignments","horizontal","vertical","flexWrapOptions","_default","exports","default","name","label","__","inspectorControls","FlexLayoutInspectorControls","layout","onChange","layoutBlockSupport","allowOrientation","allowJustification","jsxs","Fragment","children","Flex","jsx","FlexItem","FlexLayoutJustifyContentControl","OrientationControl","FlexWrapControl","toolBarControls","FlexLayoutToolbarControls","allowVerticalAlignment","BlockControls","group","__experimentalShareWithChildBlocks","isToolbar","FlexLayoutVerticalAlignmentControl","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","LAYOUT_DEFINITIONS","orientation","blockGapValue","spacing","blockGap","shouldSkipSerialization","getGapCSSValue","undefined","justifyContent","flexWrap","includes","verticalAlignment","alignItems","output","rules","push","length","appendSelectors","join","getBlockGapCSS","getOrientation","getAlignments","defaultVerticalAlignment","onVerticalAlignmentChange","value","BlockVerticalAlignmentControl","controls","POPOVER_PROPS","placement","onJustificationChange","allowedControls","JustifyContentControl","popoverProps","justificationOptions","icon","justifyLeft","justifyCenter","justifyRight","justifySpaceBetween","justifyStretch","__experimentalToggleGroupControl","__next40pxDefaultSize","__nextHasNoMarginBottom","className","map","__experimentalToggleGroupControlOptionIcon","ToggleControl","checked","newVerticalAlignment","newJustification","arrowRight","arrowDown"],"sources":["@wordpress/block-editor/src/layouts/flex.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n\tjustifySpaceBetween,\n\tjustifyStretch,\n\tarrowRight,\n\tarrowDown,\n} from '@wordpress/icons';\nimport {\n\tToggleControl,\n\tFlex,\n\tFlexItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport {\n\tBlockControls,\n\tJustifyContentControl,\n\tBlockVerticalAlignmentControl,\n} from '../components';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\n// Used with the default, horizontal flex orientation.\nconst justifyContentMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\t'space-between': 'space-between',\n};\n\n// Used with the vertical (column) flex orientation.\nconst alignItemsMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\tstretch: 'stretch',\n};\n\nconst verticalAlignmentMap = {\n\ttop: 'flex-start',\n\tcenter: 'center',\n\tbottom: 'flex-end',\n\tstretch: 'stretch',\n\t'space-between': 'space-between',\n};\n\nconst defaultAlignments = {\n\thorizontal: 'center',\n\tvertical: 'top',\n};\n\nconst flexWrapOptions = [ 'wrap', 'nowrap' ];\n\nexport default {\n\tname: 'flex',\n\tlabel: __( 'Flex' ),\n\tinspectorControls: function FlexLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowOrientation = true, allowJustification = true } =\n\t\t\tlayoutBlockSupport;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Flex>\n\t\t\t\t\t{ allowJustification && (\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ allowOrientation && (\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<OrientationControl\n\t\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\t\t\t\t</Flex>\n\t\t\t\t<FlexWrapControl layout={ layout } onChange={ onChange } />\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function FlexLayoutToolbarControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport,\n\t} ) {\n\t\tconst { allowVerticalAlignment = true, allowJustification = true } =\n\t\t\tlayoutBlockSupport;\n\n\t\tif ( ! allowJustification && ! allowVerticalAlignment ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t{ allowJustification && (\n\t\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tisToolbar\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ allowVerticalAlignment && (\n\t\t\t\t\t<FlexLayoutVerticalAlignmentControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t);\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\t\tconst justifyContent = justifyContentMap[ layout.justifyContent ];\n\t\tconst flexWrap = flexWrapOptions.includes( layout.flexWrap )\n\t\t\t? layout.flexWrap\n\t\t\t: 'wrap';\n\t\tconst verticalAlignment =\n\t\t\tverticalAlignmentMap[ layout.verticalAlignment ];\n\t\tconst alignItems =\n\t\t\talignItemsMap[ layout.justifyContent ] || alignItemsMap.left;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( flexWrap && flexWrap !== 'wrap' ) {\n\t\t\trules.push( `flex-wrap: ${ flexWrap }` );\n\t\t}\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `align-items: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\tif ( justifyContent ) {\n\t\t\t\trules.push( `justify-content: ${ justifyContent }` );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `justify-content: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\trules.push( 'flex-direction: column' );\n\t\t\trules.push( `align-items: ${ alignItems }` );\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\toutput = `${ appendSelectors( selector ) } {\n\t\t\t\t${ rules.join( '; ' ) };\n\t\t\t}`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'flex',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation( layout ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\t\treturn orientation;\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\nfunction FlexLayoutVerticalAlignmentControl( { layout, onChange } ) {\n\tconst { orientation = 'horizontal' } = layout;\n\n\tconst defaultVerticalAlignment =\n\t\torientation === 'horizontal'\n\t\t\t? defaultAlignments.horizontal\n\t\t\t: defaultAlignments.vertical;\n\n\tconst { verticalAlignment = defaultVerticalAlignment } = layout;\n\n\tconst onVerticalAlignmentChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tverticalAlignment: value,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<BlockVerticalAlignmentControl\n\t\t\tonChange={ onVerticalAlignmentChange }\n\t\t\tvalue={ verticalAlignment }\n\t\t\tcontrols={\n\t\t\t\torientation === 'horizontal'\n\t\t\t\t\t? [ 'top', 'center', 'bottom', 'stretch' ]\n\t\t\t\t\t: [ 'top', 'center', 'bottom', 'space-between' ]\n\t\t\t}\n\t\t/>\n\t);\n}\n\nconst POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\nfunction FlexLayoutJustifyContentControl( {\n\tlayout,\n\tonChange,\n\tisToolbar = false,\n} ) {\n\tconst { justifyContent = 'left', orientation = 'horizontal' } = layout;\n\tconst onJustificationChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tjustifyContent: value,\n\t\t} );\n\t};\n\tconst allowedControls = [ 'left', 'center', 'right' ];\n\tif ( orientation === 'horizontal' ) {\n\t\tallowedControls.push( 'space-between' );\n\t} else {\n\t\tallowedControls.push( 'stretch' );\n\t}\n\tif ( isToolbar ) {\n\t\treturn (\n\t\t\t<JustifyContentControl\n\t\t\t\tallowedControls={ allowedControls }\n\t\t\t\tvalue={ justifyContent }\n\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst justificationOptions = [\n\t\t{\n\t\t\tvalue: 'left',\n\t\t\ticon: justifyLeft,\n\t\t\tlabel: __( 'Justify items left' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'center',\n\t\t\ticon: justifyCenter,\n\t\t\tlabel: __( 'Justify items center' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'right',\n\t\t\ticon: justifyRight,\n\t\t\tlabel: __( 'Justify items right' ),\n\t\t},\n\t];\n\tif ( orientation === 'horizontal' ) {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'space-between',\n\t\t\ticon: justifySpaceBetween,\n\t\t\tlabel: __( 'Space between items' ),\n\t\t} );\n\t} else {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'stretch',\n\t\t\ticon: justifyStretch,\n\t\t\tlabel: __( 'Stretch items' ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Justification' ) }\n\t\t\tvalue={ justifyContent }\n\t\t\tonChange={ onJustificationChange }\n\t\t\tclassName=\"block-editor-hooks__flex-layout-justification-controls\"\n\t\t>\n\t\t\t{ justificationOptions.map( ( { value, icon, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n\nfunction FlexWrapControl( { layout, onChange } ) {\n\tconst { flexWrap = 'wrap' } = layout;\n\treturn (\n\t\t<ToggleControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Allow to wrap to multiple lines' ) }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tonChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\tflexWrap: value ? 'wrap' : 'nowrap',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tchecked={ flexWrap === 'wrap' }\n\t\t/>\n\t);\n}\n\nfunction OrientationControl( { layout, onChange } ) {\n\tconst {\n\t\torientation = 'horizontal',\n\t\tverticalAlignment,\n\t\tjustifyContent,\n\t} = layout;\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"block-editor-hooks__flex-layout-orientation-controls\"\n\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\tvalue={ orientation }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\t// Make sure the vertical alignment and justification are compatible with the new orientation.\n\t\t\t\tlet newVerticalAlignment = verticalAlignment;\n\t\t\t\tlet newJustification = justifyContent;\n\t\t\t\tif ( value === 'horizontal' ) {\n\t\t\t\t\tif ( verticalAlignment === 'space-between' ) {\n\t\t\t\t\t\tnewVerticalAlignment = 'center';\n\t\t\t\t\t}\n\t\t\t\t\tif ( justifyContent === 'stretch' ) {\n\t\t\t\t\t\tnewJustification = 'left';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( verticalAlignment === 'stretch' ) {\n\t\t\t\t\t\tnewVerticalAlignment = 'top';\n\t\t\t\t\t}\n\t\t\t\t\tif ( justifyContent === 'space-between' ) {\n\t\t\t\t\t\tnewJustification = 'left';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn onChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\torientation: value,\n\t\t\t\t\tverticalAlignment: newVerticalAlignment,\n\t\t\t\t\tjustifyContent: newJustification,\n\t\t\t\t} );\n\t\t\t} }\n\t\t>\n\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\ticon={ arrowRight }\n\t\t\t\tvalue=\"horizontal\"\n\t\t\t\tlabel={ __( 'Horizontal' ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\ticon={ arrowDown }\n\t\t\t\tvalue=\"vertical\"\n\t\t\t\tlabel={ __( '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KAAK,YAAY,EAAG;QAC7B,IAAKb,iBAAiB,KAAK,eAAe,EAAG;UAC5CqC,oBAAoB,GAAG,QAAQ;QAChC;QACA,IAAKxC,cAAc,KAAK,SAAS,EAAG;UACnCyC,gBAAgB,GAAG,MAAM;QAC1B;MACD,CAAC,MAAM;QACN,IAAKtC,iBAAiB,KAAK,SAAS,EAAG;UACtCqC,oBAAoB,GAAG,KAAK;QAC7B;QACA,IAAKxC,cAAc,KAAK,eAAe,EAAG;UACzCyC,gBAAgB,GAAG,MAAM;QAC1B;MACD;MACA,OAAO5E,QAAQ,CAAE;QAChB,GAAGD,MAAM;QACT6B,WAAW,EAAEuB,KAAK;QAClBb,iBAAiB,EAAEqC,oBAAoB;QACvCxC,cAAc,EAAEyC;MACjB,CAAE,CAAC;IACJ,CAAG;IAAAtE,QAAA,gBAEH,IAAA7B,WAAA,CAAA+B,GAAA,EAACrC,WAAA,CAAAqG,0CAA4B;MAC5BX,IAAI,EAAGgB,iBAAY;MACnB1B,KAAK,EAAC,YAAY;MAClBxD,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa;IAAG,CAC5B,CAAC,eACF,IAAAnB,WAAA,CAAA+B,GAAA,EAACrC,WAAA,CAAAqG,0CAA4B;MAC5BX,IAAI,EAAGiB,gBAAW;MAClB3B,KAAK,EAAC,UAAU;MAChBxD,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW;IAAG,CAC1B,CAAC;EAAA,CACiB,CAAC;AAEvB","ignoreList":[]}
@@ -1645,9 +1645,9 @@ const canInsertBlockType = exports.canInsertBlockType = (0, _data.createRegistry
1645
1645
  * Determines if the given blocks are allowed to be inserted into the block
1646
1646
  * list.
1647
1647
  *
1648
- * @param {Object} state Editor state.
1649
- * @param {string} clientIds The block client IDs to be inserted.
1650
- * @param {?string} rootClientId Optional root client ID of block list.
1648
+ * @param {Object} state Editor state.
1649
+ * @param {string[]} clientIds The block client IDs to be inserted.
1650
+ * @param {?string} rootClientId Optional root client ID of block list.
1651
1651
  *
1652
1652
  * @return {boolean} Whether the given blocks are allowed to be inserted.
1653
1653
  */