@wordpress/block-editor 15.15.0 → 15.16.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 (94) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-inspector/index.cjs +2 -1
  3. package/build/components/block-inspector/index.cjs.map +2 -2
  4. package/build/components/block-visibility/modal.cjs +2 -2
  5. package/build/components/block-visibility/modal.cjs.map +1 -1
  6. package/build/components/block-visibility/viewport-visibility-info.cjs +6 -1
  7. package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
  8. package/build/components/global-styles/background-panel.cjs +142 -33
  9. package/build/components/global-styles/background-panel.cjs.map +2 -2
  10. package/build/components/global-styles/color-panel.cjs +18 -7
  11. package/build/components/global-styles/color-panel.cjs.map +2 -2
  12. package/build/components/global-styles/hooks.cjs +8 -4
  13. package/build/components/global-styles/hooks.cjs.map +2 -2
  14. package/build/components/inspector-controls-tabs/styles-tab.cjs +2 -1
  15. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  16. package/build/hooks/background.cjs +74 -21
  17. package/build/hooks/background.cjs.map +3 -3
  18. package/build/hooks/cross-origin-isolation.cjs +6 -6
  19. package/build/hooks/cross-origin-isolation.cjs.map +2 -2
  20. package/build/hooks/custom-css.cjs +5 -0
  21. package/build/hooks/custom-css.cjs.map +2 -2
  22. package/build/hooks/fit-text.cjs +46 -58
  23. package/build/hooks/fit-text.cjs.map +3 -3
  24. package/build/hooks/utils.cjs +5 -1
  25. package/build/hooks/utils.cjs.map +2 -2
  26. package/build/store/actions.cjs +8 -4
  27. package/build/store/actions.cjs.map +2 -2
  28. package/build/store/private-selectors.cjs +2 -2
  29. package/build/store/private-selectors.cjs.map +2 -2
  30. package/build/store/reducer.cjs +62 -95
  31. package/build/store/reducer.cjs.map +2 -2
  32. package/build/store/selectors.cjs +2 -2
  33. package/build/store/selectors.cjs.map +2 -2
  34. package/build-module/components/block-inspector/index.mjs +2 -1
  35. package/build-module/components/block-inspector/index.mjs.map +2 -2
  36. package/build-module/components/block-visibility/modal.mjs +2 -2
  37. package/build-module/components/block-visibility/modal.mjs.map +1 -1
  38. package/build-module/components/block-visibility/viewport-visibility-info.mjs +6 -1
  39. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
  40. package/build-module/components/global-styles/background-panel.mjs +141 -34
  41. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  42. package/build-module/components/global-styles/color-panel.mjs +17 -7
  43. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  44. package/build-module/components/global-styles/hooks.mjs +8 -4
  45. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  46. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +2 -1
  47. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  48. package/build-module/hooks/background.mjs +76 -22
  49. package/build-module/hooks/background.mjs.map +2 -2
  50. package/build-module/hooks/cross-origin-isolation.mjs +6 -6
  51. package/build-module/hooks/cross-origin-isolation.mjs.map +2 -2
  52. package/build-module/hooks/custom-css.mjs +5 -0
  53. package/build-module/hooks/custom-css.mjs.map +2 -2
  54. package/build-module/hooks/fit-text.mjs +46 -58
  55. package/build-module/hooks/fit-text.mjs.map +2 -2
  56. package/build-module/hooks/utils.mjs +5 -1
  57. package/build-module/hooks/utils.mjs.map +2 -2
  58. package/build-module/store/actions.mjs +8 -4
  59. package/build-module/store/actions.mjs.map +2 -2
  60. package/build-module/store/private-selectors.mjs +2 -2
  61. package/build-module/store/private-selectors.mjs.map +2 -2
  62. package/build-module/store/reducer.mjs +62 -94
  63. package/build-module/store/reducer.mjs.map +2 -2
  64. package/build-module/store/selectors.mjs +2 -2
  65. package/build-module/store/selectors.mjs.map +2 -2
  66. package/build-style/content-rtl.css +2 -2
  67. package/build-style/content.css +2 -2
  68. package/build-style/style-rtl.css +35 -7
  69. package/build-style/style.css +35 -7
  70. package/package.json +39 -39
  71. package/src/components/background-image-control/style.scss +0 -4
  72. package/src/components/block-inspector/index.js +1 -0
  73. package/src/components/block-visibility/viewport-visibility-info.js +8 -1
  74. package/src/components/fit-text-size-warning/style.scss +1 -5
  75. package/src/components/global-styles/background-panel.js +157 -11
  76. package/src/components/global-styles/color-panel.js +23 -7
  77. package/src/components/global-styles/hooks.js +12 -4
  78. package/src/components/global-styles/test/background-panel.js +44 -1
  79. package/src/components/inspector-controls-tabs/styles-tab.js +1 -0
  80. package/src/hooks/background.js +122 -21
  81. package/src/hooks/background.scss +45 -0
  82. package/src/hooks/cross-origin-isolation.js +6 -6
  83. package/src/hooks/custom-css.js +6 -0
  84. package/src/hooks/fit-text.js +73 -83
  85. package/src/hooks/test/cross-origin-isolation.js +7 -3
  86. package/src/hooks/utils.js +4 -0
  87. package/src/store/actions.js +9 -8
  88. package/src/store/private-selectors.js +2 -2
  89. package/src/store/reducer.js +84 -128
  90. package/src/store/selectors.js +2 -2
  91. package/src/store/test/private-selectors.js +67 -34
  92. package/src/store/test/reducer.js +436 -66
  93. package/src/store/test/selectors.js +81 -63
  94. package/src/style.scss +1 -0
@@ -51,7 +51,8 @@ function StyleInspectorSlots({
51
51
  InspectorControls.Slot,
52
52
  {
53
53
  group: "background",
54
- label: __("Background image")
54
+ label: __("Background image"),
55
+ className: "background-block-support-panel__inner-wrapper"
55
56
  }
56
57
  ),
57
58
  /* @__PURE__ */ jsx(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/block-inspector/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetUnregisteredTypeHandlerName,\n\thasBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EditContents from './edit-contents';\nimport SkipToSelectedBlock from '../skip-to-selected-block';\nimport BlockCard from '../block-card';\nimport MultiSelectionInspector from '../multi-selection-inspector';\nimport BlockVariationTransforms from '../block-variation-transforms';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\nimport BlockStyles from '../block-styles';\nimport { ListViewContentPopover } from '../inspector-controls/list-view-content-popover';\nimport InspectorControls from '../inspector-controls';\nimport { default as InspectorControlsTabs } from '../inspector-controls-tabs';\nimport useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';\nimport InspectorControlsLastItem from '../inspector-controls/last-item';\nimport AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';\nimport PositionControls from '../inspector-controls-tabs/position-controls-panel';\nimport useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';\nimport { useBorderPanelLabel } from '../../hooks/border';\nimport ContentTab from '../inspector-controls-tabs/content-tab';\nimport ViewportVisibilityInfo from '../block-visibility/viewport-visibility-info';\nimport { unlock } from '../../lock-unlock';\n\nfunction StyleInspectorSlots( {\n\tblockName,\n\tshowAdvancedControls = true,\n\tshowPositionControls = true,\n\tshowBindingsControls = true,\n} ) {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls.Slot />\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"color\"\n\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"background\"\n\t\t\t\tlabel={ __( 'Background image' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"typography\"\n\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"border\" label={ borderPanelLabel } />\n\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t{ showPositionControls && <PositionControls /> }\n\t\t\t{ showBindingsControls && (\n\t\t\t\t<InspectorControls.Slot group=\"bindings\" />\n\t\t\t) }\n\t\t\t{ showAdvancedControls && (\n\t\t\t\t<div>\n\t\t\t\t\t<AdvancedControls />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction BlockInspector() {\n\tconst {\n\t\tselectedBlockCount,\n\t\trenderedBlockName,\n\t\trenderedBlockClientId,\n\t\tblockType,\n\t\tisSectionBlock,\n\t\tisSectionBlockInSelection,\n\t\thasBlockStyles,\n\t\teditedContentOnlySection,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetSelectedBlockCount,\n\t\t\tgetBlockName,\n\t\t\tgetParentSectionBlock,\n\t\t\tisSectionBlock: _isSectionBlock,\n\t\t\tgetEditedContentOnlySection,\n\t\t\tisWithinEditedContentOnlySection,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { getBlockStyles } = select( blocksStore );\n\t\tconst _selectedBlockClientId = getSelectedBlockClientId();\n\t\tconst isWithinEditedSection = isWithinEditedContentOnlySection(\n\t\t\t_selectedBlockClientId\n\t\t);\n\t\tconst _renderedBlockClientId = isWithinEditedSection\n\t\t\t? _selectedBlockClientId\n\t\t\t: getParentSectionBlock( _selectedBlockClientId ) ||\n\t\t\t _selectedBlockClientId;\n\t\tconst _renderedBlockName =\n\t\t\t_renderedBlockClientId && getBlockName( _renderedBlockClientId );\n\t\tconst _blockType =\n\t\t\t_renderedBlockName && getBlockType( _renderedBlockName );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst _isSectionBlockInSelection = selectedBlockClientIds.some(\n\t\t\t( id ) => _isSectionBlock( id )\n\t\t);\n\t\tconst blockStyles =\n\t\t\t_renderedBlockName && getBlockStyles( _renderedBlockName );\n\t\tconst _hasBlockStyles = blockStyles && blockStyles.length > 0;\n\n\t\treturn {\n\t\t\tselectedBlockCount: getSelectedBlockCount(),\n\t\t\trenderedBlockClientId: _renderedBlockClientId,\n\t\t\trenderedBlockName: _renderedBlockName,\n\t\t\tblockType: _blockType,\n\t\t\tisSectionBlockInSelection: _isSectionBlockInSelection,\n\t\t\tisSectionBlock: _isSectionBlock( _renderedBlockClientId ),\n\t\t\thasBlockStyles: _hasBlockStyles,\n\t\t\teditedContentOnlySection: getEditedContentOnlySection(),\n\t\t};\n\t}, [] );\n\n\t// Separate useSelect for contentClientIds with proper dependencies\n\tconst contentClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSectionBlock || ! renderedBlockClientId ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst descendants = getClientIdsOfDescendants(\n\t\t\t\trenderedBlockClientId\n\t\t\t);\n\n\t\t\t// Exclude items from the content tab that are already present in the\n\t\t\t// List View tab.\n\t\t\tconst listViewDescendants = new Set();\n\t\t\tdescendants.forEach( ( clientId ) => {\n\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t// Navigation block doesn't have List View block support, but\n\t\t\t\t// it does have a custom implementation that is shown within\n\t\t\t\t// patterns, so it's included in this condition.\n\t\t\t\tif (\n\t\t\t\t\tblockName === 'core/navigation' ||\n\t\t\t\t\thasBlockSupport( blockName, 'listView' )\n\t\t\t\t) {\n\t\t\t\t\tconst listViewChildren =\n\t\t\t\t\t\tgetClientIdsOfDescendants( clientId );\n\t\t\t\t\tlistViewChildren.forEach( ( childId ) =>\n\t\t\t\t\t\tlistViewDescendants.add( childId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn descendants.filter( ( current ) => {\n\t\t\t\treturn (\n\t\t\t\t\t! listViewDescendants.has( current ) &&\n\t\t\t\t\tgetBlockEditingMode( current ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t[ isSectionBlock, renderedBlockClientId ]\n\t);\n\n\tconst availableTabs = useInspectorControlsTabs(\n\t\tblockType?.name,\n\t\tcontentClientIds,\n\t\tisSectionBlock,\n\t\thasBlockStyles\n\t);\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\n\t// The block inspector animation settings will be completely\n\t// removed in the future to create an API which allows the block\n\t// inspector to transition between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tconst blockInspectorAnimationSettings =\n\t\tuseBlockInspectorAnimationSettings( blockType );\n\n\tconst hasSelectedBlocks = selectedBlockCount > 1;\n\n\tif ( hasSelectedBlocks && ! isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t\t{ hasMultipleTabs ? (\n\t\t\t\t\t<InspectorControlsTabs tabs={ availableTabs } />\n\t\t\t\t) : (\n\t\t\t\t\t<StyleInspectorSlots\n\t\t\t\t\t\tblockName={ renderedBlockName }\n\t\t\t\t\t\tshowAdvancedControls={ false }\n\t\t\t\t\t\tshowPositionControls={ false }\n\t\t\t\t\t\tshowBindingsControls={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( hasSelectedBlocks && isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst isRenderedBlockUnregistered =\n\t\trenderedBlockName === getUnregisteredTypeHandlerName();\n\n\t/*\n\t * If the rendered block is of an unregistered type, avoid showing it as an actual selection\n\t * because we want the user to focus on the unregistered block warning, not block settings.\n\t */\n\tconst shouldShowWarning =\n\t\t! blockType || ! renderedBlockClientId || isRenderedBlockUnregistered;\n\n\tif ( shouldShowWarning ) {\n\t\treturn (\n\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t</span>\n\t\t);\n\t}\n\n\treturn (\n\t\t<BlockInspectorSingleBlockWrapper\n\t\t\tanimate={ blockInspectorAnimationSettings }\n\t\t\twrapper={ ( children ) => (\n\t\t\t\t<AnimatedContainer\n\t\t\t\t\tblockInspectorAnimationSettings={\n\t\t\t\t\t\tblockInspectorAnimationSettings\n\t\t\t\t\t}\n\t\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</AnimatedContainer>\n\t\t\t) }\n\t\t>\n\t\t\t<BlockInspectorSingleBlock\n\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\tblockName={ blockType.name }\n\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\tavailableTabs={ availableTabs }\n\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\teditedContentOnlySection={ editedContentOnlySection }\n\t\t\t/>\n\t\t</BlockInspectorSingleBlockWrapper>\n\t);\n}\n\nconst BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {\n\treturn animate ? wrapper( children ) : children;\n};\n\nconst AnimatedContainer = ( {\n\tblockInspectorAnimationSettings,\n\trenderedBlockClientId,\n\tchildren,\n} ) => {\n\tconst animationOrigin =\n\t\tblockInspectorAnimationSettings &&\n\t\tblockInspectorAnimationSettings.enterDirection === 'leftToRight'\n\t\t\t? -50\n\t\t\t: 50;\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\tease: 'easeInOut',\n\t\t\t\t\tduration: 0.14,\n\t\t\t\t},\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tx: animationOrigin,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\tkey={ renderedBlockClientId }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n};\n\nconst BlockInspectorSingleBlock = ( {\n\t// The block that is displayed in the inspector. This is the block whose\n\t// controls and information are shown to the user.\n\trenderedBlockClientId,\n\tblockName,\n\tisSectionBlock,\n\tavailableTabs,\n\tcontentClientIds,\n\thasBlockStyles,\n\teditedContentOnlySection,\n} ) => {\n\tconst listViewRef = useRef( null );\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\tconst hasParentChildBlockCards =\n\t\teditedContentOnlySection &&\n\t\teditedContentOnlySection !== renderedBlockClientId;\n\tconst parentBlockInformation = useBlockDisplayInformation(\n\t\teditedContentOnlySection\n\t);\n\tconst blockInformation = useBlockDisplayInformation(\n\t\trenderedBlockClientId\n\t);\n\tconst isBlockSynced = blockInformation.isSynced;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t{ hasParentChildBlockCards && (\n\t\t\t\t<BlockCard\n\t\t\t\t\t{ ...parentBlockInformation }\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tparentBlockInformation?.isSynced && 'is-synced'\n\t\t\t\t\t}\n\t\t\t\t\tparentClientId={ editedContentOnlySection }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<BlockCard\n\t\t\t\t{ ...blockInformation }\n\t\t\t\tallowParentNavigation\n\t\t\t\tclassName={ isBlockSynced && 'is-synced' }\n\t\t\t\tisChild={ hasParentChildBlockCards }\n\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t/>\n\t\t\t<ViewportVisibilityInfo clientId={ renderedBlockClientId } />\n\t\t\t<EditContents clientId={ renderedBlockClientId } />\n\t\t\t<BlockVariationTransforms blockClientId={ renderedBlockClientId } />\n\t\t\t{ hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t<InspectorControlsTabs\n\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\ttabs={ availableTabs }\n\t\t\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ ! hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t{ hasBlockStyles && (\n\t\t\t\t\t\t<BlockStyles clientId={ renderedBlockClientId } />\n\t\t\t\t\t) }\n\t\t\t\t\t<ContentTab contentClientIds={ contentClientIds } />\n\t\t\t\t\t<InspectorControls.Slot group=\"content\" />\n\t\t\t\t\t<InspectorControls.Slot group=\"list\" ref={ listViewRef } />\n\t\t\t\t\t<ListViewContentPopover listViewRef={ listViewRef } />\n\t\t\t\t\t{ ! isSectionBlock && (\n\t\t\t\t\t\t<StyleInspectorSlots blockName={ blockName } />\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<InspectorControlsLastItem.Slot />\n\t\t\t<SkipToSelectedBlock key=\"back\" />\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md\n */\nexport default BlockInspector;\n"],
5
- "mappings": ";AAGA,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,oBAAoB,cAAc;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AAKvB,OAAO,kBAAkB;AACzB,OAAO,yBAAyB;AAChC,OAAO,eAAe;AACtB,OAAO,6BAA6B;AACpC,OAAO,8BAA8B;AACrC,OAAO,gCAAgC;AACvC,SAAS,SAAS,wBAAwB;AAC1C,OAAO,iBAAiB;AACxB,SAAS,8BAA8B;AACvC,OAAO,uBAAuB;AAC9B,SAAS,WAAW,6BAA6B;AACjD,OAAO,8BAA8B;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,uBAAqB;AAAA,QACrB,WAAY,iBAAiB;AAAA,QAC7B,SAAU;AAAA,QACV,UAAW;AAAA;AAAA,IACZ;AAAA,IACA,oBAAC,0BAAuB,UAAW,uBAAwB;AAAA,IAC3D,oBAAC,gBAAa,UAAW,uBAAwB;AAAA,IACjD,oBAAC,4BAAyB,eAAgB,uBAAwB;AAAA,IAChE,mBACD,gCACC;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,UAAW;AAAA,QACX;AAAA,QACA,MAAO;AAAA,QACP;AAAA,QACA;AAAA;AAAA,IACD,GACD;AAAA,IAEC,CAAE,mBACH,iCACG;AAAA,wBACD,oBAAC,eAAY,UAAW,uBAAwB;AAAA,MAEjD,oBAAC,cAAW,kBAAsC;AAAA,MAClD,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,WAAU;AAAA,MACxC,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,QAAO,KAAM,aAAc;AAAA,MACzD,oBAAC,0BAAuB,aAA4B;AAAA,MAClD,CAAE,kBACH,oBAAC,uBAAoB,WAAwB;AAAA,OAE/C;AAAA,IAED,oBAAC,0BAA0B,MAA1B,EAA+B;AAAA,IAChC,oBAAC,yBAAwB,MAAO;AAAA,KACjC;AAEF;AAKA,IAAO,0BAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetUnregisteredTypeHandlerName,\n\thasBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport EditContents from './edit-contents';\nimport SkipToSelectedBlock from '../skip-to-selected-block';\nimport BlockCard from '../block-card';\nimport MultiSelectionInspector from '../multi-selection-inspector';\nimport BlockVariationTransforms from '../block-variation-transforms';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\nimport BlockStyles from '../block-styles';\nimport { ListViewContentPopover } from '../inspector-controls/list-view-content-popover';\nimport InspectorControls from '../inspector-controls';\nimport { default as InspectorControlsTabs } from '../inspector-controls-tabs';\nimport useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';\nimport InspectorControlsLastItem from '../inspector-controls/last-item';\nimport AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';\nimport PositionControls from '../inspector-controls-tabs/position-controls-panel';\nimport useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';\nimport { useBorderPanelLabel } from '../../hooks/border';\nimport ContentTab from '../inspector-controls-tabs/content-tab';\nimport ViewportVisibilityInfo from '../block-visibility/viewport-visibility-info';\nimport { unlock } from '../../lock-unlock';\n\nfunction StyleInspectorSlots( {\n\tblockName,\n\tshowAdvancedControls = true,\n\tshowPositionControls = true,\n\tshowBindingsControls = true,\n} ) {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls.Slot />\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"color\"\n\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"background\"\n\t\t\t\tlabel={ __( 'Background image' ) }\n\t\t\t\tclassName=\"background-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"typography\"\n\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"border\" label={ borderPanelLabel } />\n\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t{ showPositionControls && <PositionControls /> }\n\t\t\t{ showBindingsControls && (\n\t\t\t\t<InspectorControls.Slot group=\"bindings\" />\n\t\t\t) }\n\t\t\t{ showAdvancedControls && (\n\t\t\t\t<div>\n\t\t\t\t\t<AdvancedControls />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction BlockInspector() {\n\tconst {\n\t\tselectedBlockCount,\n\t\trenderedBlockName,\n\t\trenderedBlockClientId,\n\t\tblockType,\n\t\tisSectionBlock,\n\t\tisSectionBlockInSelection,\n\t\thasBlockStyles,\n\t\teditedContentOnlySection,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetSelectedBlockCount,\n\t\t\tgetBlockName,\n\t\t\tgetParentSectionBlock,\n\t\t\tisSectionBlock: _isSectionBlock,\n\t\t\tgetEditedContentOnlySection,\n\t\t\tisWithinEditedContentOnlySection,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { getBlockStyles } = select( blocksStore );\n\t\tconst _selectedBlockClientId = getSelectedBlockClientId();\n\t\tconst isWithinEditedSection = isWithinEditedContentOnlySection(\n\t\t\t_selectedBlockClientId\n\t\t);\n\t\tconst _renderedBlockClientId = isWithinEditedSection\n\t\t\t? _selectedBlockClientId\n\t\t\t: getParentSectionBlock( _selectedBlockClientId ) ||\n\t\t\t _selectedBlockClientId;\n\t\tconst _renderedBlockName =\n\t\t\t_renderedBlockClientId && getBlockName( _renderedBlockClientId );\n\t\tconst _blockType =\n\t\t\t_renderedBlockName && getBlockType( _renderedBlockName );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst _isSectionBlockInSelection = selectedBlockClientIds.some(\n\t\t\t( id ) => _isSectionBlock( id )\n\t\t);\n\t\tconst blockStyles =\n\t\t\t_renderedBlockName && getBlockStyles( _renderedBlockName );\n\t\tconst _hasBlockStyles = blockStyles && blockStyles.length > 0;\n\n\t\treturn {\n\t\t\tselectedBlockCount: getSelectedBlockCount(),\n\t\t\trenderedBlockClientId: _renderedBlockClientId,\n\t\t\trenderedBlockName: _renderedBlockName,\n\t\t\tblockType: _blockType,\n\t\t\tisSectionBlockInSelection: _isSectionBlockInSelection,\n\t\t\tisSectionBlock: _isSectionBlock( _renderedBlockClientId ),\n\t\t\thasBlockStyles: _hasBlockStyles,\n\t\t\teditedContentOnlySection: getEditedContentOnlySection(),\n\t\t};\n\t}, [] );\n\n\t// Separate useSelect for contentClientIds with proper dependencies\n\tconst contentClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSectionBlock || ! renderedBlockClientId ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst descendants = getClientIdsOfDescendants(\n\t\t\t\trenderedBlockClientId\n\t\t\t);\n\n\t\t\t// Exclude items from the content tab that are already present in the\n\t\t\t// List View tab.\n\t\t\tconst listViewDescendants = new Set();\n\t\t\tdescendants.forEach( ( clientId ) => {\n\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t// Navigation block doesn't have List View block support, but\n\t\t\t\t// it does have a custom implementation that is shown within\n\t\t\t\t// patterns, so it's included in this condition.\n\t\t\t\tif (\n\t\t\t\t\tblockName === 'core/navigation' ||\n\t\t\t\t\thasBlockSupport( blockName, 'listView' )\n\t\t\t\t) {\n\t\t\t\t\tconst listViewChildren =\n\t\t\t\t\t\tgetClientIdsOfDescendants( clientId );\n\t\t\t\t\tlistViewChildren.forEach( ( childId ) =>\n\t\t\t\t\t\tlistViewDescendants.add( childId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn descendants.filter( ( current ) => {\n\t\t\t\treturn (\n\t\t\t\t\t! listViewDescendants.has( current ) &&\n\t\t\t\t\tgetBlockEditingMode( current ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t[ isSectionBlock, renderedBlockClientId ]\n\t);\n\n\tconst availableTabs = useInspectorControlsTabs(\n\t\tblockType?.name,\n\t\tcontentClientIds,\n\t\tisSectionBlock,\n\t\thasBlockStyles\n\t);\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\n\t// The block inspector animation settings will be completely\n\t// removed in the future to create an API which allows the block\n\t// inspector to transition between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tconst blockInspectorAnimationSettings =\n\t\tuseBlockInspectorAnimationSettings( blockType );\n\n\tconst hasSelectedBlocks = selectedBlockCount > 1;\n\n\tif ( hasSelectedBlocks && ! isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t\t{ hasMultipleTabs ? (\n\t\t\t\t\t<InspectorControlsTabs tabs={ availableTabs } />\n\t\t\t\t) : (\n\t\t\t\t\t<StyleInspectorSlots\n\t\t\t\t\t\tblockName={ renderedBlockName }\n\t\t\t\t\t\tshowAdvancedControls={ false }\n\t\t\t\t\t\tshowPositionControls={ false }\n\t\t\t\t\t\tshowBindingsControls={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( hasSelectedBlocks && isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst isRenderedBlockUnregistered =\n\t\trenderedBlockName === getUnregisteredTypeHandlerName();\n\n\t/*\n\t * If the rendered block is of an unregistered type, avoid showing it as an actual selection\n\t * because we want the user to focus on the unregistered block warning, not block settings.\n\t */\n\tconst shouldShowWarning =\n\t\t! blockType || ! renderedBlockClientId || isRenderedBlockUnregistered;\n\n\tif ( shouldShowWarning ) {\n\t\treturn (\n\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t</span>\n\t\t);\n\t}\n\n\treturn (\n\t\t<BlockInspectorSingleBlockWrapper\n\t\t\tanimate={ blockInspectorAnimationSettings }\n\t\t\twrapper={ ( children ) => (\n\t\t\t\t<AnimatedContainer\n\t\t\t\t\tblockInspectorAnimationSettings={\n\t\t\t\t\t\tblockInspectorAnimationSettings\n\t\t\t\t\t}\n\t\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</AnimatedContainer>\n\t\t\t) }\n\t\t>\n\t\t\t<BlockInspectorSingleBlock\n\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\tblockName={ blockType.name }\n\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\tavailableTabs={ availableTabs }\n\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\teditedContentOnlySection={ editedContentOnlySection }\n\t\t\t/>\n\t\t</BlockInspectorSingleBlockWrapper>\n\t);\n}\n\nconst BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {\n\treturn animate ? wrapper( children ) : children;\n};\n\nconst AnimatedContainer = ( {\n\tblockInspectorAnimationSettings,\n\trenderedBlockClientId,\n\tchildren,\n} ) => {\n\tconst animationOrigin =\n\t\tblockInspectorAnimationSettings &&\n\t\tblockInspectorAnimationSettings.enterDirection === 'leftToRight'\n\t\t\t? -50\n\t\t\t: 50;\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\tease: 'easeInOut',\n\t\t\t\t\tduration: 0.14,\n\t\t\t\t},\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tx: animationOrigin,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\tkey={ renderedBlockClientId }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n};\n\nconst BlockInspectorSingleBlock = ( {\n\t// The block that is displayed in the inspector. This is the block whose\n\t// controls and information are shown to the user.\n\trenderedBlockClientId,\n\tblockName,\n\tisSectionBlock,\n\tavailableTabs,\n\tcontentClientIds,\n\thasBlockStyles,\n\teditedContentOnlySection,\n} ) => {\n\tconst listViewRef = useRef( null );\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\tconst hasParentChildBlockCards =\n\t\teditedContentOnlySection &&\n\t\teditedContentOnlySection !== renderedBlockClientId;\n\tconst parentBlockInformation = useBlockDisplayInformation(\n\t\teditedContentOnlySection\n\t);\n\tconst blockInformation = useBlockDisplayInformation(\n\t\trenderedBlockClientId\n\t);\n\tconst isBlockSynced = blockInformation.isSynced;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t{ hasParentChildBlockCards && (\n\t\t\t\t<BlockCard\n\t\t\t\t\t{ ...parentBlockInformation }\n\t\t\t\t\tclassName={\n\t\t\t\t\t\tparentBlockInformation?.isSynced && 'is-synced'\n\t\t\t\t\t}\n\t\t\t\t\tparentClientId={ editedContentOnlySection }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<BlockCard\n\t\t\t\t{ ...blockInformation }\n\t\t\t\tallowParentNavigation\n\t\t\t\tclassName={ isBlockSynced && 'is-synced' }\n\t\t\t\tisChild={ hasParentChildBlockCards }\n\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t/>\n\t\t\t<ViewportVisibilityInfo clientId={ renderedBlockClientId } />\n\t\t\t<EditContents clientId={ renderedBlockClientId } />\n\t\t\t<BlockVariationTransforms blockClientId={ renderedBlockClientId } />\n\t\t\t{ hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t<InspectorControlsTabs\n\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\ttabs={ availableTabs }\n\t\t\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ ! hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t{ hasBlockStyles && (\n\t\t\t\t\t\t<BlockStyles clientId={ renderedBlockClientId } />\n\t\t\t\t\t) }\n\t\t\t\t\t<ContentTab contentClientIds={ contentClientIds } />\n\t\t\t\t\t<InspectorControls.Slot group=\"content\" />\n\t\t\t\t\t<InspectorControls.Slot group=\"list\" ref={ listViewRef } />\n\t\t\t\t\t<ListViewContentPopover listViewRef={ listViewRef } />\n\t\t\t\t\t{ ! isSectionBlock && (\n\t\t\t\t\t\t<StyleInspectorSlots blockName={ blockName } />\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<InspectorControlsLastItem.Slot />\n\t\t\t<SkipToSelectedBlock key=\"back\" />\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md\n */\nexport default BlockInspector;\n"],
5
+ "mappings": ";AAGA,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,oBAAoB,cAAc;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AAKvB,OAAO,kBAAkB;AACzB,OAAO,yBAAyB;AAChC,OAAO,eAAe;AACtB,OAAO,6BAA6B;AACpC,OAAO,8BAA8B;AACrC,OAAO,gCAAgC;AACvC,SAAS,SAAS,wBAAwB;AAC1C,OAAO,iBAAiB;AACxB,SAAS,8BAA8B;AACvC,OAAO,uBAAuB;AAC9B,SAAS,WAAW,6BAA6B;AACjD,OAAO,8BAA8B;AACrC,OAAO,+BAA+B;AACtC,OAAO,sBAAsB;AAC7B,OAAO,sBAAsB;AAC7B,OAAO,wCAAwC;AAC/C,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AAA;AAAA,IACZ;AAAA,IACA,oBAAC,0BAAuB,UAAW,uBAAwB;AAAA,IAC3D,oBAAC,gBAAa,UAAW,uBAAwB;AAAA,IACjD,oBAAC,4BAAyB,eAAgB,uBAAwB;AAAA,IAChE,mBACD,gCACC;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,UAAW;AAAA,QACX;AAAA,QACA,MAAO;AAAA,QACP;AAAA,QACA;AAAA;AAAA,IACD,GACD;AAAA,IAEC,CAAE,mBACH,iCACG;AAAA,wBACD,oBAAC,eAAY,UAAW,uBAAwB;AAAA,MAEjD,oBAAC,cAAW,kBAAsC;AAAA,MAClD,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,WAAU;AAAA,MACxC,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,QAAO,KAAM,aAAc;AAAA,MACzD,oBAAC,0BAAuB,aAA4B;AAAA,MAClD,CAAE,kBACH,oBAAC,uBAAoB,WAAwB;AAAA,OAE/C;AAAA,IAED,oBAAC,0BAA0B,MAA1B,EAA+B;AAAA,IAChC,oBAAC,yBAAwB,MAAO;AAAA,KACjC;AAEF;AAKA,IAAO,0BAAQ;",
6
6
  "names": []
7
7
  }
@@ -30,9 +30,9 @@ import {
30
30
  } from "./utils.mjs";
31
31
 
32
32
  // packages/block-editor/src/components/block-visibility/style.scss
33
- if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='4334c7deb6']")) {
33
+ if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='e252bf6889']")) {
34
34
  const style = document.createElement("style");
35
- style.setAttribute("data-wp-hash", "4334c7deb6");
35
+ style.setAttribute("data-wp-hash", "e252bf6889");
36
36
  style.appendChild(document.createTextNode(".block-editor-block-visibility-modal{z-index:1000001}.block-editor-block-visibility-modal__options{border:0;list-style:none;margin:24px 0;padding:0}.block-editor-block-visibility-modal__options-item{align-items:center;display:flex;gap:24px;justify-content:space-between;margin:0 0 16px}.block-editor-block-visibility-modal__options-item:last-child{margin:0}.block-editor-block-visibility-modal__options-item--everywhere{align-items:start;flex-direction:column}.block-editor-block-visibility-modal__options-checkbox--everywhere{font-weight:600}.block-editor-block-visibility-modal__options-icon--checked{fill:#ddd}.block-editor-block-visibility-modal__sub-options{padding-inline-start:12px;width:100%}.block-editor-block-visibility-modal__description{color:#757575;font-size:12px}.block-editor-block-visibility-info{align-items:center;display:flex;justify-content:start;margin:0 16px 16px;padding-bottom:4px;padding-top:4px}"));
37
37
  document.head.appendChild(style);
38
38
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/block-visibility/modal.js", "../../../src/components/block-visibility/style.scss"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseState,\n\tuseMemo,\n\tuseCallback,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\tButton,\n\tCheckboxControl,\n\tFlex,\n\tFlexItem,\n\tIcon,\n\tModal,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBLOCK_VISIBILITY_VIEWPORT_ENTRIES,\n\tBLOCK_VISIBILITY_VIEWPORTS,\n} from './constants';\nimport { store as blockEditorStore } from '../../store';\nimport { cleanEmptyObject } from '../../hooks/utils';\nimport {\n\tgetViewportCheckboxState,\n\tgetHideEverywhereCheckboxState,\n} from './utils';\nimport './style.scss';\n\nconst DEFAULT_VIEWPORT_CHECKBOX_VALUES = {\n\t[ BLOCK_VISIBILITY_VIEWPORTS.mobile.key ]: false,\n\t[ BLOCK_VISIBILITY_VIEWPORTS.tablet.key ]: false,\n\t[ BLOCK_VISIBILITY_VIEWPORTS.desktop.key ]: false,\n};\n\nconst EMPTY_BLOCKS = [];\n\n/**\n * Modal component for configuring block visibility across viewports.\n *\n * Allows users to hide blocks on specific viewport sizes (mobile, tablet, desktop)\n * or hide them everywhere. When editing multiple blocks, checkboxes only show as\n * checked if ALL selected blocks share the same setting to avoid ambiguity.\n *\n * @param {Object} props Component props.\n * @param {Array} props.clientIds The client IDs of the blocks to hide.\n * @param {Function} props.onClose Callback function invoked when the modal is closed.\n * @return {React.JSX.Element} The modal component.\n */\nexport default function BlockVisibilityModal( { clientIds, onClose } ) {\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tconst blocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds ) ??\n\t\t\tEMPTY_BLOCKS,\n\t\t[ clientIds ]\n\t);\n\tconst listViewShortcut = useSelect( ( select ) => {\n\t\treturn select( keyboardShortcutsStore ).getShortcutRepresentation(\n\t\t\t'core/editor/toggle-list-view'\n\t\t);\n\t}, [] );\n\n\tconst initialViewportValues = useMemo( () => {\n\t\tif ( blocks?.length === 0 ) {\n\t\t\treturn {\n\t\t\t\thideEverywhere: false,\n\t\t\t\tviewportChecked: {},\n\t\t\t};\n\t\t}\n\n\t\tconst viewportValues = {};\n\n\t\tBLOCK_VISIBILITY_VIEWPORT_ENTRIES.forEach( ( [ , { key } ] ) => {\n\t\t\tviewportValues[ key ] = getViewportCheckboxState( blocks, key );\n\t\t} );\n\n\t\treturn {\n\t\t\thideEverywhere: getHideEverywhereCheckboxState( blocks ),\n\t\t\tviewportChecked: viewportValues,\n\t\t};\n\t}, [ blocks ] );\n\n\tconst [ viewportChecked, setViewportChecked ] = useState(\n\t\tinitialViewportValues?.viewportChecked ?? {}\n\t);\n\tconst [ hideEverywhere, setHideEverywhere ] = useState(\n\t\tinitialViewportValues?.hideEverywhere ?? false\n\t);\n\n\tconst handleViewportCheckboxChange = useCallback(\n\t\t( viewport, isChecked ) => {\n\t\t\tsetViewportChecked( {\n\t\t\t\t...viewportChecked,\n\t\t\t\t[ viewport ]: isChecked,\n\t\t\t} );\n\t\t},\n\t\t[ viewportChecked ]\n\t);\n\n\tconst noticeMessage = useMemo( () => {\n\t\tif ( ! hideEverywhere ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %s: The shortcut key to access the List View.\n\t\t\t\t__(\n\t\t\t\t\t'Block visibility settings updated. You can access them via the List View (%s).'\n\t\t\t\t),\n\t\t\t\tlistViewShortcut\n\t\t\t);\n\t\t}\n\n\t\tconst message =\n\t\t\tblocks?.length > 1\n\t\t\t\t? // translators: %s: The shortcut key to access the List View.\n\t\t\t\t __(\n\t\t\t\t\t\t'Blocks hidden. You can access them via the List View (%s).'\n\t\t\t\t )\n\t\t\t\t: // translators: %s: The shortcut key to access the List View.\n\t\t\t\t __(\n\t\t\t\t\t\t'Block hidden. You can access it via the List View (%s).'\n\t\t\t\t );\n\n\t\treturn sprintf( message, listViewShortcut );\n\t}, [ hideEverywhere, blocks?.length, listViewShortcut ] );\n\n\tconst isAnyViewportChecked = useMemo(\n\t\t() =>\n\t\t\tObject.values( viewportChecked ).some(\n\t\t\t\t( checked ) => checked === true || checked === null\n\t\t\t),\n\t\t[ viewportChecked ]\n\t);\n\n\tconst isDirty = useMemo( () => {\n\t\tif ( hideEverywhere !== initialViewportValues.hideEverywhere ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn BLOCK_VISIBILITY_VIEWPORT_ENTRIES.some(\n\t\t\t( [ , { key } ] ) =>\n\t\t\t\tviewportChecked[ key ] !==\n\t\t\t\tinitialViewportValues.viewportChecked[ key ]\n\t\t);\n\t}, [ hideEverywhere, viewportChecked, initialViewportValues ] );\n\n\tconst hasIndeterminateValues = useMemo( () => {\n\t\tif ( hideEverywhere === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn Object.values( viewportChecked ).some(\n\t\t\t( checked ) => checked === null\n\t\t);\n\t}, [ hideEverywhere, viewportChecked ] );\n\n\tconst handleSubmit = useCallback(\n\t\t( event ) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst newVisibility = hideEverywhere\n\t\t\t\t? false\n\t\t\t\t: {\n\t\t\t\t\t\tviewport: BLOCK_VISIBILITY_VIEWPORT_ENTRIES.reduce(\n\t\t\t\t\t\t\t( acc, [ , { key } ] ) => {\n\t\t\t\t\t\t\t\tif ( viewportChecked[ key ] ) {\n\t\t\t\t\t\t\t\t\t// Values are inverted to hide the block on the selected viewport.\n\t\t\t\t\t\t\t\t\t// In the UI, the checkbox is checked (true) when the block is hidden on the selected viewport,\n\t\t\t\t\t\t\t\t\t// so 'false' means hide the block on the selected viewport.\n\t\t\t\t\t\t\t\t\tacc[ key ] = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn acc;\n\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 };\n\t\t\tconst attributesByClientId = Object.fromEntries(\n\t\t\t\tblocks.map( ( { clientId, attributes } ) => [\n\t\t\t\t\tclientId,\n\t\t\t\t\t{\n\t\t\t\t\t\tmetadata: cleanEmptyObject( {\n\t\t\t\t\t\t\t...attributes?.metadata,\n\t\t\t\t\t\t\tblockVisibility: newVisibility,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t] )\n\t\t\t);\n\t\t\tupdateBlockAttributes( clientIds, attributesByClientId, {\n\t\t\t\tuniqueByBlock: true,\n\t\t\t} );\n\n\t\t\tcreateSuccessNotice( noticeMessage, {\n\t\t\t\tid: hideEverywhere\n\t\t\t\t\t? 'block-visibility-hidden'\n\t\t\t\t\t: 'block-visibility-viewports-updated',\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\tonClose();\n\t\t},\n\t\t[\n\t\t\tblocks,\n\t\t\tclientIds,\n\t\t\tcreateSuccessNotice,\n\t\t\thideEverywhere,\n\t\t\tnoticeMessage,\n\t\t\tonClose,\n\t\t\tupdateBlockAttributes,\n\t\t\tviewportChecked,\n\t\t]\n\t);\n\n\tconst hasMultipleBlocks = blocks?.length > 1;\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tclientIds?.length > 1 ? __( 'Hide blocks' ) : __( 'Hide block' )\n\t\t\t}\n\t\t\tonRequestClose={ onClose }\n\t\t\toverlayClassName=\"block-editor-block-visibility-modal\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form onSubmit={ handleSubmit }>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend>\n\t\t\t\t\t\t{ hasMultipleBlocks\n\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t'Select the viewport sizes for which you want to hide the blocks. Changes will apply to all selected blocks.'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'Select the viewport size for which you want to hide the block.'\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</legend>\n\t\t\t\t\t<ul className=\"block-editor-block-visibility-modal__options\">\n\t\t\t\t\t\t<li className=\"block-editor-block-visibility-modal__options-item block-editor-block-visibility-modal__options-item--everywhere\">\n\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-visibility-modal__options-checkbox--everywhere\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Omit from published content' ) }\n\t\t\t\t\t\t\t\tchecked={ hideEverywhere === true }\n\t\t\t\t\t\t\t\tindeterminate={ hideEverywhere === null }\n\t\t\t\t\t\t\t\tonChange={ ( checked ) => {\n\t\t\t\t\t\t\t\t\tsetHideEverywhere( checked );\n\t\t\t\t\t\t\t\t\t// Reset viewport checkboxes when hide everywhere is checked.\n\t\t\t\t\t\t\t\t\tsetViewportChecked(\n\t\t\t\t\t\t\t\t\t\tDEFAULT_VIEWPORT_CHECKBOX_VALUES\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\t{ hideEverywhere !== true && (\n\t\t\t\t\t\t\t\t<ul className=\"block-editor-block-visibility-modal__sub-options\">\n\t\t\t\t\t\t\t\t\t{ BLOCK_VISIBILITY_VIEWPORT_ENTRIES.map(\n\t\t\t\t\t\t\t\t\t\t( [ , { label, icon, key } ] ) => (\n\t\t\t\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-visibility-modal__options-item\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: %s: The viewport name.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__( 'Hide on %s' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tviewportChecked[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t] ?? false\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tindeterminate={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tviewportChecked[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t] === null\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( checked ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thandleViewportCheckboxChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchecked\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'block-editor-block-visibility-modal__options-icon--checked':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tviewportChecked[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t{ hasMultipleBlocks && hasIndeterminateValues && (\n\t\t\t\t\t\t<p className=\"block-editor-block-visibility-modal__description\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Selected blocks have different visibility settings. The checkboxes show an indeterminate state when settings differ.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! hasMultipleBlocks && hideEverywhere === true && (\n\t\t\t\t\t\t<p className=\"block-editor-block-visibility-modal__description\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The shortcut key to access the List View.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Block will be hidden in the editor, and omitted from the published markup on the frontend. You can configure it again by selecting it in the List View (%s).'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tlistViewShortcut\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! hasMultipleBlocks &&\n\t\t\t\t\t\t! hideEverywhere &&\n\t\t\t\t\t\tisAnyViewportChecked && (\n\t\t\t\t\t\t\t<p className=\"block-editor-block-visibility-modal__description\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The shortcut key to access the List View\n\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t'Block will be hidden according to the selected viewports. It will be <strong>included in the published markup on the frontend</strong>. You can configure it again by selecting it in the List View (%s).'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tlistViewShortcut\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstrong: <strong />,\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</p>\n\t\t\t\t\t\t) }\n\t\t\t\t</fieldset>\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"block-editor-block-visibility-modal__actions\"\n\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\texpanded={ false }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='4334c7deb6']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"4334c7deb6\");\n\tstyle.appendChild(document.createTextNode(\".block-editor-block-visibility-modal{z-index:1000001}.block-editor-block-visibility-modal__options{border:0;list-style:none;margin:24px 0;padding:0}.block-editor-block-visibility-modal__options-item{align-items:center;display:flex;gap:24px;justify-content:space-between;margin:0 0 16px}.block-editor-block-visibility-modal__options-item:last-child{margin:0}.block-editor-block-visibility-modal__options-item--everywhere{align-items:start;flex-direction:column}.block-editor-block-visibility-modal__options-checkbox--everywhere{font-weight:600}.block-editor-block-visibility-modal__options-icon--checked{fill:#ddd}.block-editor-block-visibility-modal__sub-options{padding-inline-start:12px;width:100%}.block-editor-block-visibility-modal__description{color:#757575;font-size:12px}.block-editor-block-visibility-info{align-items:center;display:flex;justify-content:start;margin:0 16px 16px;padding-bottom:4px;padding-top:4px}\"));\n\tdocument.head.appendChild(style);\n}\n"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseState,\n\tuseMemo,\n\tuseCallback,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport {\n\tButton,\n\tCheckboxControl,\n\tFlex,\n\tFlexItem,\n\tIcon,\n\tModal,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBLOCK_VISIBILITY_VIEWPORT_ENTRIES,\n\tBLOCK_VISIBILITY_VIEWPORTS,\n} from './constants';\nimport { store as blockEditorStore } from '../../store';\nimport { cleanEmptyObject } from '../../hooks/utils';\nimport {\n\tgetViewportCheckboxState,\n\tgetHideEverywhereCheckboxState,\n} from './utils';\nimport './style.scss';\n\nconst DEFAULT_VIEWPORT_CHECKBOX_VALUES = {\n\t[ BLOCK_VISIBILITY_VIEWPORTS.mobile.key ]: false,\n\t[ BLOCK_VISIBILITY_VIEWPORTS.tablet.key ]: false,\n\t[ BLOCK_VISIBILITY_VIEWPORTS.desktop.key ]: false,\n};\n\nconst EMPTY_BLOCKS = [];\n\n/**\n * Modal component for configuring block visibility across viewports.\n *\n * Allows users to hide blocks on specific viewport sizes (mobile, tablet, desktop)\n * or hide them everywhere. When editing multiple blocks, checkboxes only show as\n * checked if ALL selected blocks share the same setting to avoid ambiguity.\n *\n * @param {Object} props Component props.\n * @param {Array} props.clientIds The client IDs of the blocks to hide.\n * @param {Function} props.onClose Callback function invoked when the modal is closed.\n * @return {React.JSX.Element} The modal component.\n */\nexport default function BlockVisibilityModal( { clientIds, onClose } ) {\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tconst blocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds ) ??\n\t\t\tEMPTY_BLOCKS,\n\t\t[ clientIds ]\n\t);\n\tconst listViewShortcut = useSelect( ( select ) => {\n\t\treturn select( keyboardShortcutsStore ).getShortcutRepresentation(\n\t\t\t'core/editor/toggle-list-view'\n\t\t);\n\t}, [] );\n\n\tconst initialViewportValues = useMemo( () => {\n\t\tif ( blocks?.length === 0 ) {\n\t\t\treturn {\n\t\t\t\thideEverywhere: false,\n\t\t\t\tviewportChecked: {},\n\t\t\t};\n\t\t}\n\n\t\tconst viewportValues = {};\n\n\t\tBLOCK_VISIBILITY_VIEWPORT_ENTRIES.forEach( ( [ , { key } ] ) => {\n\t\t\tviewportValues[ key ] = getViewportCheckboxState( blocks, key );\n\t\t} );\n\n\t\treturn {\n\t\t\thideEverywhere: getHideEverywhereCheckboxState( blocks ),\n\t\t\tviewportChecked: viewportValues,\n\t\t};\n\t}, [ blocks ] );\n\n\tconst [ viewportChecked, setViewportChecked ] = useState(\n\t\tinitialViewportValues?.viewportChecked ?? {}\n\t);\n\tconst [ hideEverywhere, setHideEverywhere ] = useState(\n\t\tinitialViewportValues?.hideEverywhere ?? false\n\t);\n\n\tconst handleViewportCheckboxChange = useCallback(\n\t\t( viewport, isChecked ) => {\n\t\t\tsetViewportChecked( {\n\t\t\t\t...viewportChecked,\n\t\t\t\t[ viewport ]: isChecked,\n\t\t\t} );\n\t\t},\n\t\t[ viewportChecked ]\n\t);\n\n\tconst noticeMessage = useMemo( () => {\n\t\tif ( ! hideEverywhere ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %s: The shortcut key to access the List View.\n\t\t\t\t__(\n\t\t\t\t\t'Block visibility settings updated. You can access them via the List View (%s).'\n\t\t\t\t),\n\t\t\t\tlistViewShortcut\n\t\t\t);\n\t\t}\n\n\t\tconst message =\n\t\t\tblocks?.length > 1\n\t\t\t\t? // translators: %s: The shortcut key to access the List View.\n\t\t\t\t __(\n\t\t\t\t\t\t'Blocks hidden. You can access them via the List View (%s).'\n\t\t\t\t )\n\t\t\t\t: // translators: %s: The shortcut key to access the List View.\n\t\t\t\t __(\n\t\t\t\t\t\t'Block hidden. You can access it via the List View (%s).'\n\t\t\t\t );\n\n\t\treturn sprintf( message, listViewShortcut );\n\t}, [ hideEverywhere, blocks?.length, listViewShortcut ] );\n\n\tconst isAnyViewportChecked = useMemo(\n\t\t() =>\n\t\t\tObject.values( viewportChecked ).some(\n\t\t\t\t( checked ) => checked === true || checked === null\n\t\t\t),\n\t\t[ viewportChecked ]\n\t);\n\n\tconst isDirty = useMemo( () => {\n\t\tif ( hideEverywhere !== initialViewportValues.hideEverywhere ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn BLOCK_VISIBILITY_VIEWPORT_ENTRIES.some(\n\t\t\t( [ , { key } ] ) =>\n\t\t\t\tviewportChecked[ key ] !==\n\t\t\t\tinitialViewportValues.viewportChecked[ key ]\n\t\t);\n\t}, [ hideEverywhere, viewportChecked, initialViewportValues ] );\n\n\tconst hasIndeterminateValues = useMemo( () => {\n\t\tif ( hideEverywhere === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn Object.values( viewportChecked ).some(\n\t\t\t( checked ) => checked === null\n\t\t);\n\t}, [ hideEverywhere, viewportChecked ] );\n\n\tconst handleSubmit = useCallback(\n\t\t( event ) => {\n\t\t\tevent.preventDefault();\n\t\t\tconst newVisibility = hideEverywhere\n\t\t\t\t? false\n\t\t\t\t: {\n\t\t\t\t\t\tviewport: BLOCK_VISIBILITY_VIEWPORT_ENTRIES.reduce(\n\t\t\t\t\t\t\t( acc, [ , { key } ] ) => {\n\t\t\t\t\t\t\t\tif ( viewportChecked[ key ] ) {\n\t\t\t\t\t\t\t\t\t// Values are inverted to hide the block on the selected viewport.\n\t\t\t\t\t\t\t\t\t// In the UI, the checkbox is checked (true) when the block is hidden on the selected viewport,\n\t\t\t\t\t\t\t\t\t// so 'false' means hide the block on the selected viewport.\n\t\t\t\t\t\t\t\t\tacc[ key ] = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn acc;\n\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 };\n\t\t\tconst attributesByClientId = Object.fromEntries(\n\t\t\t\tblocks.map( ( { clientId, attributes } ) => [\n\t\t\t\t\tclientId,\n\t\t\t\t\t{\n\t\t\t\t\t\tmetadata: cleanEmptyObject( {\n\t\t\t\t\t\t\t...attributes?.metadata,\n\t\t\t\t\t\t\tblockVisibility: newVisibility,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t] )\n\t\t\t);\n\t\t\tupdateBlockAttributes( clientIds, attributesByClientId, {\n\t\t\t\tuniqueByBlock: true,\n\t\t\t} );\n\n\t\t\tcreateSuccessNotice( noticeMessage, {\n\t\t\t\tid: hideEverywhere\n\t\t\t\t\t? 'block-visibility-hidden'\n\t\t\t\t\t: 'block-visibility-viewports-updated',\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\tonClose();\n\t\t},\n\t\t[\n\t\t\tblocks,\n\t\t\tclientIds,\n\t\t\tcreateSuccessNotice,\n\t\t\thideEverywhere,\n\t\t\tnoticeMessage,\n\t\t\tonClose,\n\t\t\tupdateBlockAttributes,\n\t\t\tviewportChecked,\n\t\t]\n\t);\n\n\tconst hasMultipleBlocks = blocks?.length > 1;\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={\n\t\t\t\tclientIds?.length > 1 ? __( 'Hide blocks' ) : __( 'Hide block' )\n\t\t\t}\n\t\t\tonRequestClose={ onClose }\n\t\t\toverlayClassName=\"block-editor-block-visibility-modal\"\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form onSubmit={ handleSubmit }>\n\t\t\t\t<fieldset>\n\t\t\t\t\t<legend>\n\t\t\t\t\t\t{ hasMultipleBlocks\n\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t'Select the viewport sizes for which you want to hide the blocks. Changes will apply to all selected blocks.'\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t'Select the viewport size for which you want to hide the block.'\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</legend>\n\t\t\t\t\t<ul className=\"block-editor-block-visibility-modal__options\">\n\t\t\t\t\t\t<li className=\"block-editor-block-visibility-modal__options-item block-editor-block-visibility-modal__options-item--everywhere\">\n\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-visibility-modal__options-checkbox--everywhere\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Omit from published content' ) }\n\t\t\t\t\t\t\t\tchecked={ hideEverywhere === true }\n\t\t\t\t\t\t\t\tindeterminate={ hideEverywhere === null }\n\t\t\t\t\t\t\t\tonChange={ ( checked ) => {\n\t\t\t\t\t\t\t\t\tsetHideEverywhere( checked );\n\t\t\t\t\t\t\t\t\t// Reset viewport checkboxes when hide everywhere is checked.\n\t\t\t\t\t\t\t\t\tsetViewportChecked(\n\t\t\t\t\t\t\t\t\t\tDEFAULT_VIEWPORT_CHECKBOX_VALUES\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\t{ hideEverywhere !== true && (\n\t\t\t\t\t\t\t\t<ul className=\"block-editor-block-visibility-modal__sub-options\">\n\t\t\t\t\t\t\t\t\t{ BLOCK_VISIBILITY_VIEWPORT_ENTRIES.map(\n\t\t\t\t\t\t\t\t\t\t( [ , { label, icon, key } ] ) => (\n\t\t\t\t\t\t\t\t\t\t\t<li\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-visibility-modal__options-item\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: %s: The viewport name.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t__( 'Hide on %s' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tviewportChecked[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t] ?? false\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tindeterminate={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tviewportChecked[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t] === null\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( checked ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thandleViewportCheckboxChange(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchecked\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={ clsx( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'block-editor-block-visibility-modal__options-icon--checked':\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tviewportChecked[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t{ hasMultipleBlocks && hasIndeterminateValues && (\n\t\t\t\t\t\t<p className=\"block-editor-block-visibility-modal__description\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Selected blocks have different visibility settings. The checkboxes show an indeterminate state when settings differ.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! hasMultipleBlocks && hideEverywhere === true && (\n\t\t\t\t\t\t<p className=\"block-editor-block-visibility-modal__description\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The shortcut key to access the List View.\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Block will be hidden in the editor, and omitted from the published markup on the frontend. You can configure it again by selecting it in the List View (%s).'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tlistViewShortcut\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! hasMultipleBlocks &&\n\t\t\t\t\t\t! hideEverywhere &&\n\t\t\t\t\t\tisAnyViewportChecked && (\n\t\t\t\t\t\t\t<p className=\"block-editor-block-visibility-modal__description\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The shortcut key to access the List View\n\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t'Block will be hidden according to the selected viewports. It will be <strong>included in the published markup on the frontend</strong>. You can configure it again by selecting it in the List View (%s).'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\tlistViewShortcut\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tstrong: <strong />,\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</p>\n\t\t\t\t\t\t) }\n\t\t\t\t</fieldset>\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"block-editor-block-visibility-modal__actions\"\n\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\texpanded={ false }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tdisabled={ ! isDirty }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='e252bf6889']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"e252bf6889\");\n\tstyle.appendChild(document.createTextNode(\".block-editor-block-visibility-modal{z-index:1000001}.block-editor-block-visibility-modal__options{border:0;list-style:none;margin:24px 0;padding:0}.block-editor-block-visibility-modal__options-item{align-items:center;display:flex;gap:24px;justify-content:space-between;margin:0 0 16px}.block-editor-block-visibility-modal__options-item:last-child{margin:0}.block-editor-block-visibility-modal__options-item--everywhere{align-items:start;flex-direction:column}.block-editor-block-visibility-modal__options-checkbox--everywhere{font-weight:600}.block-editor-block-visibility-modal__options-icon--checked{fill:#ddd}.block-editor-block-visibility-modal__sub-options{padding-inline-start:12px;width:100%}.block-editor-block-visibility-modal__description{color:#757575;font-size:12px}.block-editor-block-visibility-info{align-items:center;display:flex;justify-content:start;margin:0 16px 16px;padding-bottom:4px;padding-top:4px}\"));\n\tdocument.head.appendChild(style);\n}\n"],
5
5
  "mappings": ";AAGA,OAAO,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BACA;AAAA,wBACA,WAAY,KAAM;AAAA,0BACjB,8DACC,gBACC,GACD;AAAA,wBACF,CAAE;AAAA;AAAA,oBACH;AAAA;AAAA;AAAA,gBAlCM;AAAA,cAmCP;AAAA,YAEF,GACD;AAAA,aAEF,GACD;AAAA,UACE,qBAAqB,0BACtB,oBAAC,OAAE,WAAU,oDACV;AAAA,YACD;AAAA,UACD,GACD;AAAA,UAEC,CAAE,qBAAqB,mBAAmB,QAC3C,oBAAC,OAAE,WAAU,oDACV;AAAA;AAAA,YAED;AAAA,cACC;AAAA,YACD;AAAA,YACA;AAAA,UACD,GACD;AAAA,UAEC,CAAE,qBACH,CAAE,kBACF,wBACC,oBAAC,OAAE,WAAU,oDACV;AAAA,YACD;AAAA;AAAA,cAEC;AAAA,gBACC;AAAA,cACD;AAAA,cACA;AAAA,YACD;AAAA,YACA;AAAA,cACC,QAAQ,oBAAC,YAAO;AAAA,YACjB;AAAA,UACD,GACD;AAAA,WAEH;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,SAAQ;AAAA,YACR,UAAW;AAAA,YAEX;AAAA,kCAAC,YACA;AAAA,gBAAC;AAAA;AAAA,kBACA,SAAQ;AAAA,kBACR,SAAU;AAAA,kBACV,uBAAqB;AAAA,kBAEnB,aAAI,QAAS;AAAA;AAAA,cAChB,GACD;AAAA,cACA,oBAAC,YACA;AAAA,gBAAC;AAAA;AAAA,kBACA,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,UAAW,CAAE;AAAA,kBACb,wBAAsB;AAAA,kBACtB,uBAAqB;AAAA,kBAEnB,aAAI,OAAQ;AAAA;AAAA,cACf,GACD;AAAA;AAAA;AAAA,QACD;AAAA,SACD;AAAA;AAAA,EACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -11,6 +11,7 @@ import { unseen } from "@wordpress/icons";
11
11
  import { unlock } from "../../lock-unlock.mjs";
12
12
  import { store as blockEditorStore } from "../../store/index.mjs";
13
13
  import useBlockVisibility from "./use-block-visibility.mjs";
14
+ import { useBlockElement } from "../block-list/use-block-props/use-block-refs.mjs";
14
15
  import { deviceTypeKey } from "../../store/private-keys.mjs";
15
16
  import { BLOCK_VISIBILITY_VIEWPORTS } from "./constants.mjs";
16
17
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -43,9 +44,13 @@ function ViewportVisibilityInfo({ clientId }) {
43
44
  },
44
45
  [clientId]
45
46
  );
47
+ const blockElement = useBlockElement(clientId);
48
+ const rawCanvasView = blockElement?.ownerDocument?.defaultView;
49
+ const canvasView = rawCanvasView === null ? void 0 : rawCanvasView;
46
50
  const { isBlockCurrentlyHidden, currentViewport } = useBlockVisibility({
47
51
  blockVisibility: currentBlockVisibility,
48
- deviceType: selectedDeviceType
52
+ deviceType: selectedDeviceType,
53
+ view: canvasView
49
54
  });
50
55
  const isBlockParentHiddenAtViewport = useSelect(
51
56
  (select) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/block-visibility/viewport-visibility-info.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { unseen } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockVisibility from './use-block-visibility';\nimport { deviceTypeKey } from '../../store/private-keys';\nimport { BLOCK_VISIBILITY_VIEWPORTS } from './constants';\n\nconst { Badge } = unlock( componentsPrivateApis );\nconst DEFAULT_VISIBILITY_STATE = {\n\tcurrentBlockVisibility: undefined,\n\thasParentHiddenEverywhere: false,\n\tselectedDeviceType: BLOCK_VISIBILITY_VIEWPORTS.desktop.value,\n};\n\nexport default function ViewportVisibilityInfo( { clientId } ) {\n\tconst {\n\t\tcurrentBlockVisibility,\n\t\tselectedDeviceType,\n\t\thasParentHiddenEverywhere,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn DEFAULT_VISIBILITY_STATE;\n\t\t\t}\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tisBlockParentHiddenEverywhere,\n\t\t\t\tgetSettings,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\treturn {\n\t\t\t\tcurrentBlockVisibility:\n\t\t\t\t\tgetBlockAttributes( clientId )?.metadata?.blockVisibility,\n\t\t\t\tselectedDeviceType:\n\t\t\t\t\tgetSettings()?.[ deviceTypeKey ]?.toLowerCase() ||\n\t\t\t\t\tBLOCK_VISIBILITY_VIEWPORTS.desktop.value,\n\t\t\t\thasParentHiddenEverywhere:\n\t\t\t\t\tisBlockParentHiddenEverywhere( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Use hook to get current viewport and if block is currently hidden (accurate viewport detection)\n\tconst { isBlockCurrentlyHidden, currentViewport } = useBlockVisibility( {\n\t\tblockVisibility: currentBlockVisibility,\n\t\tdeviceType: selectedDeviceType,\n\t} );\n\n\t/*\n\t * Selector to check if any parent (immediate or further up the chain) is hidden at current viewport.\n\t * Separated because it depends on currentViewport from the hook above.\n\t */\n\tconst isBlockParentHiddenAtViewport = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId || ! currentViewport ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t).isBlockParentHiddenAtViewport( clientId, currentViewport );\n\t\t},\n\t\t[ clientId, currentViewport ]\n\t);\n\n\tif (\n\t\t! (\n\t\t\tisBlockCurrentlyHidden ||\n\t\t\thasParentHiddenEverywhere ||\n\t\t\tisBlockParentHiddenAtViewport\n\t\t)\n\t) {\n\t\treturn null;\n\t}\n\n\t// Determine label based on whether block or parent is hidden\n\tlet label;\n\tif ( isBlockCurrentlyHidden ) {\n\t\t// Block is currently hidden - check if hidden everywhere or at specific viewport\n\t\tif ( currentBlockVisibility === false ) {\n\t\t\tlabel = __( 'Block is hidden' );\n\t\t} else {\n\t\t\tconst viewportLabel =\n\t\t\t\tBLOCK_VISIBILITY_VIEWPORTS[ currentViewport ]?.label ||\n\t\t\t\tcurrentViewport;\n\t\t\tlabel = sprintf(\n\t\t\t\t/* translators: %s: viewport name (Desktop, Tablet, Mobile) */\n\t\t\t\t__( 'Block is hidden on %s' ),\n\t\t\t\tviewportLabel\n\t\t\t);\n\t\t}\n\t}\n\n\t// Parent is hidden - check if hidden everywhere or at specific viewport\n\tif ( hasParentHiddenEverywhere ) {\n\t\tlabel = __( 'Parent block is hidden' );\n\t} else if ( isBlockParentHiddenAtViewport ) {\n\t\tconst viewportLabel =\n\t\t\tBLOCK_VISIBILITY_VIEWPORTS[ currentViewport ]?.label ||\n\t\t\tcurrentViewport;\n\t\tlabel = sprintf(\n\t\t\t/* translators: %s: viewport name (Desktop, Tablet, Mobile) */\n\t\t\t__( 'Parent block is hidden on %s' ),\n\t\t\tviewportLabel\n\t\t);\n\t}\n\n\treturn (\n\t\t<Badge className=\"block-editor-block-visibility-info\">\n\t\t\t<HStack spacing={ 2 } justify=\"start\">\n\t\t\t\t<Icon icon={ unseen } />\n\t\t\t\t<Text>{ label }</Text>\n\t\t\t</HStack>\n\t\t</Badge>\n\t);\n}\n"],
5
- "mappings": ";AAGA;AAAA,EACC;AAAA,EACA,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,eAAe;AAAA,OACT;AACP,SAAS,iBAAiB;AAC1B,SAAS,IAAI,eAAe;AAC5B,SAAS,cAAc;AAKvB,SAAS,cAAc;AACvB,SAAS,SAAS,wBAAwB;AAC1C,OAAO,wBAAwB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AAwGxC,SACC,KADD;AAtGH,IAAM,EAAE,MAAM,IAAI,OAAQ,qBAA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AAGA,MAAK,2BAA4B;AAChC,YAAQ,GAAI,wBAAyB;AAAA,EACtC,WAAY,+BAAgC;AAC3C,UAAM,gBACL,2BAA4B,eAAgB,GAAG,SAC/C;AACD,YAAQ;AAAA;AAAA,MAEP,GAAI,8BAA+B;AAAA,MACnC;AAAA,IACD;AAAA,EACD;AAEA,SACC,oBAAC,SAAM,WAAU,sCAChB,+BAAC,UAAO,SAAU,GAAI,SAAQ,SAC7B;AAAA,wBAAC,QAAK,MAAO,QAAS;AAAA,IACtB,oBAAC,QAAO,iBAAO;AAAA,KAChB,GACD;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { unseen } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockVisibility from './use-block-visibility';\nimport { useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport { deviceTypeKey } from '../../store/private-keys';\nimport { BLOCK_VISIBILITY_VIEWPORTS } from './constants';\n\nconst { Badge } = unlock( componentsPrivateApis );\nconst DEFAULT_VISIBILITY_STATE = {\n\tcurrentBlockVisibility: undefined,\n\thasParentHiddenEverywhere: false,\n\tselectedDeviceType: BLOCK_VISIBILITY_VIEWPORTS.desktop.value,\n};\n\nexport default function ViewportVisibilityInfo( { clientId } ) {\n\tconst {\n\t\tcurrentBlockVisibility,\n\t\tselectedDeviceType,\n\t\thasParentHiddenEverywhere,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn DEFAULT_VISIBILITY_STATE;\n\t\t\t}\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tisBlockParentHiddenEverywhere,\n\t\t\t\tgetSettings,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\treturn {\n\t\t\t\tcurrentBlockVisibility:\n\t\t\t\t\tgetBlockAttributes( clientId )?.metadata?.blockVisibility,\n\t\t\t\tselectedDeviceType:\n\t\t\t\t\tgetSettings()?.[ deviceTypeKey ]?.toLowerCase() ||\n\t\t\t\t\tBLOCK_VISIBILITY_VIEWPORTS.desktop.value,\n\t\t\t\thasParentHiddenEverywhere:\n\t\t\t\t\tisBlockParentHiddenEverywhere( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Get the block's DOM element to derive the canvas iframe window,\n\t// so viewport detection matches the actual block rendering context.\n\tconst blockElement = useBlockElement( clientId );\n\tconst rawCanvasView = blockElement?.ownerDocument?.defaultView;\n\tconst canvasView = rawCanvasView === null ? undefined : rawCanvasView;\n\n\tconst { isBlockCurrentlyHidden, currentViewport } = useBlockVisibility( {\n\t\tblockVisibility: currentBlockVisibility,\n\t\tdeviceType: selectedDeviceType,\n\t\tview: canvasView,\n\t} );\n\n\t/*\n\t * Selector to check if any parent (immediate or further up the chain) is hidden at current viewport.\n\t * Separated because it depends on currentViewport from the hook above.\n\t */\n\tconst isBlockParentHiddenAtViewport = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! clientId || ! currentViewport ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t).isBlockParentHiddenAtViewport( clientId, currentViewport );\n\t\t},\n\t\t[ clientId, currentViewport ]\n\t);\n\n\tif (\n\t\t! (\n\t\t\tisBlockCurrentlyHidden ||\n\t\t\thasParentHiddenEverywhere ||\n\t\t\tisBlockParentHiddenAtViewport\n\t\t)\n\t) {\n\t\treturn null;\n\t}\n\n\t// Determine label based on whether block or parent is hidden\n\tlet label;\n\tif ( isBlockCurrentlyHidden ) {\n\t\t// Block is currently hidden - check if hidden everywhere or at specific viewport\n\t\tif ( currentBlockVisibility === false ) {\n\t\t\tlabel = __( 'Block is hidden' );\n\t\t} else {\n\t\t\tconst viewportLabel =\n\t\t\t\tBLOCK_VISIBILITY_VIEWPORTS[ currentViewport ]?.label ||\n\t\t\t\tcurrentViewport;\n\t\t\tlabel = sprintf(\n\t\t\t\t/* translators: %s: viewport name (Desktop, Tablet, Mobile) */\n\t\t\t\t__( 'Block is hidden on %s' ),\n\t\t\t\tviewportLabel\n\t\t\t);\n\t\t}\n\t}\n\n\t// Parent is hidden - check if hidden everywhere or at specific viewport\n\tif ( hasParentHiddenEverywhere ) {\n\t\tlabel = __( 'Parent block is hidden' );\n\t} else if ( isBlockParentHiddenAtViewport ) {\n\t\tconst viewportLabel =\n\t\t\tBLOCK_VISIBILITY_VIEWPORTS[ currentViewport ]?.label ||\n\t\t\tcurrentViewport;\n\t\tlabel = sprintf(\n\t\t\t/* translators: %s: viewport name (Desktop, Tablet, Mobile) */\n\t\t\t__( 'Parent block is hidden on %s' ),\n\t\t\tviewportLabel\n\t\t);\n\t}\n\n\treturn (\n\t\t<Badge className=\"block-editor-block-visibility-info\">\n\t\t\t<HStack spacing={ 2 } justify=\"start\">\n\t\t\t\t<Icon icon={ unseen } />\n\t\t\t\t<Text>{ label }</Text>\n\t\t\t</HStack>\n\t\t</Badge>\n\t);\n}\n"],
5
+ "mappings": ";AAGA;AAAA,EACC;AAAA,EACA,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,eAAe;AAAA,OACT;AACP,SAAS,iBAAiB;AAC1B,SAAS,IAAI,eAAe;AAC5B,SAAS,cAAc;AAKvB,SAAS,cAAc;AACvB,SAAS,SAAS,wBAAwB;AAC1C,OAAO,wBAAwB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,qBAAqB;AAC9B,SAAS,kCAAkC;AA8GxC,SACC,KADD;AA5GH,IAAM,EAAE,MAAM,IAAI,OAAQ,qBAAsB;AAChD,IAAM,2BAA2B;AAAA,EAChC,wBAAwB;AAAA,EACxB,2BAA2B;AAAA,EAC3B,oBA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,QAC5B;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAGA,MAAK,2BAA4B;AAChC,YAAQ,GAAI,wBAAyB;AAAA,EACtC,WAAY,+BAAgC;AAC3C,UAAM,gBACL,2BAA4B,eAAgB,GAAG,SAC/C;AACD,YAAQ;AAAA;AAAA,MAEP,GAAI,8BAA+B;AAAA,MACnC;AAAA,IACD;AAAA,EACD;AAEA,SACC,oBAAC,SAAM,WAAU,sCAChB,+BAAC,UAAO,SAAU,GAAI,SAAQ,SAC7B;AAAA,wBAAC,QAAK,MAAO,QAAS;AAAA,IACtB,oBAAC,QAAO,iBAAO;AAAA,KAChB,GACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -5,15 +5,23 @@ import {
5
5
  } from "@wordpress/components";
6
6
  import { useCallback, Platform } from "@wordpress/element";
7
7
  import { __ } from "@wordpress/i18n";
8
+ import { getValueFromVariable } from "@wordpress/global-styles-engine";
8
9
  import BackgroundImageControl from "../background-image-control/index.mjs";
10
+ import { ColorPanelDropdown } from "./color-panel.mjs";
11
+ import { useGradientsPerOrigin } from "./hooks.mjs";
9
12
  import { useToolsPanelDropdownMenuProps } from "./utils.mjs";
10
13
  import { setImmutably } from "../../utils/object.mjs";
11
- import { jsx } from "react/jsx-runtime";
14
+ import { jsx, jsxs } from "react/jsx-runtime";
12
15
  var DEFAULT_CONTROLS = {
13
- backgroundImage: true
16
+ backgroundImage: true,
17
+ gradient: true
14
18
  };
19
+ function useHasBackgroundControl(settings, feature) {
20
+ return Platform.OS === "web" && settings?.background?.[feature];
21
+ }
15
22
  function useHasBackgroundPanel(settings) {
16
- return Platform.OS === "web" && settings?.background?.backgroundImage;
23
+ const { backgroundImage, gradient } = settings?.background || {};
24
+ return Platform.OS === "web" && (backgroundImage || gradient);
17
25
  }
18
26
  function hasBackgroundSizeValue(style) {
19
27
  return style?.background?.backgroundPosition !== void 0 || style?.background?.backgroundSize !== void 0;
@@ -22,6 +30,9 @@ function hasBackgroundImageValue(style) {
22
30
  return !!style?.background?.backgroundImage?.id || // Supports url() string values in theme.json.
23
31
  "string" === typeof style?.background?.backgroundImage || !!style?.background?.backgroundImage?.url;
24
32
  }
33
+ function hasBackgroundGradientValue(style) {
34
+ return "string" === typeof style?.background?.gradient && style?.background?.gradient !== "";
35
+ }
25
36
  function BackgroundToolsPanel({
26
37
  resetAllFilter,
27
38
  onChange,
@@ -41,8 +52,12 @@ function BackgroundToolsPanel({
41
52
  label: headerLabel,
42
53
  resetAll,
43
54
  panelId,
55
+ hasInnerWrapper: true,
56
+ className: "background-block-support-panel",
57
+ __experimentalFirstVisibleItemClass: "first",
58
+ __experimentalLastVisibleItemClass: "last",
44
59
  dropdownMenuProps,
45
- children
60
+ children: /* @__PURE__ */ jsx("div", { className: "background-block-support-panel__inner-wrapper", children })
46
61
  }
47
62
  );
48
63
  }
@@ -57,15 +72,76 @@ function BackgroundImagePanel({
57
72
  defaultValues = {},
58
73
  headerLabel = __("Background")
59
74
  }) {
60
- const showBackgroundImageControl = useHasBackgroundPanel(settings);
61
- const resetBackground = () => onChange(setImmutably(value, ["background"], {}));
62
- const resetAllFilter = useCallback((previousValue) => {
63
- return {
64
- ...previousValue,
65
- background: {}
66
- };
67
- }, []);
68
- return /* @__PURE__ */ jsx(
75
+ const gradients = useGradientsPerOrigin(settings);
76
+ const areCustomGradientsEnabled = settings?.color?.customGradient;
77
+ const hasGradientColors = gradients.length > 0 || areCustomGradientsEnabled;
78
+ const hasBackgroundGradientControl = useHasBackgroundControl(
79
+ settings,
80
+ "gradient"
81
+ );
82
+ const showBackgroundGradientControl = hasGradientColors && hasBackgroundGradientControl;
83
+ const showBackgroundImageControl = useHasBackgroundControl(
84
+ settings,
85
+ "backgroundImage"
86
+ );
87
+ const resetAllFilter = useCallback(
88
+ (previousValue) => {
89
+ return {
90
+ ...previousValue,
91
+ background: {},
92
+ color: hasBackgroundGradientControl ? {
93
+ ...previousValue?.color,
94
+ gradient: void 0
95
+ } : previousValue?.color
96
+ };
97
+ },
98
+ [hasBackgroundGradientControl]
99
+ );
100
+ if (!showBackgroundGradientControl && !showBackgroundImageControl) {
101
+ return null;
102
+ }
103
+ const decodeValue = (rawValue) => getValueFromVariable({ settings }, "", rawValue);
104
+ const encodeGradientValue = (gradientValue) => {
105
+ const allGradients = gradients.flatMap(
106
+ ({ gradients: originGradients }) => originGradients
107
+ );
108
+ const gradientObject = allGradients.find(
109
+ ({ gradient }) => gradient === gradientValue
110
+ );
111
+ return gradientObject ? "var:preset|gradient|" + gradientObject.slug : gradientValue;
112
+ };
113
+ const resetBackground = () => onChange(
114
+ setImmutably(
115
+ value,
116
+ ["background", "backgroundImage"],
117
+ void 0
118
+ )
119
+ );
120
+ const resetGradient = () => {
121
+ let newValue = setImmutably(
122
+ value,
123
+ ["background", "gradient"],
124
+ void 0
125
+ );
126
+ newValue = setImmutably(newValue, ["color", "gradient"], void 0);
127
+ onChange(newValue);
128
+ };
129
+ const currentGradient = decodeValue(
130
+ value?.background?.gradient ?? value?.color?.gradient
131
+ );
132
+ const inheritedGradient = decodeValue(
133
+ inheritedValue?.background?.gradient ?? inheritedValue?.color?.gradient
134
+ );
135
+ const setGradient = (newGradient) => {
136
+ let newValue = setImmutably(
137
+ value,
138
+ ["background", "gradient"],
139
+ encodeGradientValue(newGradient)
140
+ );
141
+ newValue = setImmutably(newValue, ["color", "gradient"], void 0);
142
+ onChange(newValue);
143
+ };
144
+ return /* @__PURE__ */ jsxs(
69
145
  Wrapper,
70
146
  {
71
147
  resetAllFilter,
@@ -73,34 +149,65 @@ function BackgroundImagePanel({
73
149
  onChange,
74
150
  panelId,
75
151
  headerLabel,
76
- children: showBackgroundImageControl && /* @__PURE__ */ jsx(
77
- ToolsPanelItem,
78
- {
79
- hasValue: () => !!value?.background,
80
- label: __("Image"),
81
- onDeselect: resetBackground,
82
- isShownByDefault: defaultControls.backgroundImage,
83
- panelId,
84
- children: /* @__PURE__ */ jsx(
85
- BackgroundImageControl,
86
- {
87
- value,
88
- onChange,
89
- settings,
90
- inheritedValue,
91
- defaultControls,
92
- defaultValues
93
- }
94
- )
95
- }
96
- )
152
+ children: [
153
+ showBackgroundImageControl && /* @__PURE__ */ jsx(
154
+ ToolsPanelItem,
155
+ {
156
+ className: "block-editor-background-panel__item",
157
+ hasValue: () => hasBackgroundImageValue(value),
158
+ label: __("Image"),
159
+ onDeselect: resetBackground,
160
+ isShownByDefault: defaultControls.backgroundImage,
161
+ panelId,
162
+ children: /* @__PURE__ */ jsx(
163
+ BackgroundImageControl,
164
+ {
165
+ value,
166
+ onChange,
167
+ settings,
168
+ inheritedValue,
169
+ defaultControls,
170
+ defaultValues
171
+ }
172
+ )
173
+ }
174
+ ),
175
+ showBackgroundGradientControl && /* @__PURE__ */ jsx(
176
+ ColorPanelDropdown,
177
+ {
178
+ className: "block-editor-background-panel__item",
179
+ label: __("Gradient"),
180
+ hasValue: () => hasBackgroundGradientValue(value),
181
+ resetValue: resetGradient,
182
+ isShownByDefault: defaultControls.gradient,
183
+ indicators: [currentGradient],
184
+ tabs: [
185
+ {
186
+ key: "gradient",
187
+ label: __("Gradient"),
188
+ inheritedValue: currentGradient ?? inheritedGradient,
189
+ setValue: setGradient,
190
+ userValue: currentGradient,
191
+ isGradient: true
192
+ }
193
+ ],
194
+ colorGradientControlSettings: {
195
+ gradients,
196
+ disableCustomGradients: !areCustomGradientsEnabled
197
+ },
198
+ panelId
199
+ }
200
+ )
201
+ ]
97
202
  }
98
203
  );
99
204
  }
100
205
  export {
101
206
  BackgroundImagePanel as default,
207
+ hasBackgroundGradientValue,
102
208
  hasBackgroundImageValue,
103
209
  hasBackgroundSizeValue,
210
+ useHasBackgroundControl,
104
211
  useHasBackgroundPanel
105
212
  };
106
213
  //# sourceMappingURL=background-panel.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/global-styles/background-panel.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useCallback, Platform } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n/**\n * Internal dependencies\n */\nimport BackgroundImageControl from '../background-image-control';\nimport { useToolsPanelDropdownMenuProps } from './utils';\nimport { setImmutably } from '../../utils/object';\n\nconst DEFAULT_CONTROLS = {\n\tbackgroundImage: true,\n};\n\n/**\n * Checks site settings to see if the background panel may be used.\n * `settings.background.backgroundSize` exists also,\n * but can only be used if settings?.background?.backgroundImage is `true`.\n *\n * @param {Object} settings Site settings\n * @return {boolean} Whether site settings has activated background panel.\n */\nexport function useHasBackgroundPanel( settings ) {\n\treturn Platform.OS === 'web' && settings?.background?.backgroundImage;\n}\n\n/**\n * Checks if there is a current value in the background size block support\n * attributes. Background size values include background size as well\n * as background position.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background size value set.\n */\nexport function hasBackgroundSizeValue( style ) {\n\treturn (\n\t\tstyle?.background?.backgroundPosition !== undefined ||\n\t\tstyle?.background?.backgroundSize !== undefined\n\t);\n}\n\n/**\n * Checks if there is a current value in the background image block support\n * attributes.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background image value set.\n */\nexport function hasBackgroundImageValue( style ) {\n\treturn (\n\t\t!! style?.background?.backgroundImage?.id ||\n\t\t// Supports url() string values in theme.json.\n\t\t'string' === typeof style?.background?.backgroundImage ||\n\t\t!! style?.background?.backgroundImage?.url\n\t);\n}\n\nfunction BackgroundToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n\theaderLabel,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ headerLabel }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nexport default function BackgroundImagePanel( {\n\tas: Wrapper = BackgroundToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tdefaultValues = {},\n\theaderLabel = __( 'Background' ),\n} ) {\n\tconst showBackgroundImageControl = useHasBackgroundPanel( settings );\n\tconst resetBackground = () =>\n\t\tonChange( setImmutably( value, [ 'background' ], {} ) );\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tbackground: {},\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t\theaderLabel={ headerLabel }\n\t\t>\n\t\t\t{ showBackgroundImageControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! value?.background }\n\t\t\t\t\tlabel={ __( 'Image' ) }\n\t\t\t\t\tonDeselect={ resetBackground }\n\t\t\t\t\tisShownByDefault={ defaultControls.backgroundImage }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<BackgroundImageControl\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\tinheritedValue={ inheritedValue }\n\t\t\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],
5
- "mappings": ";AAGA;AAAA,EACC,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,OAC1B;AACP,SAAS,aAAa,gBAAgB;AACtC,SAAS,UAAU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;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEE,wCACD;AAAA,QAAC;AAAA;AAAA,UACA,UAAW,MAAM,CAAC,CAAE,OAAO;AAAA,UAC3B,OAAQ,GAAI,OAAQ;AAAA,UACpB,YAAa;AAAA,UACb,kBAAmB,gBAAgB;AAAA,UACnC;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACD;AAAA;AAAA,MACD;AAAA;AAAA,EAEF;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useCallback, Platform } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { getValueFromVariable } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport BackgroundImageControl from '../background-image-control';\nimport { ColorPanelDropdown } from './color-panel';\nimport { useGradientsPerOrigin } from './hooks';\nimport { useToolsPanelDropdownMenuProps } from './utils';\nimport { setImmutably } from '../../utils/object';\n\nconst DEFAULT_CONTROLS = {\n\tbackgroundImage: true,\n\tgradient: true,\n};\n\n/**\n * Checks site settings to see if the requested feature's control may be used.\n *\n * @param {Object} settings Site settings.\n * @param {string} feature Background feature to check.\n * @return {boolean} Whether site settings has activated background panel.\n */\nexport function useHasBackgroundControl( settings, feature ) {\n\treturn Platform.OS === 'web' && settings?.background?.[ feature ];\n}\n\n/**\n * Checks site settings to see if the background panel may be used.\n * `settings.background.backgroundSize` exists also,\n * but can only be used if settings?.background?.backgroundImage is `true`.\n *\n * @param {Object} settings Site settings\n * @return {boolean} Whether site settings has activated background panel.\n */\nexport function useHasBackgroundPanel( settings ) {\n\tconst { backgroundImage, gradient } = settings?.background || {};\n\treturn Platform.OS === 'web' && ( backgroundImage || gradient );\n}\n\n/**\n * Checks if there is a current value in the background size block support\n * attributes. Background size values include background size as well\n * as background position.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background size value set.\n */\nexport function hasBackgroundSizeValue( style ) {\n\treturn (\n\t\tstyle?.background?.backgroundPosition !== undefined ||\n\t\tstyle?.background?.backgroundSize !== undefined\n\t);\n}\n\n/**\n * Checks if there is a current value in the background image block support\n * attributes.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background image value set.\n */\nexport function hasBackgroundImageValue( style ) {\n\treturn (\n\t\t!! style?.background?.backgroundImage?.id ||\n\t\t// Supports url() string values in theme.json.\n\t\t'string' === typeof style?.background?.backgroundImage ||\n\t\t!! style?.background?.backgroundImage?.url\n\t);\n}\n\n/**\n * Checks if there is a current value in the background gradient block support\n * attributes.\n *\n * @param {Object} style Style attribute.\n * @return {boolean} Whether the block has a background gradient value set.\n */\nexport function hasBackgroundGradientValue( style ) {\n\treturn (\n\t\t'string' === typeof style?.background?.gradient &&\n\t\tstyle?.background?.gradient !== ''\n\t);\n}\n\nfunction BackgroundToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n\theaderLabel,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ headerLabel }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\thasInnerWrapper\n\t\t\tclassName=\"background-block-support-panel\"\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\t__experimentalLastVisibleItemClass=\"last\"\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<div className=\"background-block-support-panel__inner-wrapper\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</ToolsPanel>\n\t);\n}\n\nexport default function BackgroundImagePanel( {\n\tas: Wrapper = BackgroundToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tdefaultValues = {},\n\theaderLabel = __( 'Background' ),\n} ) {\n\tconst gradients = useGradientsPerOrigin( settings );\n\tconst areCustomGradientsEnabled = settings?.color?.customGradient;\n\tconst hasGradientColors = gradients.length > 0 || areCustomGradientsEnabled;\n\n\tconst hasBackgroundGradientControl = useHasBackgroundControl(\n\t\tsettings,\n\t\t'gradient'\n\t);\n\tconst showBackgroundGradientControl =\n\t\thasGradientColors && hasBackgroundGradientControl;\n\tconst showBackgroundImageControl = useHasBackgroundControl(\n\t\tsettings,\n\t\t'backgroundImage'\n\t);\n\n\tconst resetAllFilter = useCallback(\n\t\t( previousValue ) => {\n\t\t\treturn {\n\t\t\t\t...previousValue,\n\t\t\t\tbackground: {},\n\t\t\t\tcolor: hasBackgroundGradientControl\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t...previousValue?.color,\n\t\t\t\t\t\t\tgradient: undefined,\n\t\t\t\t\t }\n\t\t\t\t\t: previousValue?.color,\n\t\t\t};\n\t\t},\n\t\t[ hasBackgroundGradientControl ]\n\t);\n\n\tif ( ! showBackgroundGradientControl && ! showBackgroundImageControl ) {\n\t\treturn null;\n\t}\n\n\tconst decodeValue = ( rawValue ) =>\n\t\tgetValueFromVariable( { settings }, '', rawValue );\n\tconst encodeGradientValue = ( gradientValue ) => {\n\t\tconst allGradients = gradients.flatMap(\n\t\t\t( { gradients: originGradients } ) => originGradients\n\t\t);\n\t\tconst gradientObject = allGradients.find(\n\t\t\t( { gradient } ) => gradient === gradientValue\n\t\t);\n\t\treturn gradientObject\n\t\t\t? 'var:preset|gradient|' + gradientObject.slug\n\t\t\t: gradientValue;\n\t};\n\n\tconst resetBackground = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'background', 'backgroundImage' ],\n\t\t\t\tundefined\n\t\t\t)\n\t\t);\n\n\tconst resetGradient = () => {\n\t\tlet newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'background', 'gradient' ],\n\t\t\tundefined\n\t\t);\n\t\tnewValue = setImmutably( newValue, [ 'color', 'gradient' ], undefined );\n\t\tonChange( newValue );\n\t};\n\n\t// Get current gradient value, decoding preset slug references.\n\t// Fall back to color.gradient for legacy blocks that haven't migrated\n\t// to background.gradient yet (mirrors block inspector fallback in\n\t// packages/block-editor/src/hooks/background.js).\n\tconst currentGradient = decodeValue(\n\t\tvalue?.background?.gradient ?? value?.color?.gradient\n\t);\n\tconst inheritedGradient = decodeValue(\n\t\tinheritedValue?.background?.gradient ?? inheritedValue?.color?.gradient\n\t);\n\n\t// Set gradient value, encoding preset matches as slug references.\n\t// Also clear color.gradient to migrate from the legacy location,\n\t// matching the block inspector behavior in hooks/background.js.\n\tconst setGradient = ( newGradient ) => {\n\t\tlet newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'background', 'gradient' ],\n\t\t\tencodeGradientValue( newGradient )\n\t\t);\n\t\tnewValue = setImmutably( newValue, [ 'color', 'gradient' ], undefined );\n\t\tonChange( newValue );\n\t};\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t\theaderLabel={ headerLabel }\n\t\t>\n\t\t\t{ showBackgroundImageControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"block-editor-background-panel__item\"\n\t\t\t\t\thasValue={ () => hasBackgroundImageValue( value ) }\n\t\t\t\t\tlabel={ __( 'Image' ) }\n\t\t\t\t\tonDeselect={ resetBackground }\n\t\t\t\t\tisShownByDefault={ defaultControls.backgroundImage }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<BackgroundImageControl\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\tinheritedValue={ inheritedValue }\n\t\t\t\t\t\tdefaultControls={ defaultControls }\n\t\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showBackgroundGradientControl && (\n\t\t\t\t<ColorPanelDropdown\n\t\t\t\t\tclassName=\"block-editor-background-panel__item\"\n\t\t\t\t\tlabel={ __( 'Gradient' ) }\n\t\t\t\t\thasValue={ () => hasBackgroundGradientValue( value ) }\n\t\t\t\t\tresetValue={ resetGradient }\n\t\t\t\t\tisShownByDefault={ defaultControls.gradient }\n\t\t\t\t\tindicators={ [ currentGradient ] }\n\t\t\t\t\ttabs={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'gradient',\n\t\t\t\t\t\t\tlabel: __( 'Gradient' ),\n\t\t\t\t\t\t\tinheritedValue:\n\t\t\t\t\t\t\t\tcurrentGradient ?? inheritedGradient,\n\t\t\t\t\t\t\tsetValue: setGradient,\n\t\t\t\t\t\t\tuserValue: currentGradient,\n\t\t\t\t\t\t\tisGradient: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t\tcolorGradientControlSettings={ {\n\t\t\t\t\t\tgradients,\n\t\t\t\t\t\tdisableCustomGradients: ! areCustomGradientsEnabled,\n\t\t\t\t\t} }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],
5
+ "mappings": ";AAGA;AAAA,EACC,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,OAC1B;AACP,SAAS,aAAa,gBAAgB;AACtC,SAAS,UAAU;AACnB,SAAS,4BAA4B;AAKrC,OAAO,4BAA4B;AACnC,SAAS,0BAA0B;AACnC,SAAS,6BAA6B;AACtC,SAAS,sCAAsC;AAC/C,SAAS,oBAAoB;AAqG1B,cA+GD,Y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