@wordpress/block-editor 10.0.6 → 10.0.8

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 (37) hide show
  1. package/build/components/block-inspector/index.js +3 -2
  2. package/build/components/block-inspector/index.js.map +1 -1
  3. package/build/components/font-sizes/fluid-utils.js +69 -21
  4. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  5. package/build/components/iframe/index.js +1 -1
  6. package/build/components/iframe/index.js.map +1 -1
  7. package/build/components/inner-blocks/use-inner-block-template-sync.js +3 -2
  8. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  9. package/build/components/preview-options/index.js +2 -3
  10. package/build/components/preview-options/index.js.map +1 -1
  11. package/build/components/spacing-sizes-control/spacing-input-control.js +4 -2
  12. package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  13. package/build-module/components/block-inspector/index.js +3 -2
  14. package/build-module/components/block-inspector/index.js.map +1 -1
  15. package/build-module/components/font-sizes/fluid-utils.js +69 -21
  16. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  17. package/build-module/components/iframe/index.js +1 -1
  18. package/build-module/components/iframe/index.js.map +1 -1
  19. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +3 -2
  20. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  21. package/build-module/components/preview-options/index.js +2 -3
  22. package/build-module/components/preview-options/index.js.map +1 -1
  23. package/build-module/components/spacing-sizes-control/spacing-input-control.js +4 -2
  24. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  25. package/build-style/style-rtl.css +27 -21
  26. package/build-style/style.css +27 -21
  27. package/package.json +3 -3
  28. package/src/components/block-inspector/index.js +6 -3
  29. package/src/components/block-patterns-list/style.scss +5 -0
  30. package/src/components/button-block-appender/style.scss +3 -2
  31. package/src/components/font-sizes/fluid-utils.js +100 -25
  32. package/src/components/font-sizes/test/fluid-utils.js +5 -5
  33. package/src/components/iframe/index.js +1 -1
  34. package/src/components/inner-blocks/use-inner-block-template-sync.js +3 -2
  35. package/src/components/preview-options/index.js +2 -2
  36. package/src/components/spacing-sizes-control/spacing-input-control.js +2 -0
  37. package/src/components/spacing-sizes-control/style.scss +26 -19
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/inner-blocks/use-inner-block-template-sync.js"],"names":["isEqual","useRef","useLayoutEffect","useSelect","useDispatch","synchronizeBlocksWithTemplate","store","blockEditorStore","useInnerBlockTemplateSync","clientId","template","templateLock","templateInsertUpdatesSelection","getSelectedBlocksInitialCaretPosition","replaceInnerBlocks","innerBlocks","select","getBlocks","existingTemplate","window","queueMicrotask","currentInnerBlocks","shouldApplyTemplate","length","hasTemplateChanged","current","nextBlocks"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,EAAiBC,eAAjB,QAAwC,oBAAxC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,6BAAT,QAA8C,mBAA9C;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,yBAAT,CACdC,QADc,EAEdC,QAFc,EAGdC,YAHc,EAIdC,8BAJc,EAKb;AACD,QAAM;AAAEC,IAAAA;AAAF,MACLV,SAAS,CAAEI,gBAAF,CADV;AAEA,QAAM;AAAEO,IAAAA;AAAF,MAAyBV,WAAW,CAAEG,gBAAF,CAA1C;AACA,QAAMQ,WAAW,GAAGZ,SAAS,CAC1Ba,MAAF,IAAcA,MAAM,CAAET,gBAAF,CAAN,CAA2BU,SAA3B,CAAsCR,QAAtC,CADc,EAE5B,CAAEA,QAAF,CAF4B,CAA7B;AAIA,QAAM;AAAEQ,IAAAA;AAAF,MAAgBd,SAAS,CAAEI,gBAAF,CAA/B,CARC,CAUD;;AACA,QAAMW,gBAAgB,GAAGjB,MAAM,CAAE,IAAF,CAA/B;AACAC,EAAAA,eAAe,CAAE,MAAM;AACtB;AACA;AACA;AACA;AACAiB,IAAAA,MAAM,CAACC,cAAP,CAAuB,MAAM;AAC5B;AACA;AACA,YAAMC,kBAAkB,GAAGJ,SAAS,CAAER,QAAF,CAApC;AACA,YAAMa,mBAAmB,GACxBD,kBAAkB,CAACE,MAAnB,KAA8B,CAA9B,IACAZ,YAAY,KAAK,KADjB,IAEAA,YAAY,KAAK,aAHlB;AAKA,YAAMa,kBAAkB,GAAG,CAAExB,OAAO,CACnCU,QADmC,EAEnCQ,gBAAgB,CAACO,OAFkB,CAApC;;AAKA,UAAK,CAAEH,mBAAF,IAAyB,CAAEE,kBAAhC,EAAqD;AACpD;AACA;;AAEDN,MAAAA,gBAAgB,CAACO,OAAjB,GAA2Bf,QAA3B;AACA,YAAMgB,UAAU,GAAGrB,6BAA6B,CAC/CgB,kBAD+C,EAE/CX,QAF+C,CAAhD;;AAKA,UAAK,CAAEV,OAAO,CAAE0B,UAAF,EAAcL,kBAAd,CAAd,EAAmD;AAClDP,QAAAA,kBAAkB,CACjBL,QADiB,EAEjBiB,UAFiB,EAGjBL,kBAAkB,CAACE,MAAnB,KAA8B,CAA9B,IACCX,8BADD,IAECc,UAAU,CAACH,MAAX,KAAsB,CALN,EAMjB;AACA;AACA;AACA;AACAV,QAAAA,qCAAqC,EAVpB,CAAlB;AAYA;AACD,KAtCD;AAuCA,GA5Cc,EA4CZ,CAAEE,WAAF,EAAeL,QAAf,EAAyBC,YAAzB,EAAuCF,QAAvC,CA5CY,CAAf;AA6CA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEqual } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useLayoutEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { synchronizeBlocksWithTemplate } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * This hook makes sure that a block's inner blocks stay in sync with the given\n * block \"template\". The template is a block hierarchy to which inner blocks must\n * conform. If the blocks get \"out of sync\" with the template and the template\n * is meant to be locked (e.g. templateLock = \"all\" or templateLock = \"contentOnly\"),\n * then we replace the inner blocks with the correct value after synchronizing it with the template.\n *\n * @param {string} clientId The block client ID.\n * @param {Object} template The template to match.\n * @param {string} templateLock The template lock state for the inner blocks. For\n * example, if the template lock is set to \"all\",\n * then the inner blocks will stay in sync with the\n * template. If not defined or set to false, then\n * the inner blocks will not be synchronized with\n * the given template.\n * @param {boolean} templateInsertUpdatesSelection Whether or not to update the\n * block-editor selection state when inner blocks\n * are replaced after template synchronization.\n */\nexport default function useInnerBlockTemplateSync(\n\tclientId,\n\ttemplate,\n\ttemplateLock,\n\ttemplateInsertUpdatesSelection\n) {\n\tconst { getSelectedBlocksInitialCaretPosition } =\n\t\tuseSelect( blockEditorStore );\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst innerBlocks = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlocks( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\n\t// Maintain a reference to the previous value so we can do a deep equality check.\n\tconst existingTemplate = useRef( null );\n\tuseLayoutEffect( () => {\n\t\t// There's an implicit dependency between useInnerBlockTemplateSync and useNestedSettingsUpdate\n\t\t// The former needs to happen after the latter and since the latter is using microtasks to batch updates (performance optimization),\n\t\t// we need to schedule this one in a microtask as well.\n\t\t// Exemple: If you remove queueMicrotask here, ctrl + click to insert quote block won't close the inserter.\n\t\twindow.queueMicrotask( () => {\n\t\t\t// Only synchronize innerBlocks with template if innerBlocks are empty\n\t\t\t// or a locking \"all\" or \"contentOnly\" exists directly on the block.\n\t\t\tconst currentInnerBlocks = getBlocks( clientId );\n\t\t\tconst shouldApplyTemplate =\n\t\t\t\tcurrentInnerBlocks.length === 0 ||\n\t\t\t\ttemplateLock === 'all' ||\n\t\t\t\ttemplateLock === 'contentOnly';\n\n\t\t\tconst hasTemplateChanged = ! isEqual(\n\t\t\t\ttemplate,\n\t\t\t\texistingTemplate.current\n\t\t\t);\n\n\t\t\tif ( ! shouldApplyTemplate || ! hasTemplateChanged ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\texistingTemplate.current = template;\n\t\t\tconst nextBlocks = synchronizeBlocksWithTemplate(\n\t\t\t\tcurrentInnerBlocks,\n\t\t\t\ttemplate\n\t\t\t);\n\n\t\t\tif ( ! isEqual( nextBlocks, currentInnerBlocks ) ) {\n\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\tclientId,\n\t\t\t\t\tnextBlocks,\n\t\t\t\t\tcurrentInnerBlocks.length === 0 &&\n\t\t\t\t\t\ttemplateInsertUpdatesSelection &&\n\t\t\t\t\t\tnextBlocks.length !== 0,\n\t\t\t\t\t// This ensures the \"initialPosition\" doesn't change when applying the template\n\t\t\t\t\t// If we're supposed to focus the block, we'll focus the first inner block\n\t\t\t\t\t// otherwise, we won't apply any auto-focus.\n\t\t\t\t\t// This ensures for instance that the focus stays in the inserter when inserting the \"buttons\" block.\n\t\t\t\t\tgetSelectedBlocksInitialCaretPosition()\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t}, [ innerBlocks, template, templateLock, clientId ] );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/inner-blocks/use-inner-block-template-sync.js"],"names":["isEqual","useRef","useLayoutEffect","useSelect","useDispatch","synchronizeBlocksWithTemplate","store","blockEditorStore","useInnerBlockTemplateSync","clientId","template","templateLock","templateInsertUpdatesSelection","getSelectedBlocksInitialCaretPosition","isBlockSelected","replaceInnerBlocks","innerBlocks","select","getBlocks","existingTemplate","window","queueMicrotask","currentInnerBlocks","shouldApplyTemplate","length","hasTemplateChanged","current","nextBlocks"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB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AAyB,CAAEE,kBAAhC,EAAqD;AACpD;AACA;;AAEDN,MAAAA,gBAAgB,CAACO,OAAjB,GAA2BhB,QAA3B;AACA,YAAMiB,UAAU,GAAGtB,6BAA6B,CAC/CiB,kBAD+C,EAE/CZ,QAF+C,CAAhD;;AAKA,UAAK,CAAEV,OAAO,CAAE2B,UAAF,EAAcL,kBAAd,CAAd,EAAmD;AAClDP,QAAAA,kBAAkB,CACjBN,QADiB,EAEjBkB,UAFiB,EAGjBL,kBAAkB,CAACE,MAAnB,KAA8B,CAA9B,IACCZ,8BADD,IAECe,UAAU,CAACH,MAAX,KAAsB,CAFvB,IAGCV,eAAe,CAAEL,QAAF,CANC,EAOjB;AACA;AACA;AACA;AACAI,QAAAA,qCAAqC,EAXpB,CAAlB;AAaA;AACD,KAvCD;AAwCA,GA7Cc,EA6CZ,CAAEG,WAAF,EAAeN,QAAf,EAAyBC,YAAzB,EAAuCF,QAAvC,CA7CY,CAAf;AA8CA","sourcesContent":["/**\n * External dependencies\n */\nimport { isEqual } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useLayoutEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { synchronizeBlocksWithTemplate } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * This hook makes sure that a block's inner blocks stay in sync with the given\n * block \"template\". The template is a block hierarchy to which inner blocks must\n * conform. If the blocks get \"out of sync\" with the template and the template\n * is meant to be locked (e.g. templateLock = \"all\" or templateLock = \"contentOnly\"),\n * then we replace the inner blocks with the correct value after synchronizing it with the template.\n *\n * @param {string} clientId The block client ID.\n * @param {Object} template The template to match.\n * @param {string} templateLock The template lock state for the inner blocks. For\n * example, if the template lock is set to \"all\",\n * then the inner blocks will stay in sync with the\n * template. If not defined or set to false, then\n * the inner blocks will not be synchronized with\n * the given template.\n * @param {boolean} templateInsertUpdatesSelection Whether or not to update the\n * block-editor selection state when inner blocks\n * are replaced after template synchronization.\n */\nexport default function useInnerBlockTemplateSync(\n\tclientId,\n\ttemplate,\n\ttemplateLock,\n\ttemplateInsertUpdatesSelection\n) {\n\tconst { getSelectedBlocksInitialCaretPosition, isBlockSelected } =\n\t\tuseSelect( blockEditorStore );\n\tconst { replaceInnerBlocks } = useDispatch( blockEditorStore );\n\tconst innerBlocks = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlocks( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\n\t// Maintain a reference to the previous value so we can do a deep equality check.\n\tconst existingTemplate = useRef( null );\n\tuseLayoutEffect( () => {\n\t\t// There's an implicit dependency between useInnerBlockTemplateSync and useNestedSettingsUpdate\n\t\t// The former needs to happen after the latter and since the latter is using microtasks to batch updates (performance optimization),\n\t\t// we need to schedule this one in a microtask as well.\n\t\t// Exemple: If you remove queueMicrotask here, ctrl + click to insert quote block won't close the inserter.\n\t\twindow.queueMicrotask( () => {\n\t\t\t// Only synchronize innerBlocks with template if innerBlocks are empty\n\t\t\t// or a locking \"all\" or \"contentOnly\" exists directly on the block.\n\t\t\tconst currentInnerBlocks = getBlocks( clientId );\n\t\t\tconst shouldApplyTemplate =\n\t\t\t\tcurrentInnerBlocks.length === 0 ||\n\t\t\t\ttemplateLock === 'all' ||\n\t\t\t\ttemplateLock === 'contentOnly';\n\n\t\t\tconst hasTemplateChanged = ! isEqual(\n\t\t\t\ttemplate,\n\t\t\t\texistingTemplate.current\n\t\t\t);\n\n\t\t\tif ( ! shouldApplyTemplate || ! hasTemplateChanged ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\texistingTemplate.current = template;\n\t\t\tconst nextBlocks = synchronizeBlocksWithTemplate(\n\t\t\t\tcurrentInnerBlocks,\n\t\t\t\ttemplate\n\t\t\t);\n\n\t\t\tif ( ! isEqual( nextBlocks, currentInnerBlocks ) ) {\n\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\tclientId,\n\t\t\t\t\tnextBlocks,\n\t\t\t\t\tcurrentInnerBlocks.length === 0 &&\n\t\t\t\t\t\ttemplateInsertUpdatesSelection &&\n\t\t\t\t\t\tnextBlocks.length !== 0 &&\n\t\t\t\t\t\tisBlockSelected( clientId ),\n\t\t\t\t\t// This ensures the \"initialPosition\" doesn't change when applying the template\n\t\t\t\t\t// If we're supposed to focus the block, we'll focus the first inner block\n\t\t\t\t\t// otherwise, we won't apply any auto-focus.\n\t\t\t\t\t// This ensures for instance that the focus stays in the inserter when inserting the \"buttons\" block.\n\t\t\t\t\tgetSelectedBlocksInitialCaretPosition()\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t}, [ innerBlocks, template, templateLock, clientId ] );\n}\n"]}
@@ -15,6 +15,7 @@ import { check } from '@wordpress/icons';
15
15
  export default function PreviewOptions(_ref) {
16
16
  let {
17
17
  children,
18
+ viewLabel,
18
19
  className,
19
20
  isEnabled = true,
20
21
  deviceType,
@@ -30,9 +31,7 @@ export default function PreviewOptions(_ref) {
30
31
  variant: 'tertiary',
31
32
  className: 'block-editor-post-preview__button-toggle',
32
33
  disabled: !isEnabled,
33
-
34
- /* translators: button label text should, if possible, be under 16 characters. */
35
- children: __('View')
34
+ children: viewLabel
36
35
  };
37
36
  const menuProps = {
38
37
  'aria-label': __('View options')
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/preview-options/index.js"],"names":["classnames","useViewportMatch","DropdownMenu","MenuGroup","MenuItem","__","check","PreviewOptions","children","className","isEnabled","deviceType","setDeviceType","isMobile","popoverProps","position","toggleProps","variant","disabled","menuProps"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,YAAT,EAAuBC,SAAvB,EAAkCC,QAAlC,QAAkD,uBAAlD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AAEA,e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KAKGD,EAAE,CAAE,QAAF,CALL,CARD,EAeC,cAAC,QAAD;AACC,IAAA,SAAS,EAAC,0CADX;AAEC,IAAA,OAAO,EAAG,MAAMO,aAAa,CAAE,QAAF,CAF9B;AAGC,IAAA,IAAI,EAAGD,UAAU,KAAK,QAAf,IAA2BL;AAHnC,KAKGD,EAAE,CAAE,QAAF,CALL,CAfD,CADD,EAwBGG,QAxBH,CARF,CADD;AAsCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nexport default function PreviewOptions( {\n\tchildren,\n\tclassName,\n\tisEnabled = true,\n\tdeviceType,\n\tsetDeviceType,\n} ) {\n\tconst isMobile = useViewportMatch( 'small', '<' );\n\tif ( isMobile ) return null;\n\n\tconst popoverProps = {\n\t\tclassName: classnames(\n\t\t\tclassName,\n\t\t\t'block-editor-post-preview__dropdown-content'\n\t\t),\n\t\tposition: 'bottom left',\n\t};\n\tconst toggleProps = {\n\t\tvariant: 'tertiary',\n\t\tclassName: 'block-editor-post-preview__button-toggle',\n\t\tdisabled: ! isEnabled,\n\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\tchildren: __( 'View' ),\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"block-editor-post-preview__dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ null }\n\t\t>\n\t\t\t{ () => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tclassName=\"block-editor-post-preview__button-resize\"\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tclassName=\"block-editor-post-preview__button-resize\"\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tclassName=\"block-editor-post-preview__button-resize\"\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ children }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/preview-options/index.js"],"names":["classnames","useViewportMatch","DropdownMenu","MenuGroup","MenuItem","__","check","PreviewOptions","children","viewLabel","className","isEnabled","deviceType","setDeviceType","isMobile","popoverProps","position","toggleProps","variant","disabled","menuProps"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,YAAT,EAAuBC,SAAvB,EAAkCC,QAAlC,QAAkD,uBAAlD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AAEA,eAAe,SAASC,cAAT,OAOX;AAAA,MAPoC;AACvCC,IAAAA,QADuC;AAEvCC,IAAAA,SAFuC;AAGvCC,IAA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AAA,OAAO,EAAG,MAAMQ,aAAa,CAAE,QAAF,CAF9B;AAGC,IAAA,IAAI,EAAGD,UAAU,KAAK,QAAf,IAA2BN;AAHnC,KAKGD,EAAE,CAAE,QAAF,CALL,CAfD,CADD,EAwBGG,QAxBH,CARF,CADD;AAsCA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nexport default function PreviewOptions( {\n\tchildren,\n\tviewLabel,\n\tclassName,\n\tisEnabled = true,\n\tdeviceType,\n\tsetDeviceType,\n} ) {\n\tconst isMobile = useViewportMatch( 'small', '<' );\n\tif ( isMobile ) return null;\n\n\tconst popoverProps = {\n\t\tclassName: classnames(\n\t\t\tclassName,\n\t\t\t'block-editor-post-preview__dropdown-content'\n\t\t),\n\t\tposition: 'bottom left',\n\t};\n\tconst toggleProps = {\n\t\tvariant: 'tertiary',\n\t\tclassName: 'block-editor-post-preview__button-toggle',\n\t\tdisabled: ! isEnabled,\n\t\tchildren: viewLabel,\n\t};\n\tconst menuProps = {\n\t\t'aria-label': __( 'View options' ),\n\t};\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"block-editor-post-preview__dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\ttoggleProps={ toggleProps }\n\t\t\tmenuProps={ menuProps }\n\t\t\ticon={ null }\n\t\t>\n\t\t\t{ () => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tclassName=\"block-editor-post-preview__button-resize\"\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Desktop' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Desktop' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Desktop' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tclassName=\"block-editor-post-preview__button-resize\"\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Tablet' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Tablet' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Tablet' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tclassName=\"block-editor-post-preview__button-resize\"\n\t\t\t\t\t\t\tonClick={ () => setDeviceType( 'Mobile' ) }\n\t\t\t\t\t\t\ticon={ deviceType === 'Mobile' && check }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Mobile' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t{ children }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"]}
@@ -151,7 +151,8 @@ export default function SpacingInputControl(_ref) {
151
151
  className: "components-spacing-sizes-control__custom-value-input",
152
152
  style: {
153
153
  gridColumn: '1'
154
- }
154
+ },
155
+ size: '__unstable-large'
155
156
  }), createElement(RangeControl, {
156
157
  value: customRangeValue,
157
158
  min: 0,
@@ -192,7 +193,8 @@ export default function SpacingInputControl(_ref) {
192
193
  options: options,
193
194
  label: ariaLabel,
194
195
  hideLabelFromVision: true,
195
- __nextUnconstrainedWidth: true
196
+ __nextUnconstrainedWidth: true,
197
+ size: '__unstable-large'
196
198
  }));
197
199
  }
198
200
  //# sourceMappingURL=spacing-input-control.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/spacing-sizes-control/spacing-input-control.js"],"names":["classnames","useState","useMemo","useSelect","BaseControl","Button","RangeControl","CustomSelectControl","__experimentalUnitControl","UnitControl","__experimentalHStack","HStack","__experimentalUseCustomUnits","useCustomUnits","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","__","sprintf","settings","useSetting","store","blockEditorStore","LABELS","getSliderValueFromPreset","getCustomValueFromPreset","getPresetValueFromCustomValue","isValueSpacingPreset","SpacingInputControl","spacingSizes","value","side","onChange","isMixed","type","minimumCustomValue","selectListSizes","showRangeControl","length","disableCustomSpacingSizes","select","editorSettings","getSettings","showCustomValueControl","setShowCustomValueControl","undefined","units","availableUnits","currentValue","showCustomValueInSelectList","name","slug","size","selectedUnit","setInitialValue","customTooltipContent","newValue","customRangeValue","parseInt","getNewCustomValue","newSize","isNumeric","isNaN","parseFloat","nextValue","getNewPresetValue","controlType","handleCustomValueSliderChange","next","join","allPlaceholder","currentValueHint","options","map","index","key","marks","label","ariaLabel","toLowerCase","showHint","gridColumn","event","nativeEvent","offsetX","find","option","selection","selectedItem"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,EAAmBC,OAAnB,QAAkC,oBAAlC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,WADD,EAECC,MAFD,EAGCC,YAHD,EAICC,mBAJD,EAKCC,yBAAyB,IAAIC,WAL9B,EAMCC,oBAAoB,IAAIC,MANzB,EAOCC,4BAA4B,IAAIC,cAPjC,EAQCC,8CAA8C,IAAIC,gCARnD,QASO,uBATP;AAUA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,QAAT,QAAyB,kBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AACA,SACCC,MADD,EAECC,wBAFD,EAGCC,wBAHD,EAICC,6BAJD,EAKCC,oBALD,QAMO,SANP;AAQA,eAAe,SAASC,mBAAT,OAQX;AAAA;;AAAA,MARyC;AAC5CC,IAAAA,YAD4C;AAE5CC,IAAAA,KAF4C;AAG5CC,IAAAA,IAH4C;AAI5CC,IAAAA,QAJ4C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EF,EA+FG,CAAEzC,gBAAF,IAAsB,CAAEM,sBAAxB,IACD,cAAC,mBAAD;AACC,IAAA,SAAS,EAAC,yDADX;AAEC,IAAA,KAAK,EACJ6B,OAAO,CAACa,IAAR,CACGC,MAAF,IAAcA,MAAM,CAACX,GAAP,KAAe3B,YAD9B,KAEK,EAHD,CAGI;AALV;AAOC,IAAA,QAAQ,EAAKuC,SAAF,IAAiB;AAC3BvD,MAAAA,QAAQ,CACPiC,iBAAiB,CAChBsB,SAAS,CAACC,YAAV,CAAuBb,GADP,EAEhB,YAFgB,CADV,CAAR;AAMA,KAdF;AAeC,IAAA,OAAO,EAAGH,OAfX;AAgBC,IAAA,KAAK,EAAGM,SAhBT;AAiBC,IAAA,mBAAmB,EAAG,IAjBvB;AAkBC,IAAA,wBAAwB,EAAG;AAlB5B,IAhGF,CADD;AAwHA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tBaseControl,\n\tButton,\n\tRangeControl,\n\tCustomSelectControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalHStack as HStack,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../use-setting';\nimport { store as blockEditorStore } from '../../store';\nimport {\n\tLABELS,\n\tgetSliderValueFromPreset,\n\tgetCustomValueFromPreset,\n\tgetPresetValueFromCustomValue,\n\tisValueSpacingPreset,\n} from './utils';\n\nexport default function SpacingInputControl( {\n\tspacingSizes,\n\tvalue,\n\tside,\n\tonChange,\n\tisMixed = false,\n\ttype,\n\tminimumCustomValue,\n} ) {\n\t// Treat value as a preset value if the passed in value matches the value of one of the spacingSizes.\n\tvalue = getPresetValueFromCustomValue( value, spacingSizes );\n\n\tlet selectListSizes = spacingSizes;\n\tconst showRangeControl = spacingSizes.length <= 8;\n\n\tconst disableCustomSpacingSizes = useSelect( ( select ) => {\n\t\tconst editorSettings = select( blockEditorStore ).getSettings();\n\t\treturn editorSettings?.disableCustomSpacingSizes;\n\t} );\n\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomSpacingSizes &&\n\t\t\tvalue !== undefined &&\n\t\t\t! isValueSpacingPreset( value )\n\t);\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useSetting( 'spacing.units' ) || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tlet currentValue = null;\n\n\tconst showCustomValueInSelectList =\n\t\t! showRangeControl &&\n\t\t! showCustomValueControl &&\n\t\tvalue !== undefined &&\n\t\t( ! isValueSpacingPreset( value ) ||\n\t\t\t( isValueSpacingPreset( value ) && isMixed ) );\n\n\tif ( showCustomValueInSelectList ) {\n\t\tselectListSizes = [\n\t\t\t...spacingSizes,\n\t\t\t{\n\t\t\t\tname: ! isMixed\n\t\t\t\t\t? // translators: A custom measurement, eg. a number followed by a unit like 12px.\n\t\t\t\t\t sprintf( __( 'Custom (%s)' ), value )\n\t\t\t\t\t: __( 'Mixed' ),\n\t\t\t\tslug: 'custom',\n\t\t\t\tsize: value,\n\t\t\t},\n\t\t];\n\t\tcurrentValue = selectListSizes.length - 1;\n\t} else if ( ! isMixed ) {\n\t\tcurrentValue = ! showCustomValueControl\n\t\t\t? getSliderValueFromPreset( value, spacingSizes )\n\t\t\t: getCustomValueFromPreset( value, spacingSizes );\n\t}\n\n\tconst selectedUnit =\n\t\tuseMemo(\n\t\t\t() => parseQuantityAndUnitFromRawValue( currentValue ),\n\t\t\t[ currentValue ]\n\t\t)[ 1 ] || units[ 0 ].value;\n\n\tconst setInitialValue = () => {\n\t\tif ( value === undefined ) {\n\t\t\tonChange( '0' );\n\t\t}\n\t};\n\n\tconst customTooltipContent = ( newValue ) =>\n\t\tvalue === undefined ? undefined : spacingSizes[ newValue ]?.name;\n\n\tconst customRangeValue = parseInt( currentValue, 10 );\n\n\tconst getNewCustomValue = ( newSize ) => {\n\t\tconst isNumeric = ! isNaN( parseFloat( newSize ) );\n\t\tconst nextValue = isNumeric ? newSize : undefined;\n\t\treturn nextValue;\n\t};\n\n\tconst getNewPresetValue = ( newSize, controlType ) => {\n\t\tconst size = parseInt( newSize, 10 );\n\n\t\tif ( controlType === 'selectList' ) {\n\t\t\tif ( size === 0 ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tif ( size === 1 ) {\n\t\t\t\treturn '0';\n\t\t\t}\n\t\t} else if ( size === 0 ) {\n\t\t\treturn '0';\n\t\t}\n\t\treturn `var:preset|spacing|${ spacingSizes[ newSize ]?.slug }`;\n\t};\n\n\tconst handleCustomValueSliderChange = ( next ) => {\n\t\tonChange( [ next, selectedUnit ].join( '' ) );\n\t};\n\n\tconst allPlaceholder = isMixed ? __( 'Mixed' ) : null;\n\n\tconst currentValueHint = ! isMixed\n\t\t? customTooltipContent( currentValue )\n\t\t: __( 'Mixed' );\n\n\tconst options = selectListSizes.map( ( size, index ) => ( {\n\t\tkey: index,\n\t\tname: size.name,\n\t} ) );\n\n\tconst marks = spacingSizes.map( ( newValue, index ) => ( {\n\t\tvalue: index,\n\t\tlabel: undefined,\n\t} ) );\n\n\tconst ariaLabel = sprintf(\n\t\t// translators: 1: The side of the block being modified (top, bottom, left, etc.). 2. Type of spacing being modified (Padding, margin, etc)\n\t\t__( '%1$s %2$s' ),\n\t\tLABELS[ side ],\n\t\ttype?.toLowerCase()\n\t);\n\n\tconst showHint =\n\t\tshowRangeControl &&\n\t\t! showCustomValueControl &&\n\t\tcurrentValueHint !== undefined;\n\n\treturn (\n\t\t<>\n\t\t\t{ side !== 'all' && (\n\t\t\t\t<HStack className=\"components-spacing-sizes-control__side-labels\">\n\t\t\t\t\t<BaseControl.VisualLabel className=\"components-spacing-sizes-control__side-label\">\n\t\t\t\t\t\t{ LABELS[ side ] }\n\t\t\t\t\t</BaseControl.VisualLabel>\n\n\t\t\t\t\t{ showHint && (\n\t\t\t\t\t\t<BaseControl.VisualLabel className=\"components-spacing-sizes-control__hint-single\">\n\t\t\t\t\t\t\t{ currentValueHint }\n\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t\t{ side === 'all' && showHint && (\n\t\t\t\t<BaseControl.VisualLabel className=\"components-spacing-sizes-control__hint-all\">\n\t\t\t\t\t{ currentValueHint }\n\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t) }\n\n\t\t\t{ ! disableCustomSpacingSizes && (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={\n\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t}\n\t\t\t\t\ticon={ settings }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetShowCustomValueControl( ! showCustomValueControl );\n\t\t\t\t\t} }\n\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\tisSmall\n\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t'components-spacing-sizes-control__custom-toggle-all':\n\t\t\t\t\t\t\tside === 'all',\n\t\t\t\t\t\t'components-spacing-sizes-control__custom-toggle-single':\n\t\t\t\t\t\t\tside !== 'all',\n\t\t\t\t\t} ) }\n\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showCustomValueControl && (\n\t\t\t\t<>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tonChange={ ( newSize ) =>\n\t\t\t\t\t\t\tonChange( getNewCustomValue( newSize ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ currentValue }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tmin={ minimumCustomValue }\n\t\t\t\t\t\tplaceholder={ allPlaceholder }\n\t\t\t\t\t\tdisableUnits={ isMixed }\n\t\t\t\t\t\tlabel={ ariaLabel }\n\t\t\t\t\t\thideLabelFromVision={ true }\n\t\t\t\t\t\tclassName=\"components-spacing-sizes-control__custom-value-input\"\n\t\t\t\t\t\tstyle={ { gridColumn: '1' } }\n\t\t\t\t\t/>\n\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tvalue={ customRangeValue }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\tonChange={ handleCustomValueSliderChange }\n\t\t\t\t\t\tclassName=\"components-spacing-sizes-control__custom-value-range\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ showRangeControl && ! showCustomValueControl && (\n\t\t\t\t<RangeControl\n\t\t\t\t\tclassName=\"components-spacing-sizes-control__range-control\"\n\t\t\t\t\tvalue={ currentValue }\n\t\t\t\t\tonChange={ ( newSize ) =>\n\t\t\t\t\t\tonChange( getNewPresetValue( newSize ) )\n\t\t\t\t\t}\n\t\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\t\t// If mouse down is near start of range set initial value to 0, which\n\t\t\t\t\t\t// prevents the user have to drag right then left to get 0 setting.\n\t\t\t\t\t\tif ( event?.nativeEvent?.offsetX < 35 ) {\n\t\t\t\t\t\t\tsetInitialValue();\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\twithInputField={ false }\n\t\t\t\t\taria-valuenow={ currentValue }\n\t\t\t\t\taria-valuetext={ spacingSizes[ currentValue ]?.name }\n\t\t\t\t\trenderTooltipContent={ customTooltipContent }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tmax={ spacingSizes.length - 1 }\n\t\t\t\t\tmarks={ marks }\n\t\t\t\t\tlabel={ ariaLabel }\n\t\t\t\t\thideLabelFromVision={ true }\n\t\t\t\t\t__nextHasNoMarginBottom={ true }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ ! showRangeControl && ! showCustomValueControl && (\n\t\t\t\t<CustomSelectControl\n\t\t\t\t\tclassName=\"components-spacing-sizes-control__custom-select-control\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\toptions.find(\n\t\t\t\t\t\t\t( option ) => option.key === currentValue\n\t\t\t\t\t\t) || '' // passing undefined here causes a downshift controlled/uncontrolled warning\n\t\t\t\t\t}\n\t\t\t\t\tonChange={ ( selection ) => {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tgetNewPresetValue(\n\t\t\t\t\t\t\t\tselection.selectedItem.key,\n\t\t\t\t\t\t\t\t'selectList'\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\toptions={ options }\n\t\t\t\t\tlabel={ ariaLabel }\n\t\t\t\t\thideLabelFromVision={ true }\n\t\t\t\t\t__nextUnconstrainedWidth={ true }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/spacing-sizes-control/spacing-input-control.js"],"names":["classnames","useState","useMemo","useSelect","BaseControl","Button","RangeControl","CustomSelectControl","__experimentalUnitControl","UnitControl","__experimentalHStack","HStack","__experimentalUseCustomUnits","useCustomUnits","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","__","sprintf","settings","useSetting","store","blockEditorStore","LABELS","getSliderValueFromPreset","getCustomValueFromPreset","getPresetValueFromCustomValue","isValueSpacingPreset","SpacingInputControl","spacingSizes","value","side","onChange","isMixed","type","minimumCustomValue","selectListSizes","showRangeControl","length","disableCustomSpacingSizes","select","editorSettings","getSettings","showCustomValueControl","setShowCustomValueControl","undefined","units","availableUnits","currentValue","showCustomValueInSelectList","name","slug","size","selectedUnit","setInitialValue","customTooltipContent","newValue","customRangeValue","parseInt","getNewCustomValue","newSize","isNumeric","isNaN","parseFloat","nextValue","getNewPresetValue","controlType","handleCustomValueSliderChange","next","join","allPlaceholder","currentValueHint","options","map","index","key","marks","label","ariaLabel","toLowerCase","showHint","gridColumn","event","nativeEvent","offsetX","find","option","selection","selectedItem"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,EAAmBC,OAAnB,QAAkC,oBAAlC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,WADD,EAECC,MAFD,EAGCC,YAHD,EAICC,mBAJD,EAKCC,yBAAyB,IAAIC,WAL9B,EAMCC,oBAAoB,IAAIC,MANzB,EAOCC,4BAA4B,IAAIC,cAPjC,EAQCC,8CAA8C,IAAIC,gCARnD,QASO,uBATP;AAUA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,QAAT,QAAyB,kBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,aAA1C;AACA,SACCC,MADD,EAECC,wBAFD,EAGCC,wBAHD,EAICC,6BAJD,EAKCC,oBALD,QAMO,SANP;AAQA,eAAe,SAASC,mBAAT,OAQX;AAAA;;AAAA,MARyC;AAC5CC,IAAAA,YAD4C;AAE5CC,IAAAA,KAF4C;AAG5CC,IAAAA,IAH4C;AAI5CC,IAAAA,QAJ4C;AAK5CC,IAAAA,OAAO,GAAG,KALkC;AAM5CC,IAAAA,IAN4C;AAO5CC,IAAAA;AAP4C,GAQzC;AACH;AACAL,EAAAA,KAAK,GAAGJ,6BAA6B,CAAEI,KAAF,EAASD,YAAT,CAArC;AAEA,MAAIO,eAAe,GAAGP,YAAtB;AACA,QAAMQ,gBAAgB,GAAGR,YAAY,CAACS,MAAb,IAAuB,CAAhD;AAEA,QAAMC,yBAAyB,GAAGnC,SAAS,CAAIoC,MAAF,IAAc;AAC1D,UAAMC,cAAc,GAAGD,MAAM,CAAElB,gBAAF,CAAN,CAA2Bo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,YAFgB,CADV,CAAR;AAMA,KAdF;AAeC,IAAA,OAAO,EAAGH,OAfX;AAgBC,IAAA,KAAK,EAAGM,SAhBT;AAiBC,IAAA,mBAAmB,EAAG,IAjBvB;AAkBC,IAAA,wBAAwB,EAAG,IAlB5B;AAmBC,IAAA,IAAI,EAAG;AAnBR,IAjGF,CADD;AA0HA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tBaseControl,\n\tButton,\n\tRangeControl,\n\tCustomSelectControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalHStack as HStack,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { settings } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../use-setting';\nimport { store as blockEditorStore } from '../../store';\nimport {\n\tLABELS,\n\tgetSliderValueFromPreset,\n\tgetCustomValueFromPreset,\n\tgetPresetValueFromCustomValue,\n\tisValueSpacingPreset,\n} from './utils';\n\nexport default function SpacingInputControl( {\n\tspacingSizes,\n\tvalue,\n\tside,\n\tonChange,\n\tisMixed = false,\n\ttype,\n\tminimumCustomValue,\n} ) {\n\t// Treat value as a preset value if the passed in value matches the value of one of the spacingSizes.\n\tvalue = getPresetValueFromCustomValue( value, spacingSizes );\n\n\tlet selectListSizes = spacingSizes;\n\tconst showRangeControl = spacingSizes.length <= 8;\n\n\tconst disableCustomSpacingSizes = useSelect( ( select ) => {\n\t\tconst editorSettings = select( blockEditorStore ).getSettings();\n\t\treturn editorSettings?.disableCustomSpacingSizes;\n\t} );\n\n\tconst [ showCustomValueControl, setShowCustomValueControl ] = useState(\n\t\t! disableCustomSpacingSizes &&\n\t\t\tvalue !== undefined &&\n\t\t\t! isValueSpacingPreset( value )\n\t);\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useSetting( 'spacing.units' ) || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tlet currentValue = null;\n\n\tconst showCustomValueInSelectList =\n\t\t! showRangeControl &&\n\t\t! showCustomValueControl &&\n\t\tvalue !== undefined &&\n\t\t( ! isValueSpacingPreset( value ) ||\n\t\t\t( isValueSpacingPreset( value ) && isMixed ) );\n\n\tif ( showCustomValueInSelectList ) {\n\t\tselectListSizes = [\n\t\t\t...spacingSizes,\n\t\t\t{\n\t\t\t\tname: ! isMixed\n\t\t\t\t\t? // translators: A custom measurement, eg. a number followed by a unit like 12px.\n\t\t\t\t\t sprintf( __( 'Custom (%s)' ), value )\n\t\t\t\t\t: __( 'Mixed' ),\n\t\t\t\tslug: 'custom',\n\t\t\t\tsize: value,\n\t\t\t},\n\t\t];\n\t\tcurrentValue = selectListSizes.length - 1;\n\t} else if ( ! isMixed ) {\n\t\tcurrentValue = ! showCustomValueControl\n\t\t\t? getSliderValueFromPreset( value, spacingSizes )\n\t\t\t: getCustomValueFromPreset( value, spacingSizes );\n\t}\n\n\tconst selectedUnit =\n\t\tuseMemo(\n\t\t\t() => parseQuantityAndUnitFromRawValue( currentValue ),\n\t\t\t[ currentValue ]\n\t\t)[ 1 ] || units[ 0 ].value;\n\n\tconst setInitialValue = () => {\n\t\tif ( value === undefined ) {\n\t\t\tonChange( '0' );\n\t\t}\n\t};\n\n\tconst customTooltipContent = ( newValue ) =>\n\t\tvalue === undefined ? undefined : spacingSizes[ newValue ]?.name;\n\n\tconst customRangeValue = parseInt( currentValue, 10 );\n\n\tconst getNewCustomValue = ( newSize ) => {\n\t\tconst isNumeric = ! isNaN( parseFloat( newSize ) );\n\t\tconst nextValue = isNumeric ? newSize : undefined;\n\t\treturn nextValue;\n\t};\n\n\tconst getNewPresetValue = ( newSize, controlType ) => {\n\t\tconst size = parseInt( newSize, 10 );\n\n\t\tif ( controlType === 'selectList' ) {\n\t\t\tif ( size === 0 ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tif ( size === 1 ) {\n\t\t\t\treturn '0';\n\t\t\t}\n\t\t} else if ( size === 0 ) {\n\t\t\treturn '0';\n\t\t}\n\t\treturn `var:preset|spacing|${ spacingSizes[ newSize ]?.slug }`;\n\t};\n\n\tconst handleCustomValueSliderChange = ( next ) => {\n\t\tonChange( [ next, selectedUnit ].join( '' ) );\n\t};\n\n\tconst allPlaceholder = isMixed ? __( 'Mixed' ) : null;\n\n\tconst currentValueHint = ! isMixed\n\t\t? customTooltipContent( currentValue )\n\t\t: __( 'Mixed' );\n\n\tconst options = selectListSizes.map( ( size, index ) => ( {\n\t\tkey: index,\n\t\tname: size.name,\n\t} ) );\n\n\tconst marks = spacingSizes.map( ( newValue, index ) => ( {\n\t\tvalue: index,\n\t\tlabel: undefined,\n\t} ) );\n\n\tconst ariaLabel = sprintf(\n\t\t// translators: 1: The side of the block being modified (top, bottom, left, etc.). 2. Type of spacing being modified (Padding, margin, etc)\n\t\t__( '%1$s %2$s' ),\n\t\tLABELS[ side ],\n\t\ttype?.toLowerCase()\n\t);\n\n\tconst showHint =\n\t\tshowRangeControl &&\n\t\t! showCustomValueControl &&\n\t\tcurrentValueHint !== undefined;\n\n\treturn (\n\t\t<>\n\t\t\t{ side !== 'all' && (\n\t\t\t\t<HStack className=\"components-spacing-sizes-control__side-labels\">\n\t\t\t\t\t<BaseControl.VisualLabel className=\"components-spacing-sizes-control__side-label\">\n\t\t\t\t\t\t{ LABELS[ side ] }\n\t\t\t\t\t</BaseControl.VisualLabel>\n\n\t\t\t\t\t{ showHint && (\n\t\t\t\t\t\t<BaseControl.VisualLabel className=\"components-spacing-sizes-control__hint-single\">\n\t\t\t\t\t\t\t{ currentValueHint }\n\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t) }\n\t\t\t{ side === 'all' && showHint && (\n\t\t\t\t<BaseControl.VisualLabel className=\"components-spacing-sizes-control__hint-all\">\n\t\t\t\t\t{ currentValueHint }\n\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t) }\n\n\t\t\t{ ! disableCustomSpacingSizes && (\n\t\t\t\t<Button\n\t\t\t\t\tlabel={\n\t\t\t\t\t\tshowCustomValueControl\n\t\t\t\t\t\t\t? __( 'Use size preset' )\n\t\t\t\t\t\t\t: __( 'Set custom size' )\n\t\t\t\t\t}\n\t\t\t\t\ticon={ settings }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetShowCustomValueControl( ! showCustomValueControl );\n\t\t\t\t\t} }\n\t\t\t\t\tisPressed={ showCustomValueControl }\n\t\t\t\t\tisSmall\n\t\t\t\t\tclassName={ classnames( {\n\t\t\t\t\t\t'components-spacing-sizes-control__custom-toggle-all':\n\t\t\t\t\t\t\tside === 'all',\n\t\t\t\t\t\t'components-spacing-sizes-control__custom-toggle-single':\n\t\t\t\t\t\t\tside !== 'all',\n\t\t\t\t\t} ) }\n\t\t\t\t\ticonSize={ 24 }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ showCustomValueControl && (\n\t\t\t\t<>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tonChange={ ( newSize ) =>\n\t\t\t\t\t\t\tonChange( getNewCustomValue( newSize ) )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ currentValue }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tmin={ minimumCustomValue }\n\t\t\t\t\t\tplaceholder={ allPlaceholder }\n\t\t\t\t\t\tdisableUnits={ isMixed }\n\t\t\t\t\t\tlabel={ ariaLabel }\n\t\t\t\t\t\thideLabelFromVision={ true }\n\t\t\t\t\t\tclassName=\"components-spacing-sizes-control__custom-value-input\"\n\t\t\t\t\t\tstyle={ { gridColumn: '1' } }\n\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t/>\n\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tvalue={ customRangeValue }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\tonChange={ handleCustomValueSliderChange }\n\t\t\t\t\t\tclassName=\"components-spacing-sizes-control__custom-value-range\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ showRangeControl && ! showCustomValueControl && (\n\t\t\t\t<RangeControl\n\t\t\t\t\tclassName=\"components-spacing-sizes-control__range-control\"\n\t\t\t\t\tvalue={ currentValue }\n\t\t\t\t\tonChange={ ( newSize ) =>\n\t\t\t\t\t\tonChange( getNewPresetValue( newSize ) )\n\t\t\t\t\t}\n\t\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\t\t// If mouse down is near start of range set initial value to 0, which\n\t\t\t\t\t\t// prevents the user have to drag right then left to get 0 setting.\n\t\t\t\t\t\tif ( event?.nativeEvent?.offsetX < 35 ) {\n\t\t\t\t\t\t\tsetInitialValue();\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\twithInputField={ false }\n\t\t\t\t\taria-valuenow={ currentValue }\n\t\t\t\t\taria-valuetext={ spacingSizes[ currentValue ]?.name }\n\t\t\t\t\trenderTooltipContent={ customTooltipContent }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tmax={ spacingSizes.length - 1 }\n\t\t\t\t\tmarks={ marks }\n\t\t\t\t\tlabel={ ariaLabel }\n\t\t\t\t\thideLabelFromVision={ true }\n\t\t\t\t\t__nextHasNoMarginBottom={ true }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ ! showRangeControl && ! showCustomValueControl && (\n\t\t\t\t<CustomSelectControl\n\t\t\t\t\tclassName=\"components-spacing-sizes-control__custom-select-control\"\n\t\t\t\t\tvalue={\n\t\t\t\t\t\toptions.find(\n\t\t\t\t\t\t\t( option ) => option.key === currentValue\n\t\t\t\t\t\t) || '' // passing undefined here causes a downshift controlled/uncontrolled warning\n\t\t\t\t\t}\n\t\t\t\t\tonChange={ ( selection ) => {\n\t\t\t\t\t\tonChange(\n\t\t\t\t\t\t\tgetNewPresetValue(\n\t\t\t\t\t\t\t\tselection.selectedItem.key,\n\t\t\t\t\t\t\t\t'selectList'\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\toptions={ options }\n\t\t\t\t\tlabel={ ariaLabel }\n\t\t\t\t\thideLabelFromVision={ true }\n\t\t\t\t\t__nextUnconstrainedWidth={ true }\n\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
@@ -1068,6 +1068,7 @@
1068
1068
  .block-editor-block-patterns-list__list-item {
1069
1069
  cursor: pointer;
1070
1070
  margin-bottom: 24px;
1071
+ position: relative;
1071
1072
  }
1072
1073
  .block-editor-block-patterns-list__list-item.is-placeholder {
1073
1074
  min-height: 100px;
@@ -1712,10 +1713,10 @@
1712
1713
  color: #000;
1713
1714
  }
1714
1715
 
1715
- .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child {
1716
+ .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child {
1716
1717
  pointer-events: none;
1717
1718
  }
1718
- .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after {
1719
+ .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child::after {
1719
1720
  content: "";
1720
1721
  position: absolute;
1721
1722
  top: 0;
@@ -1726,7 +1727,7 @@
1726
1727
  border: 1px dashed currentColor;
1727
1728
  border-radius: 2px;
1728
1729
  }
1729
- .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter {
1730
+ .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child .block-editor-inserter {
1730
1731
  visibility: hidden;
1731
1732
  }
1732
1733
 
@@ -4273,7 +4274,7 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4273
4274
  display: grid;
4274
4275
  grid-template-columns: auto 1fr auto;
4275
4276
  align-items: center;
4276
- grid-template-rows: 25px auto;
4277
+ grid-template-rows: 16px auto;
4277
4278
  }
4278
4279
 
4279
4280
  .component-spacing-sizes-control {
@@ -4296,15 +4297,16 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4296
4297
  grid-column: 1/1;
4297
4298
  justify-content: left;
4298
4299
  height: 16px;
4299
- margin-top: 12px;
4300
+ margin-top: 16px;
4300
4301
  }
4301
4302
  .component-spacing-sizes-control .components-spacing-sizes-control__side-label {
4302
4303
  grid-column: 1/1;
4303
4304
  justify-self: left;
4304
4305
  margin-bottom: 0;
4305
4306
  }
4306
- .component-spacing-sizes-control.is-unlinked .components-range-control.components-spacing-sizes-control__range-control {
4307
- margin-top: 12px;
4307
+ .component-spacing-sizes-control.is-unlinked .components-range-control.components-spacing-sizes-control__range-control,
4308
+ .component-spacing-sizes-control.is-unlinked .components-spacing-sizes-control__custom-value-input {
4309
+ margin-top: 8px;
4308
4310
  }
4309
4311
  .component-spacing-sizes-control .components-spacing-sizes-control__hint-single,
4310
4312
  .component-spacing-sizes-control .components-spacing-sizes-control__hint-all {
@@ -4322,12 +4324,7 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4322
4324
  grid-column: 2/2;
4323
4325
  grid-row: 1/1;
4324
4326
  justify-self: end;
4325
- padding: 0;
4326
- }
4327
- .component-spacing-sizes-control .components-spacing-sizes-control__custom-toggle-all.is-small.has-icon {
4328
- padding: 0;
4329
- min-width: 24px;
4330
- height: 16px;
4327
+ margin-top: -4px;
4331
4328
  }
4332
4329
  .component-spacing-sizes-control .component-spacing-sizes-control__linked-button ~ .components-spacing-sizes-control__custom-toggle-all {
4333
4330
  margin-left: 4px;
@@ -4335,29 +4332,37 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4335
4332
  .component-spacing-sizes-control .components-spacing-sizes-control__custom-toggle-single {
4336
4333
  grid-column: 3/3;
4337
4334
  justify-self: end;
4338
- }
4339
- .component-spacing-sizes-control .components-spacing-sizes-control__custom-toggle-single.is-small.has-icon {
4340
- padding: 0;
4341
- min-width: 24px;
4342
- height: 16px;
4343
4335
  margin-top: 12px;
4344
4336
  }
4345
4337
  .component-spacing-sizes-control .component-spacing-sizes-control__linked-button {
4346
4338
  grid-column: 3/3;
4347
4339
  grid-row: 1/1;
4348
4340
  justify-self: end;
4341
+ line-height: 0;
4342
+ margin-top: -4px;
4349
4343
  }
4350
4344
  .component-spacing-sizes-control .components-spacing-sizes-control__custom-value-range {
4351
4345
  grid-column: span 2;
4352
- margin-right: 8px;
4353
- height: 30px;
4346
+ margin-right: 16px;
4347
+ margin-top: 8px;
4354
4348
  }
4355
4349
  .component-spacing-sizes-control .components-spacing-sizes-control__custom-value-input {
4356
4350
  width: 124px;
4351
+ margin-top: 8px;
4352
+ }
4353
+ .component-spacing-sizes-control .components-range-control {
4354
+ height: 40px;
4355
+ /* Vertically center the RangeControl until it has true 40px height. */
4356
+ display: flex;
4357
+ align-items: center;
4358
+ }
4359
+ .component-spacing-sizes-control .components-range-control > .components-base-control__field {
4360
+ /* Fixes RangeControl contents when the outer wrapper is flex */
4361
+ flex: 1;
4357
4362
  }
4358
4363
  .component-spacing-sizes-control .components-spacing-sizes-control__range-control {
4359
4364
  grid-column: span 3;
4360
- height: 40px;
4365
+ margin-top: 8px;
4361
4366
  }
4362
4367
  .component-spacing-sizes-control .components-range-control__mark {
4363
4368
  height: 4px;
@@ -4376,6 +4381,7 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4376
4381
  }
4377
4382
  .component-spacing-sizes-control .components-spacing-sizes-control__custom-select-control {
4378
4383
  grid-column: span 3;
4384
+ margin-top: 8px;
4379
4385
  }
4380
4386
 
4381
4387
  body.admin-color-light {
@@ -1068,6 +1068,7 @@
1068
1068
  .block-editor-block-patterns-list__list-item {
1069
1069
  cursor: pointer;
1070
1070
  margin-bottom: 24px;
1071
+ position: relative;
1071
1072
  }
1072
1073
  .block-editor-block-patterns-list__list-item.is-placeholder {
1073
1074
  min-height: 100px;
@@ -1712,10 +1713,10 @@
1712
1713
  color: #000;
1713
1714
  }
1714
1715
 
1715
- .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child {
1716
+ .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child {
1716
1717
  pointer-events: none;
1717
1718
  }
1718
- .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child::after {
1719
+ .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child::after, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child::after, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child::after {
1719
1720
  content: "";
1720
1721
  position: absolute;
1721
1722
  top: 0;
@@ -1726,7 +1727,7 @@
1726
1727
  border: 1px dashed currentColor;
1727
1728
  border-radius: 2px;
1728
1729
  }
1729
- .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > .block-list-appender:only-child .block-editor-inserter {
1730
+ .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-list-appender:only-child .block-editor-inserter, .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child .block-editor-inserter, .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > .block-list-appender:only-child .block-editor-inserter {
1730
1731
  visibility: hidden;
1731
1732
  }
1732
1733
 
@@ -4273,7 +4274,7 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4273
4274
  display: grid;
4274
4275
  grid-template-columns: auto 1fr auto;
4275
4276
  align-items: center;
4276
- grid-template-rows: 25px auto;
4277
+ grid-template-rows: 16px auto;
4277
4278
  }
4278
4279
 
4279
4280
  .component-spacing-sizes-control {
@@ -4296,15 +4297,16 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4296
4297
  grid-column: 1/1;
4297
4298
  justify-content: left;
4298
4299
  height: 16px;
4299
- margin-top: 12px;
4300
+ margin-top: 16px;
4300
4301
  }
4301
4302
  .component-spacing-sizes-control .components-spacing-sizes-control__side-label {
4302
4303
  grid-column: 1/1;
4303
4304
  justify-self: left;
4304
4305
  margin-bottom: 0;
4305
4306
  }
4306
- .component-spacing-sizes-control.is-unlinked .components-range-control.components-spacing-sizes-control__range-control {
4307
- margin-top: 12px;
4307
+ .component-spacing-sizes-control.is-unlinked .components-range-control.components-spacing-sizes-control__range-control,
4308
+ .component-spacing-sizes-control.is-unlinked .components-spacing-sizes-control__custom-value-input {
4309
+ margin-top: 8px;
4308
4310
  }
4309
4311
  .component-spacing-sizes-control .components-spacing-sizes-control__hint-single,
4310
4312
  .component-spacing-sizes-control .components-spacing-sizes-control__hint-all {
@@ -4322,12 +4324,7 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4322
4324
  grid-column: 2/2;
4323
4325
  grid-row: 1/1;
4324
4326
  justify-self: end;
4325
- padding: 0;
4326
- }
4327
- .component-spacing-sizes-control .components-spacing-sizes-control__custom-toggle-all.is-small.has-icon {
4328
- padding: 0;
4329
- min-width: 24px;
4330
- height: 16px;
4327
+ margin-top: -4px;
4331
4328
  }
4332
4329
  .component-spacing-sizes-control .component-spacing-sizes-control__linked-button ~ .components-spacing-sizes-control__custom-toggle-all {
4333
4330
  margin-right: 4px;
@@ -4335,29 +4332,37 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4335
4332
  .component-spacing-sizes-control .components-spacing-sizes-control__custom-toggle-single {
4336
4333
  grid-column: 3/3;
4337
4334
  justify-self: end;
4338
- }
4339
- .component-spacing-sizes-control .components-spacing-sizes-control__custom-toggle-single.is-small.has-icon {
4340
- padding: 0;
4341
- min-width: 24px;
4342
- height: 16px;
4343
4335
  margin-top: 12px;
4344
4336
  }
4345
4337
  .component-spacing-sizes-control .component-spacing-sizes-control__linked-button {
4346
4338
  grid-column: 3/3;
4347
4339
  grid-row: 1/1;
4348
4340
  justify-self: end;
4341
+ line-height: 0;
4342
+ margin-top: -4px;
4349
4343
  }
4350
4344
  .component-spacing-sizes-control .components-spacing-sizes-control__custom-value-range {
4351
4345
  grid-column: span 2;
4352
- margin-left: 8px;
4353
- height: 30px;
4346
+ margin-left: 16px;
4347
+ margin-top: 8px;
4354
4348
  }
4355
4349
  .component-spacing-sizes-control .components-spacing-sizes-control__custom-value-input {
4356
4350
  width: 124px;
4351
+ margin-top: 8px;
4352
+ }
4353
+ .component-spacing-sizes-control .components-range-control {
4354
+ height: 40px;
4355
+ /* Vertically center the RangeControl until it has true 40px height. */
4356
+ display: flex;
4357
+ align-items: center;
4358
+ }
4359
+ .component-spacing-sizes-control .components-range-control > .components-base-control__field {
4360
+ /* Fixes RangeControl contents when the outer wrapper is flex */
4361
+ flex: 1;
4357
4362
  }
4358
4363
  .component-spacing-sizes-control .components-spacing-sizes-control__range-control {
4359
4364
  grid-column: span 3;
4360
- height: 40px;
4365
+ margin-top: 8px;
4361
4366
  }
4362
4367
  .component-spacing-sizes-control .components-range-control__mark {
4363
4368
  height: 4px;
@@ -4376,6 +4381,7 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
4376
4381
  }
4377
4382
  .component-spacing-sizes-control .components-spacing-sizes-control__custom-select-control {
4378
4383
  grid-column: span 3;
4384
+ margin-top: 8px;
4379
4385
  }
4380
4386
 
4381
4387
  body.admin-color-light {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "10.0.6",
3
+ "version": "10.0.8",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,7 +37,7 @@
37
37
  "@wordpress/api-fetch": "^6.14.1",
38
38
  "@wordpress/blob": "^3.17.1",
39
39
  "@wordpress/blocks": "^11.16.4",
40
- "@wordpress/components": "^21.0.5",
40
+ "@wordpress/components": "^21.0.6",
41
41
  "@wordpress/compose": "^5.15.2",
42
42
  "@wordpress/data": "^7.1.3",
43
43
  "@wordpress/date": "^4.17.1",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "e0bb20cabd2152c8f0f6758e1b4e17fa24c5e588"
81
+ "gitHead": "21ef2792a2c3889830aee525f0136657a570c265"
82
82
  }
@@ -144,6 +144,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
144
144
  getSelectedBlockCount,
145
145
  getBlockName,
146
146
  __unstableGetContentLockingParent,
147
+ getTemplateLock,
147
148
  } = select( blockEditorStore );
148
149
 
149
150
  const _selectedBlockClientId = getSelectedBlockClientId();
@@ -157,9 +158,11 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
157
158
  selectedBlockClientId: _selectedBlockClientId,
158
159
  selectedBlockName: _selectedBlockName,
159
160
  blockType: _blockType,
160
- topLevelLockedBlock: __unstableGetContentLockingParent(
161
- _selectedBlockClientId
162
- ),
161
+ topLevelLockedBlock:
162
+ __unstableGetContentLockingParent( _selectedBlockClientId ) ||
163
+ ( getTemplateLock( _selectedBlockClientId ) === 'contentOnly'
164
+ ? _selectedBlockClientId
165
+ : undefined ),
163
166
  };
164
167
  }, [] );
165
168
 
@@ -2,6 +2,11 @@
2
2
  cursor: pointer;
3
3
  margin-bottom: $grid-unit-30;
4
4
 
5
+ // The list item contains absolutely positioned visually hidden text,
6
+ // so make this container relative. This prevents the bug experienced in
7
+ // https://github.com/WordPress/gutenberg/issues/44842.
8
+ position: relative;
9
+
5
10
  &.is-placeholder {
6
11
  min-height: 100px;
7
12
  }
@@ -36,8 +36,9 @@
36
36
  .block-list-appender:only-child {
37
37
  .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > &,
38
38
  .is-layout-flow.block-editor-block-list__block:not(.is-selected) > &,
39
- .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > &,
40
- .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .block-editor-block-list__layout > & {
39
+ // Legacy groups have an inner container so need to be targeted separately
40
+ .is-layout-constrained.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > &,
41
+ .is-layout-flow.block-editor-block-list__block:not(.is-selected) > .wp-block-group__inner-container > & {
41
42
  pointer-events: none;
42
43
 
43
44
  &::after {