@wordpress/block-editor 14.0.0 → 14.1.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.
- package/CHANGELOG.md +2 -0
- package/README.md +9 -14
- package/build/autocompleters/block.js +1 -1
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +2 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +11 -4
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js +28 -34
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +14 -3
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +2 -1
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +8 -4
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/border-radius-control/index.js +1 -0
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +1 -1
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +2 -0
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +3 -0
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +3 -0
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +114 -42
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +3 -1
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/global-styles/hooks.js +0 -7
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +0 -6
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +3 -3
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +8 -24
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +20 -5
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/height-control/index.js +1 -0
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/iframe/index.js +4 -2
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/zoom-dropdown.js +11 -7
- package/build/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +8 -8
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +7 -25
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +9 -11
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/library.js +4 -2
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/menu.js +30 -12
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +4 -0
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/line-height-control/index.js +3 -0
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/media-placeholder/index.js +9 -4
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +4 -1
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +12 -12
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -2
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/text-alignment-control/index.js +13 -8
- package/build/components/text-alignment-control/index.js.map +1 -1
- package/build/components/text-decoration-control/index.js +13 -8
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +13 -8
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -0
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +14 -2
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/writing-mode-control/index.js +13 -8
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/hooks/background.js +19 -23
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-bindings.js +37 -79
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/layouts/constrained.js +1 -0
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +2 -0
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/grid.js +3 -0
- package/build/layouts/grid.js.map +1 -1
- package/build/private-apis.js +3 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/private-selectors.js +30 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +10 -1
- package/build/store/reducer.js.map +1 -1
- package/build/utils/block-bindings.js +112 -0
- package/build/utils/block-bindings.js.map +1 -0
- package/build-module/autocompleters/block.js +1 -1
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +2 -2
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +11 -4
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-settings-menu/block-mode-toggle.js +29 -34
- package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +14 -3
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +2 -1
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +8 -4
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +1 -0
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +1 -1
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +2 -0
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +3 -0
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +3 -0
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +117 -45
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +3 -1
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +0 -6
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +5 -5
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +8 -23
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +20 -5
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/height-control/index.js +1 -0
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +4 -2
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/zoom-dropdown.js +12 -8
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +7 -6
- package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.js +6 -23
- package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +9 -11
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/library.js +4 -2
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/menu.js +30 -12
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +5 -1
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/line-height-control/index.js +3 -0
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +9 -4
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +4 -1
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +12 -12
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -2
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/text-alignment-control/index.js +13 -8
- package/build-module/components/text-alignment-control/index.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +13 -8
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +13 -8
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +2 -0
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +14 -2
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +13 -8
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/hooks/background.js +19 -23
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-bindings.js +38 -80
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/layouts/constrained.js +1 -0
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +2 -0
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/grid.js +3 -0
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-selectors.js +27 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +9 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/block-bindings.js +105 -0
- package/build-module/utils/block-bindings.js.map +1 -0
- package/build-style/content-rtl.css +7 -14
- package/build-style/content.css +7 -14
- package/build-style/default-editor-styles-rtl.css +2 -2
- package/build-style/default-editor-styles.css +2 -2
- package/build-style/style-rtl.css +36 -38
- package/build-style/style.css +36 -38
- package/package.json +32 -32
- package/src/autocompleters/block.js +2 -1
- package/src/components/block-list/content.scss +5 -13
- package/src/components/block-list/use-block-props/index.js +2 -2
- package/src/components/block-list/use-in-between-inserter.js +17 -5
- package/src/components/block-settings-menu/block-mode-toggle.js +28 -31
- package/src/components/block-settings-menu/test/block-mode-toggle.js +26 -23
- package/src/components/block-tools/insertion-point.js +11 -0
- package/src/components/block-tools/style.scss +1 -1
- package/src/components/block-tools/use-show-block-tools.js +4 -1
- package/src/components/block-tools/zoom-out-mode-inserters.js +7 -1
- package/src/components/block-variation-transforms/style.scss +1 -1
- package/src/components/border-radius-control/index.js +1 -0
- package/src/components/border-radius-control/style.scss +0 -10
- package/src/components/convert-to-group-buttons/index.js +1 -1
- package/src/components/date-format-picker/index.js +2 -0
- package/src/components/font-appearance-control/index.js +3 -0
- package/src/components/font-family/README.md +11 -2
- package/src/components/font-family/index.js +3 -0
- package/src/components/global-styles/background-panel.js +132 -53
- package/src/components/global-styles/get-global-styles-changes.js +4 -1
- package/src/components/global-styles/hooks.js +0 -5
- package/src/components/global-styles/index.js +0 -1
- package/src/components/global-styles/style.scss +13 -2
- package/src/components/global-styles/test/use-global-styles-output.js +20 -4
- package/src/components/global-styles/use-global-styles-output.js +5 -6
- package/src/components/global-styles/utils.js +7 -29
- package/src/components/grid/grid-visualizer.js +22 -7
- package/src/components/height-control/index.js +1 -0
- package/src/components/iframe/index.js +4 -2
- package/src/components/image-editor/zoom-dropdown.js +17 -9
- package/src/components/inner-blocks/button-block-appender.js +5 -7
- package/src/components/inner-blocks/default-block-appender.js +4 -23
- package/src/components/inner-blocks/index.js +10 -9
- package/src/components/inserter/library.js +2 -0
- package/src/components/inserter/menu.js +32 -27
- package/src/components/inserter/quick-inserter.js +4 -1
- package/src/components/inserter/style.scss +1 -1
- package/src/components/inserter-list-item/style.scss +1 -0
- package/src/components/line-height-control/README.md +7 -0
- package/src/components/line-height-control/index.js +3 -0
- package/src/components/link-control/style.scss +1 -1
- package/src/components/media-placeholder/index.js +12 -7
- package/src/components/media-upload/README.md +2 -0
- package/src/components/media-upload/index.native.js +2 -0
- package/src/components/multi-selection-inspector/index.js +8 -9
- package/src/components/responsive-block-control/README.md +1 -0
- package/src/components/responsive-block-control/test/index.js +1 -0
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +8 -4
- package/src/components/spacing-sizes-control/style.scss +16 -16
- package/src/components/text-alignment-control/index.js +20 -8
- package/src/components/text-decoration-control/index.js +20 -8
- package/src/components/text-decoration-control/stories/index.story.js +0 -4
- package/src/components/text-transform-control/index.js +20 -8
- package/src/components/text-transform-control/stories/index.story.js +0 -4
- package/src/components/url-input/style.scss +2 -2
- package/src/components/url-popover/image-url-input-ui.js +2 -0
- package/src/components/use-block-drop-zone/index.js +21 -3
- package/src/components/writing-mode-control/index.js +20 -8
- package/src/hooks/background.js +21 -27
- package/src/hooks/block-bindings.js +27 -84
- package/src/hooks/block-bindings.scss +1 -1
- package/src/hooks/test/background.js +60 -0
- package/src/layouts/constrained.js +1 -0
- package/src/layouts/flex.js +2 -0
- package/src/layouts/grid.js +3 -0
- package/src/private-apis.js +2 -0
- package/src/store/private-selectors.js +36 -0
- package/src/store/reducer.js +7 -0
- package/src/store/test/private-selectors.js +89 -0
- package/src/style.scss +0 -1
- package/src/utils/block-bindings.js +98 -0
- package/src/utils/test/transform-styles.js +49 -0
- package/build/components/global-styles/theme-file-uri-utils.js +0 -21
- package/build/components/global-styles/theme-file-uri-utils.js.map +0 -1
- package/build/components/inner-blocks/with-client-id.js +0 -28
- package/build/components/inner-blocks/with-client-id.js.map +0 -1
- package/build/components/segmented-text-control/index.js +0 -63
- package/build/components/segmented-text-control/index.js.map +0 -1
- package/build-module/components/global-styles/theme-file-uri-utils.js +0 -15
- package/build-module/components/global-styles/theme-file-uri-utils.js.map +0 -1
- package/build-module/components/inner-blocks/with-client-id.js +0 -21
- package/build-module/components/inner-blocks/with-client-id.js.map +0 -1
- package/build-module/components/segmented-text-control/index.js +0 -58
- package/build-module/components/segmented-text-control/index.js.map +0 -1
- package/src/components/global-styles/test/theme-file-uri-utils.js +0 -41
- package/src/components/global-styles/theme-file-uri-utils.js +0 -18
- package/src/components/inner-blocks/with-client-id.js +0 -19
- package/src/components/segmented-text-control/index.js +0 -63
- package/src/components/segmented-text-control/style.scss +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getBlockSupport","useSelect","useCallback","InspectorControls","cleanEmptyObject","store","blockEditorStore","default","StylesBackgroundPanel","useHasBackgroundPanel","hasBackgroundImageValue","globalStylesDataKey","
|
|
1
|
+
{"version":3,"names":["getBlockSupport","useSelect","useCallback","InspectorControls","cleanEmptyObject","store","blockEditorStore","default","StylesBackgroundPanel","useHasBackgroundPanel","hasBackgroundImageValue","globalStylesDataKey","jsx","_jsx","BACKGROUND_SUPPORT_KEY","BACKGROUND_BLOCK_DEFAULT_VALUES","backgroundSize","backgroundPosition","hasBackgroundSupport","blockName","feature","support","backgroundImage","backgroundRepeat","setBackgroundStyleDefaults","backgroundStyle","url","backgroundStylesWithDefaults","useBlockProps","name","style","background","backgroundStyles","getBackgroundImageClasses","BackgroundInspectorControl","children","resetAllFilter","attributes","undefined","group","BackgroundImagePanel","clientId","setAttributes","settings","inheritedValue","select","getBlockAttributes","getSettings","_settings","blocks","onChange","newStyle","updatedSettings","as","panelId","defaultValues","value","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/background.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport { cleanEmptyObject } from './utils';\nimport { store as blockEditorStore } from '../store';\nimport {\n\tdefault as StylesBackgroundPanel,\n\tuseHasBackgroundPanel,\n\thasBackgroundImageValue,\n} from '../components/global-styles/background-panel';\nimport { globalStylesDataKey } from '../store/private-keys';\n\nexport const BACKGROUND_SUPPORT_KEY = 'background';\n\n// Initial control values.\nexport const BACKGROUND_BLOCK_DEFAULT_VALUES = {\n\tbackgroundSize: 'cover',\n\tbackgroundPosition: '50% 50%', // used only when backgroundSize is 'contain'.\n};\n\n/**\n * Determine whether there is block support for background.\n *\n * @param {string} blockName Block name.\n * @param {string} feature Background image feature to check for.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasBackgroundSupport( blockName, feature = 'any' ) {\n\tconst support = getBlockSupport( blockName, BACKGROUND_SUPPORT_KEY );\n\n\tif ( support === true ) {\n\t\treturn true;\n\t}\n\n\tif ( feature === 'any' ) {\n\t\treturn (\n\t\t\t!! support?.backgroundImage ||\n\t\t\t!! support?.backgroundSize ||\n\t\t\t!! support?.backgroundRepeat\n\t\t);\n\t}\n\n\treturn !! support?.[ feature ];\n}\n\nexport function setBackgroundStyleDefaults( backgroundStyle ) {\n\tif ( ! backgroundStyle || ! backgroundStyle?.backgroundImage?.url ) {\n\t\treturn;\n\t}\n\n\tlet backgroundStylesWithDefaults;\n\n\t// Set block background defaults.\n\tif ( ! backgroundStyle?.backgroundSize ) {\n\t\tbackgroundStylesWithDefaults = {\n\t\t\tbackgroundSize: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundSize,\n\t\t};\n\t}\n\n\tif (\n\t\t'contain' === backgroundStyle?.backgroundSize &&\n\t\t! backgroundStyle?.backgroundPosition\n\t) {\n\t\tbackgroundStylesWithDefaults = {\n\t\t\tbackgroundPosition:\n\t\t\t\tBACKGROUND_BLOCK_DEFAULT_VALUES.backgroundPosition,\n\t\t};\n\t}\n\treturn backgroundStylesWithDefaults;\n}\n\nfunction useBlockProps( { name, style } ) {\n\tif (\n\t\t! hasBackgroundSupport( name ) ||\n\t\t! style?.background?.backgroundImage\n\t) {\n\t\treturn;\n\t}\n\n\tconst backgroundStyles = setBackgroundStyleDefaults( style?.background );\n\n\tif ( ! backgroundStyles ) {\n\t\treturn;\n\t}\n\n\treturn {\n\t\tstyle: {\n\t\t\t...backgroundStyles,\n\t\t},\n\t};\n}\n\n/**\n * Generates a CSS class name if an background image is set.\n *\n * @param {Object} style A block's style attribute.\n *\n * @return {string} CSS class name.\n */\nexport function getBackgroundImageClasses( style ) {\n\treturn hasBackgroundImageValue( style ) ? 'has-background' : '';\n}\n\nfunction BackgroundInspectorControl( { children } ) {\n\tconst resetAllFilter = useCallback( ( attributes ) => {\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tstyle: {\n\t\t\t\t...attributes.style,\n\t\t\t\tbackground: undefined,\n\t\t\t},\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<InspectorControls group=\"background\" resetAllFilter={ resetAllFilter }>\n\t\t\t{ children }\n\t\t</InspectorControls>\n\t);\n}\n\nexport function BackgroundImagePanel( {\n\tclientId,\n\tname,\n\tsetAttributes,\n\tsettings,\n} ) {\n\tconst { style, inheritedValue } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes, getSettings } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst _settings = getSettings();\n\t\t\treturn {\n\t\t\t\tstyle: getBlockAttributes( clientId )?.style,\n\t\t\t\t/*\n\t\t\t\t * To ensure we pass down the right inherited values:\n\t\t\t\t * @TODO 1. Pass inherited value down to all block style controls,\n\t\t\t\t * See: packages/block-editor/src/hooks/style.js\n\t\t\t\t * @TODO 2. Add support for block style variations,\n\t\t\t\t * See implementation: packages/block-editor/src/hooks/block-style-variation.js\n\t\t\t\t */\n\t\t\t\tinheritedValue:\n\t\t\t\t\t_settings[ globalStylesDataKey ]?.blocks?.[ name ],\n\t\t\t};\n\t\t},\n\t\t[ clientId, name ]\n\t);\n\n\tif (\n\t\t! useHasBackgroundPanel( settings ) ||\n\t\t! hasBackgroundSupport( name, 'backgroundImage' )\n\t) {\n\t\treturn null;\n\t}\n\n\tconst onChange = ( newStyle ) => {\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tconst updatedSettings = {\n\t\t...settings,\n\t\tbackground: {\n\t\t\t...settings.background,\n\t\t\tbackgroundSize:\n\t\t\t\tsettings?.background?.backgroundSize &&\n\t\t\t\thasBackgroundSupport( name, 'backgroundSize' ),\n\t\t},\n\t};\n\n\treturn (\n\t\t<StylesBackgroundPanel\n\t\t\tinheritedValue={ inheritedValue }\n\t\t\tas={ BackgroundInspectorControl }\n\t\t\tpanelId={ clientId }\n\t\t\tdefaultValues={ BACKGROUND_BLOCK_DEFAULT_VALUES }\n\t\t\tsettings={ updatedSettings }\n\t\t\tonChange={ onChange }\n\t\t\tvalue={ style }\n\t\t/>\n\t);\n}\n\nexport default {\n\tuseBlockProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport: hasBackgroundSupport,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,SAASC,gBAAgB,QAAQ,SAAS;AAC1C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SACCC,OAAO,IAAIC,qBAAqB,EAChCC,qBAAqB,EACrBC,uBAAuB,QACjB,8CAA8C;AACrD,SAASC,mBAAmB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,OAAO,MAAMC,sBAAsB,GAAG,YAAY;;AAElD;AACA,OAAO,MAAMC,+BAA+B,GAAG;EAC9CC,cAAc,EAAE,OAAO;EACvBC,kBAAkB,EAAE,SAAS,CAAE;AAChC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,oBAAoBA,CAAEC,SAAS,EAAEC,OAAO,GAAG,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,aAAa,CAAE;MACdZ,KAAK,EAAE1B,gBAAgB,CAAE+C,QAAS;IACnC,CAAE,CAAC;EACJ,CAAC;EAED,MAAMC,eAAe,GAAG;IACvB,GAAGT,QAAQ;IACXZ,UAAU,EAAE;MACX,GAAGY,QAAQ,CAACZ,UAAU;MACtBf,cAAc,EACb2B,QAAQ,EAAEZ,UAAU,EAAEf,cAAc,IACpCE,oBAAoB,CAAEW,IAAI,EAAE,gBAAiB;IAC/C;EACD,CAAC;EAED,oBACChB,IAAA,CAACL,qBAAqB;IACrBoC,cAAc,EAAGA,cAAgB;IACjCS,EAAE,EAAGnB,0BAA4B;IACjCoB,OAAO,EAAGb,QAAU;IACpBc,aAAa,EAAGxC,+BAAiC;IACjD4B,QAAQ,EAAGS,eAAiB;IAC5BF,QAAQ,EAAGA,QAAU;IACrBM,KAAK,EAAG1B;EAAO,CACf,CAAC;AAEJ;AAEA,eAAe;EACdF,aAAa;EACb6B,aAAa,EAAE,CAAE,OAAO,CAAE;EAC1BC,UAAU,EAAExC;AACb,CAAC","ignoreList":[]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { privateApis as blocksPrivateApis } from '@wordpress/blocks';
|
|
6
6
|
import { __experimentalItemGroup as ItemGroup, __experimentalItem as Item, __experimentalText as Text, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem, __experimentalTruncate as Truncate, __experimentalVStack as VStack, privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
7
|
-
import {
|
|
7
|
+
import { useRegistry } from '@wordpress/data';
|
|
8
8
|
import { useContext, Fragment } from '@wordpress/element';
|
|
9
9
|
import { useViewportMatch } from '@wordpress/compose';
|
|
10
10
|
|
|
@@ -12,10 +12,10 @@ import { useViewportMatch } from '@wordpress/compose';
|
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
import { canBindAttribute, getBindableAttributes } from '../hooks/use-bindings-attributes';
|
|
15
|
-
import { store as blockEditorStore } from '../store';
|
|
16
15
|
import { unlock } from '../lock-unlock';
|
|
17
16
|
import InspectorControls from '../components/inspector-controls';
|
|
18
17
|
import BlockContext from '../components/block-context';
|
|
18
|
+
import { useBlockBindingsUtils } from '../utils/block-bindings';
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
21
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -39,22 +39,35 @@ const useToolsPanelDropdownMenuProps = () => {
|
|
|
39
39
|
};
|
|
40
40
|
function BlockBindingsPanelDropdown({
|
|
41
41
|
fieldsList,
|
|
42
|
-
addConnection,
|
|
43
42
|
attribute,
|
|
44
43
|
binding
|
|
45
44
|
}) {
|
|
45
|
+
const {
|
|
46
|
+
getBlockBindingsSources
|
|
47
|
+
} = unlock(blocksPrivateApis);
|
|
48
|
+
const registeredSources = getBlockBindingsSources();
|
|
49
|
+
const {
|
|
50
|
+
updateBlockBindings
|
|
51
|
+
} = useBlockBindingsUtils();
|
|
46
52
|
const currentKey = binding?.args?.key;
|
|
47
53
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
48
|
-
children: Object.entries(fieldsList).map(([
|
|
54
|
+
children: Object.entries(fieldsList).map(([name, fields], i) => /*#__PURE__*/_jsxs(Fragment, {
|
|
49
55
|
children: [/*#__PURE__*/_jsxs(DropdownMenuGroup, {
|
|
50
56
|
children: [Object.keys(fieldsList).length > 1 && /*#__PURE__*/_jsx(Text, {
|
|
51
57
|
className: "block-editor-bindings__source-label",
|
|
52
58
|
upperCase: true,
|
|
53
59
|
variant: "muted",
|
|
54
60
|
"aria-hidden": true,
|
|
55
|
-
children: label
|
|
61
|
+
children: registeredSources[name].label
|
|
56
62
|
}), Object.entries(fields).map(([key, value]) => /*#__PURE__*/_jsxs(DropdownMenuRadioItem, {
|
|
57
|
-
onChange: () =>
|
|
63
|
+
onChange: () => updateBlockBindings({
|
|
64
|
+
[attribute]: {
|
|
65
|
+
source: name,
|
|
66
|
+
args: {
|
|
67
|
+
key
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}),
|
|
58
71
|
name: attribute + '-binding',
|
|
59
72
|
value: key,
|
|
60
73
|
checked: key === currentKey,
|
|
@@ -65,7 +78,7 @@ function BlockBindingsPanelDropdown({
|
|
|
65
78
|
})]
|
|
66
79
|
}, key))]
|
|
67
80
|
}), i !== Object.keys(fieldsList).length - 1 && /*#__PURE__*/_jsx(DropdownMenuSeparator, {})]
|
|
68
|
-
},
|
|
81
|
+
}, name))
|
|
69
82
|
});
|
|
70
83
|
}
|
|
71
84
|
function BlockBindingsAttribute({
|
|
@@ -104,10 +117,11 @@ function ReadOnlyBlockBindingsPanelItems({
|
|
|
104
117
|
function EditableBlockBindingsPanelItems({
|
|
105
118
|
attributes,
|
|
106
119
|
bindings,
|
|
107
|
-
fieldsList
|
|
108
|
-
addConnection,
|
|
109
|
-
removeConnection
|
|
120
|
+
fieldsList
|
|
110
121
|
}) {
|
|
122
|
+
const {
|
|
123
|
+
updateBlockBindings
|
|
124
|
+
} = useBlockBindingsUtils();
|
|
111
125
|
const isMobile = useViewportMatch('medium', '<');
|
|
112
126
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
113
127
|
children: attributes.map(attribute => {
|
|
@@ -116,7 +130,9 @@ function EditableBlockBindingsPanelItems({
|
|
|
116
130
|
hasValue: () => !!binding,
|
|
117
131
|
label: attribute,
|
|
118
132
|
onDeselect: () => {
|
|
119
|
-
|
|
133
|
+
updateBlockBindings({
|
|
134
|
+
[attribute]: undefined
|
|
135
|
+
});
|
|
120
136
|
},
|
|
121
137
|
children: /*#__PURE__*/_jsx(DropdownMenu, {
|
|
122
138
|
placement: isMobile ? 'bottom-start' : 'left-start',
|
|
@@ -130,7 +146,6 @@ function EditableBlockBindingsPanelItems({
|
|
|
130
146
|
}),
|
|
131
147
|
children: /*#__PURE__*/_jsx(BlockBindingsPanelDropdown, {
|
|
132
148
|
fieldsList: fieldsList,
|
|
133
|
-
addConnection: addConnection,
|
|
134
149
|
attribute: attribute,
|
|
135
150
|
binding: binding
|
|
136
151
|
})
|
|
@@ -140,7 +155,7 @@ function EditableBlockBindingsPanelItems({
|
|
|
140
155
|
});
|
|
141
156
|
}
|
|
142
157
|
export const BlockBindingsPanel = ({
|
|
143
|
-
name,
|
|
158
|
+
name: blockName,
|
|
144
159
|
metadata
|
|
145
160
|
}) => {
|
|
146
161
|
const registry = useRegistry();
|
|
@@ -148,86 +163,31 @@ export const BlockBindingsPanel = ({
|
|
|
148
163
|
const {
|
|
149
164
|
bindings
|
|
150
165
|
} = metadata || {};
|
|
151
|
-
const
|
|
166
|
+
const {
|
|
167
|
+
removeAllBlockBindings
|
|
168
|
+
} = useBlockBindingsUtils();
|
|
169
|
+
const bindableAttributes = getBindableAttributes(blockName);
|
|
152
170
|
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
153
171
|
const filteredBindings = {
|
|
154
172
|
...bindings
|
|
155
173
|
};
|
|
156
174
|
Object.keys(filteredBindings).forEach(key => {
|
|
157
|
-
if (!canBindAttribute(
|
|
175
|
+
if (!canBindAttribute(blockName, key) || filteredBindings[key].source === 'core/pattern-overrides') {
|
|
158
176
|
delete filteredBindings[key];
|
|
159
177
|
}
|
|
160
178
|
});
|
|
161
|
-
const {
|
|
162
|
-
updateBlockAttributes
|
|
163
|
-
} = useDispatch(blockEditorStore);
|
|
164
|
-
const {
|
|
165
|
-
_id
|
|
166
|
-
} = useSelect(select => {
|
|
167
|
-
const {
|
|
168
|
-
getSelectedBlockClientId
|
|
169
|
-
} = select(blockEditorStore);
|
|
170
|
-
return {
|
|
171
|
-
_id: getSelectedBlockClientId()
|
|
172
|
-
};
|
|
173
|
-
}, []);
|
|
174
179
|
if (!bindableAttributes || bindableAttributes.length === 0) {
|
|
175
180
|
return null;
|
|
176
181
|
}
|
|
177
|
-
const removeAllConnections = () => {
|
|
178
|
-
const newMetadata = {
|
|
179
|
-
...metadata
|
|
180
|
-
};
|
|
181
|
-
delete newMetadata.bindings;
|
|
182
|
-
updateBlockAttributes(_id, {
|
|
183
|
-
metadata: Object.keys(newMetadata).length === 0 ? undefined : newMetadata
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
const addConnection = (value, attribute) => {
|
|
187
|
-
// Assuming the block expects a flat structure for its metadata attribute
|
|
188
|
-
const newMetadata = {
|
|
189
|
-
...metadata,
|
|
190
|
-
// Adjust this according to the actual structure expected by your block
|
|
191
|
-
bindings: {
|
|
192
|
-
...metadata?.bindings,
|
|
193
|
-
[attribute]: {
|
|
194
|
-
source: 'core/post-meta',
|
|
195
|
-
args: {
|
|
196
|
-
key: value
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
// Update the block's attributes with the new metadata
|
|
202
|
-
updateBlockAttributes(_id, {
|
|
203
|
-
metadata: newMetadata
|
|
204
|
-
});
|
|
205
|
-
};
|
|
206
|
-
const removeConnection = key => {
|
|
207
|
-
const newMetadata = {
|
|
208
|
-
...metadata
|
|
209
|
-
};
|
|
210
|
-
if (!newMetadata.bindings) {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
delete newMetadata.bindings[key];
|
|
214
|
-
if (Object.keys(newMetadata.bindings).length === 0) {
|
|
215
|
-
delete newMetadata.bindings;
|
|
216
|
-
}
|
|
217
|
-
updateBlockAttributes(_id, {
|
|
218
|
-
metadata: Object.keys(newMetadata).length === 0 ? undefined : newMetadata
|
|
219
|
-
});
|
|
220
|
-
};
|
|
221
182
|
const fieldsList = {};
|
|
222
183
|
const {
|
|
223
184
|
getBlockBindingsSources
|
|
224
185
|
} = unlock(blocksPrivateApis);
|
|
225
186
|
const registeredSources = getBlockBindingsSources();
|
|
226
|
-
Object.
|
|
187
|
+
Object.entries(registeredSources).forEach(([sourceName, {
|
|
227
188
|
getFieldsList,
|
|
228
|
-
label,
|
|
229
189
|
usesContext
|
|
230
|
-
}) => {
|
|
190
|
+
}]) => {
|
|
231
191
|
if (getFieldsList) {
|
|
232
192
|
// Populate context.
|
|
233
193
|
const context = {};
|
|
@@ -242,7 +202,7 @@ export const BlockBindingsPanel = ({
|
|
|
242
202
|
});
|
|
243
203
|
// Only add source if the list is not empty.
|
|
244
204
|
if (sourceList) {
|
|
245
|
-
fieldsList[
|
|
205
|
+
fieldsList[sourceName] = {
|
|
246
206
|
...sourceList
|
|
247
207
|
};
|
|
248
208
|
}
|
|
@@ -264,7 +224,7 @@ export const BlockBindingsPanel = ({
|
|
|
264
224
|
children: /*#__PURE__*/_jsxs(ToolsPanel, {
|
|
265
225
|
label: __('Attributes'),
|
|
266
226
|
resetAll: () => {
|
|
267
|
-
|
|
227
|
+
removeAllBlockBindings();
|
|
268
228
|
},
|
|
269
229
|
dropdownMenuProps: dropdownMenuProps,
|
|
270
230
|
className: "block-editor-bindings__panel",
|
|
@@ -276,9 +236,7 @@ export const BlockBindingsPanel = ({
|
|
|
276
236
|
}) : /*#__PURE__*/_jsx(EditableBlockBindingsPanelItems, {
|
|
277
237
|
attributes: bindableAttributes,
|
|
278
238
|
bindings: filteredBindings,
|
|
279
|
-
fieldsList: fieldsList
|
|
280
|
-
addConnection: addConnection,
|
|
281
|
-
removeConnection: removeConnection
|
|
239
|
+
fieldsList: fieldsList
|
|
282
240
|
})
|
|
283
241
|
}), /*#__PURE__*/_jsx(Text, {
|
|
284
242
|
variant: "muted",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","privateApis","blocksPrivateApis","__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalText","Text","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalTruncate","Truncate","__experimentalVStack","VStack","componentsPrivateApis","useSelect","useDispatch","useRegistry","useContext","Fragment","useViewportMatch","canBindAttribute","getBindableAttributes","store","blockEditorStore","unlock","InspectorControls","BlockContext","jsx","_jsx","jsxs","_jsxs","_Fragment","DropdownMenuV2","DropdownMenu","DropdownMenuGroupV2","DropdownMenuGroup","DropdownMenuRadioItemV2","DropdownMenuRadioItem","DropdownMenuItemLabelV2","DropdownMenuItemLabel","DropdownMenuItemHelpTextV2","DropdownMenuItemHelpText","DropdownMenuSeparatorV2","DropdownMenuSeparator","useToolsPanelDropdownMenuProps","isMobile","popoverProps","placement","offset","BlockBindingsPanelDropdown","fieldsList","addConnection","attribute","binding","currentKey","args","key","children","Object","entries","map","label","fields","i","keys","length","className","upperCase","variant","value","onChange","name","checked","BlockBindingsAttribute","source","sourceName","sourceProps","getBlockBindingsSource","ReadOnlyBlockBindingsPanelItems","bindings","EditableBlockBindingsPanelItems","attributes","removeConnection","hasValue","onDeselect","gutter","trigger","BlockBindingsPanel","metadata","registry","blockContext","bindableAttributes","dropdownMenuProps","filteredBindings","forEach","updateBlockAttributes","_id","select","getSelectedBlockClientId","removeAllConnections","newMetadata","undefined","getBlockBindingsSources","registeredSources","values","getFieldsList","usesContext","context","sourceList","readOnly","window","__experimentalBlockBindingsUI","resetAll","isBordered","isSeparated","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blocksPrivateApis } from '@wordpress/blocks';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalText as Text,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalTruncate as Truncate,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { useContext, Fragment } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcanBindAttribute,\n\tgetBindableAttributes,\n} from '../hooks/use-bindings-attributes';\nimport { store as blockEditorStore } from '../store';\nimport { unlock } from '../lock-unlock';\nimport InspectorControls from '../components/inspector-controls';\nimport BlockContext from '../components/block-context';\n\nconst {\n\tDropdownMenuV2: DropdownMenu,\n\tDropdownMenuGroupV2: DropdownMenuGroup,\n\tDropdownMenuRadioItemV2: DropdownMenuRadioItem,\n\tDropdownMenuItemLabelV2: DropdownMenuItemLabel,\n\tDropdownMenuItemHelpTextV2: DropdownMenuItemHelpText,\n\tDropdownMenuSeparatorV2: DropdownMenuSeparator,\n} = unlock( componentsPrivateApis );\n\nconst useToolsPanelDropdownMenuProps = () => {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n};\n\nfunction BlockBindingsPanelDropdown( {\n\tfieldsList,\n\taddConnection,\n\tattribute,\n\tbinding,\n} ) {\n\tconst currentKey = binding?.args?.key;\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( fieldsList ).map( ( [ label, fields ], i ) => (\n\t\t\t\t<Fragment key={ label }>\n\t\t\t\t\t<DropdownMenuGroup>\n\t\t\t\t\t\t{ Object.keys( fieldsList ).length > 1 && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tclassName=\"block-editor-bindings__source-label\"\n\t\t\t\t\t\t\t\tupperCase\n\t\t\t\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Object.entries( fields ).map( ( [ key, value ] ) => (\n\t\t\t\t\t\t\t<DropdownMenuRadioItem\n\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\taddConnection( key, attribute )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tname={ attribute + '-binding' }\n\t\t\t\t\t\t\t\tvalue={ key }\n\t\t\t\t\t\t\t\tchecked={ key === currentKey }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DropdownMenuItemLabel>\n\t\t\t\t\t\t\t\t\t{ key }\n\t\t\t\t\t\t\t\t</DropdownMenuItemLabel>\n\t\t\t\t\t\t\t\t<DropdownMenuItemHelpText>\n\t\t\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t\t\t</DropdownMenuItemHelpText>\n\t\t\t\t\t\t\t</DropdownMenuRadioItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</DropdownMenuGroup>\n\t\t\t\t\t{ i !== Object.keys( fieldsList ).length - 1 && (\n\t\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t) }\n\t\t\t\t</Fragment>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction BlockBindingsAttribute( { attribute, binding } ) {\n\tconst { source: sourceName, args } = binding || {};\n\tconst sourceProps =\n\t\tunlock( blocksPrivateApis ).getBlockBindingsSource( sourceName );\n\treturn (\n\t\t<VStack>\n\t\t\t<Truncate>{ attribute }</Truncate>\n\t\t\t{ !! binding && (\n\t\t\t\t<Text\n\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\tclassName=\"block-editor-bindings__item-explanation\"\n\t\t\t\t>\n\t\t\t\t\t<Truncate>\n\t\t\t\t\t\t{ args?.key || sourceProps?.label || sourceName }\n\t\t\t\t\t</Truncate>\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction ReadOnlyBlockBindingsPanelItems( { bindings } ) {\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( bindings ).map( ( [ attribute, binding ] ) => (\n\t\t\t\t<Item key={ attribute }>\n\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t/>\n\t\t\t\t</Item>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction EditableBlockBindingsPanelItems( {\n\tattributes,\n\tbindings,\n\tfieldsList,\n\taddConnection,\n\tremoveConnection,\n} ) {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn (\n\t\t<>\n\t\t\t{ attributes.map( ( attribute ) => {\n\t\t\t\tconst binding = bindings[ attribute ];\n\t\t\t\treturn (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tkey={ attribute }\n\t\t\t\t\t\thasValue={ () => !! binding }\n\t\t\t\t\t\tlabel={ attribute }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tremoveConnection( attribute );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\tplacement={\n\t\t\t\t\t\t\t\tisMobile ? 'bottom-start' : 'left-start'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tgutter={ isMobile ? 8 : 36 }\n\t\t\t\t\t\t\tclassName=\"block-editor-bindings__popover\"\n\t\t\t\t\t\t\ttrigger={\n\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockBindingsPanelDropdown\n\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\taddConnection={ addConnection }\n\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nexport const BlockBindingsPanel = ( { name, metadata } ) => {\n\tconst registry = useRegistry();\n\tconst blockContext = useContext( BlockContext );\n\tconst { bindings } = metadata || {};\n\n\tconst bindableAttributes = getBindableAttributes( name );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst filteredBindings = { ...bindings };\n\tObject.keys( filteredBindings ).forEach( ( key ) => {\n\t\tif (\n\t\t\t! canBindAttribute( name, key ) ||\n\t\t\tfilteredBindings[ key ].source === 'core/pattern-overrides'\n\t\t) {\n\t\t\tdelete filteredBindings[ key ];\n\t\t}\n\t} );\n\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tconst { _id } = useSelect( ( select ) => {\n\t\tconst { getSelectedBlockClientId } = select( blockEditorStore );\n\n\t\treturn {\n\t\t\t_id: getSelectedBlockClientId(),\n\t\t};\n\t}, [] );\n\n\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst removeAllConnections = () => {\n\t\tconst newMetadata = { ...metadata };\n\t\tdelete newMetadata.bindings;\n\t\tupdateBlockAttributes( _id, {\n\t\t\tmetadata:\n\t\t\t\tObject.keys( newMetadata ).length === 0\n\t\t\t\t\t? undefined\n\t\t\t\t\t: newMetadata,\n\t\t} );\n\t};\n\n\tconst addConnection = ( value, attribute ) => {\n\t\t// Assuming the block expects a flat structure for its metadata attribute\n\t\tconst newMetadata = {\n\t\t\t...metadata,\n\t\t\t// Adjust this according to the actual structure expected by your block\n\t\t\tbindings: {\n\t\t\t\t...metadata?.bindings,\n\t\t\t\t[ attribute ]: {\n\t\t\t\t\tsource: 'core/post-meta',\n\t\t\t\t\targs: { key: value },\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t\t// Update the block's attributes with the new metadata\n\t\tupdateBlockAttributes( _id, {\n\t\t\tmetadata: newMetadata,\n\t\t} );\n\t};\n\n\tconst removeConnection = ( key ) => {\n\t\tconst newMetadata = { ...metadata };\n\t\tif ( ! newMetadata.bindings ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdelete newMetadata.bindings[ key ];\n\t\tif ( Object.keys( newMetadata.bindings ).length === 0 ) {\n\t\t\tdelete newMetadata.bindings;\n\t\t}\n\t\tupdateBlockAttributes( _id, {\n\t\t\tmetadata:\n\t\t\t\tObject.keys( newMetadata ).length === 0\n\t\t\t\t\t? undefined\n\t\t\t\t\t: newMetadata,\n\t\t} );\n\t};\n\n\tconst fieldsList = {};\n\tconst { getBlockBindingsSources } = unlock( blocksPrivateApis );\n\tconst registeredSources = getBlockBindingsSources();\n\tObject.values( registeredSources ).forEach(\n\t\t( { getFieldsList, label, usesContext } ) => {\n\t\t\tif ( getFieldsList ) {\n\t\t\t\t// Populate context.\n\t\t\t\tconst context = {};\n\t\t\t\tif ( usesContext?.length ) {\n\t\t\t\t\tfor ( const key of usesContext ) {\n\t\t\t\t\t\tcontext[ key ] = blockContext[ key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst sourceList = getFieldsList( {\n\t\t\t\t\tregistry,\n\t\t\t\t\tcontext,\n\t\t\t\t} );\n\t\t\t\t// Only add source if the list is not empty.\n\t\t\t\tif ( sourceList ) {\n\t\t\t\t\tfieldsList[ label ] = { ...sourceList };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t// Remove empty sources.\n\tObject.entries( fieldsList ).forEach( ( [ key, value ] ) => {\n\t\tif ( ! Object.keys( value ).length ) {\n\t\t\tdelete fieldsList[ key ];\n\t\t}\n\t} );\n\n\t// Lock the UI when the experiment is not enabled or there are no fields to connect to.\n\tconst readOnly =\n\t\t! window.__experimentalBlockBindingsUI ||\n\t\t! Object.keys( fieldsList ).length;\n\n\tif ( readOnly && Object.keys( filteredBindings ).length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Attributes' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tremoveAllConnections();\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\tclassName=\"block-editor-bindings__panel\"\n\t\t\t>\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ readOnly ? (\n\t\t\t\t\t\t<ReadOnlyBlockBindingsPanelItems\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EditableBlockBindingsPanelItems\n\t\t\t\t\t\t\tattributes={ bindableAttributes }\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\taddConnection={ addConnection }\n\t\t\t\t\t\t\tremoveConnection={ removeConnection }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ItemGroup>\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Attributes connected to various sources.' ) }\n\t\t\t\t</Text>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n};\n\nexport default {\n\tedit: BlockBindingsPanel,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,kBAAkB,IAAIC,IAAI,EAC1BC,kBAAkB,IAAIC,IAAI,EAC1BC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,sBAAsB,IAAIC,QAAQ,EAClCC,oBAAoB,IAAIC,MAAM,EAC9Bf,WAAW,IAAIgB,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,SAAS,EAA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CACI;EAAC,CACK,CAAC;AAEtB,CAAC;AAED,eAAe;EACduH,IAAI,EAAE5B,kBAAkB;EACxB6B,aAAa,EAAE,CAAE,UAAU,CAAE;EAC7BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","privateApis","blocksPrivateApis","__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalText","Text","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalTruncate","Truncate","__experimentalVStack","VStack","componentsPrivateApis","useRegistry","useContext","Fragment","useViewportMatch","canBindAttribute","getBindableAttributes","unlock","InspectorControls","BlockContext","useBlockBindingsUtils","jsx","_jsx","jsxs","_jsxs","_Fragment","DropdownMenuV2","DropdownMenu","DropdownMenuGroupV2","DropdownMenuGroup","DropdownMenuRadioItemV2","DropdownMenuRadioItem","DropdownMenuItemLabelV2","DropdownMenuItemLabel","DropdownMenuItemHelpTextV2","DropdownMenuItemHelpText","DropdownMenuSeparatorV2","DropdownMenuSeparator","useToolsPanelDropdownMenuProps","isMobile","popoverProps","placement","offset","BlockBindingsPanelDropdown","fieldsList","attribute","binding","getBlockBindingsSources","registeredSources","updateBlockBindings","currentKey","args","key","children","Object","entries","map","name","fields","i","keys","length","className","upperCase","variant","label","value","onChange","source","checked","BlockBindingsAttribute","sourceName","sourceProps","getBlockBindingsSource","ReadOnlyBlockBindingsPanelItems","bindings","EditableBlockBindingsPanelItems","attributes","hasValue","onDeselect","undefined","gutter","trigger","BlockBindingsPanel","blockName","metadata","registry","blockContext","removeAllBlockBindings","bindableAttributes","dropdownMenuProps","filteredBindings","forEach","getFieldsList","usesContext","context","sourceList","readOnly","window","__experimentalBlockBindingsUI","resetAll","isBordered","isSeparated","edit","attributeKeys","hasSupport"],"sources":["@wordpress/block-editor/src/hooks/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as blocksPrivateApis } from '@wordpress/blocks';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalText as Text,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalTruncate as Truncate,\n\t__experimentalVStack as VStack,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useRegistry } from '@wordpress/data';\nimport { useContext, Fragment } from '@wordpress/element';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tcanBindAttribute,\n\tgetBindableAttributes,\n} from '../hooks/use-bindings-attributes';\nimport { unlock } from '../lock-unlock';\nimport InspectorControls from '../components/inspector-controls';\nimport BlockContext from '../components/block-context';\nimport { useBlockBindingsUtils } from '../utils/block-bindings';\n\nconst {\n\tDropdownMenuV2: DropdownMenu,\n\tDropdownMenuGroupV2: DropdownMenuGroup,\n\tDropdownMenuRadioItemV2: DropdownMenuRadioItem,\n\tDropdownMenuItemLabelV2: DropdownMenuItemLabel,\n\tDropdownMenuItemHelpTextV2: DropdownMenuItemHelpText,\n\tDropdownMenuSeparatorV2: DropdownMenuSeparator,\n} = unlock( componentsPrivateApis );\n\nconst useToolsPanelDropdownMenuProps = () => {\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn ! isMobile\n\t\t? {\n\t\t\t\tpopoverProps: {\n\t\t\t\t\tplacement: 'left-start',\n\t\t\t\t\t// For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px)\n\t\t\t\t\toffset: 259,\n\t\t\t\t},\n\t\t }\n\t\t: {};\n};\n\nfunction BlockBindingsPanelDropdown( { fieldsList, attribute, binding } ) {\n\tconst { getBlockBindingsSources } = unlock( blocksPrivateApis );\n\tconst registeredSources = getBlockBindingsSources();\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst currentKey = binding?.args?.key;\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( fieldsList ).map( ( [ name, fields ], i ) => (\n\t\t\t\t<Fragment key={ name }>\n\t\t\t\t\t<DropdownMenuGroup>\n\t\t\t\t\t\t{ Object.keys( fieldsList ).length > 1 && (\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tclassName=\"block-editor-bindings__source-label\"\n\t\t\t\t\t\t\t\tupperCase\n\t\t\t\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ registeredSources[ name ].label }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ Object.entries( fields ).map( ( [ key, value ] ) => (\n\t\t\t\t\t\t\t<DropdownMenuRadioItem\n\t\t\t\t\t\t\t\tkey={ key }\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t\t\t[ attribute ]: {\n\t\t\t\t\t\t\t\t\t\t\tsource: name,\n\t\t\t\t\t\t\t\t\t\t\targs: { key },\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tname={ attribute + '-binding' }\n\t\t\t\t\t\t\t\tvalue={ key }\n\t\t\t\t\t\t\t\tchecked={ key === currentKey }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DropdownMenuItemLabel>\n\t\t\t\t\t\t\t\t\t{ key }\n\t\t\t\t\t\t\t\t</DropdownMenuItemLabel>\n\t\t\t\t\t\t\t\t<DropdownMenuItemHelpText>\n\t\t\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t\t\t</DropdownMenuItemHelpText>\n\t\t\t\t\t\t\t</DropdownMenuRadioItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</DropdownMenuGroup>\n\t\t\t\t\t{ i !== Object.keys( fieldsList ).length - 1 && (\n\t\t\t\t\t\t<DropdownMenuSeparator />\n\t\t\t\t\t) }\n\t\t\t\t</Fragment>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction BlockBindingsAttribute( { attribute, binding } ) {\n\tconst { source: sourceName, args } = binding || {};\n\tconst sourceProps =\n\t\tunlock( blocksPrivateApis ).getBlockBindingsSource( sourceName );\n\treturn (\n\t\t<VStack>\n\t\t\t<Truncate>{ attribute }</Truncate>\n\t\t\t{ !! binding && (\n\t\t\t\t<Text\n\t\t\t\t\tvariant=\"muted\"\n\t\t\t\t\tclassName=\"block-editor-bindings__item-explanation\"\n\t\t\t\t>\n\t\t\t\t\t<Truncate>\n\t\t\t\t\t\t{ args?.key || sourceProps?.label || sourceName }\n\t\t\t\t\t</Truncate>\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nfunction ReadOnlyBlockBindingsPanelItems( { bindings } ) {\n\treturn (\n\t\t<>\n\t\t\t{ Object.entries( bindings ).map( ( [ attribute, binding ] ) => (\n\t\t\t\t<Item key={ attribute }>\n\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t/>\n\t\t\t\t</Item>\n\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction EditableBlockBindingsPanelItems( {\n\tattributes,\n\tbindings,\n\tfieldsList,\n} ) {\n\tconst { updateBlockBindings } = useBlockBindingsUtils();\n\tconst isMobile = useViewportMatch( 'medium', '<' );\n\treturn (\n\t\t<>\n\t\t\t{ attributes.map( ( attribute ) => {\n\t\t\t\tconst binding = bindings[ attribute ];\n\t\t\t\treturn (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tkey={ attribute }\n\t\t\t\t\t\thasValue={ () => !! binding }\n\t\t\t\t\t\tlabel={ attribute }\n\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\tupdateBlockBindings( {\n\t\t\t\t\t\t\t\t[ attribute ]: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\tplacement={\n\t\t\t\t\t\t\t\tisMobile ? 'bottom-start' : 'left-start'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tgutter={ isMobile ? 8 : 36 }\n\t\t\t\t\t\t\tclassName=\"block-editor-bindings__popover\"\n\t\t\t\t\t\t\ttrigger={\n\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t<BlockBindingsAttribute\n\t\t\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockBindingsPanelDropdown\n\t\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t\t\tattribute={ attribute }\n\t\t\t\t\t\t\t\tbinding={ binding }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n\nexport const BlockBindingsPanel = ( { name: blockName, metadata } ) => {\n\tconst registry = useRegistry();\n\tconst blockContext = useContext( BlockContext );\n\tconst { bindings } = metadata || {};\n\tconst { removeAllBlockBindings } = useBlockBindingsUtils();\n\tconst bindableAttributes = getBindableAttributes( blockName );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst filteredBindings = { ...bindings };\n\tObject.keys( filteredBindings ).forEach( ( key ) => {\n\t\tif (\n\t\t\t! canBindAttribute( blockName, key ) ||\n\t\t\tfilteredBindings[ key ].source === 'core/pattern-overrides'\n\t\t) {\n\t\t\tdelete filteredBindings[ key ];\n\t\t}\n\t} );\n\n\tif ( ! bindableAttributes || bindableAttributes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst fieldsList = {};\n\tconst { getBlockBindingsSources } = unlock( blocksPrivateApis );\n\tconst registeredSources = getBlockBindingsSources();\n\tObject.entries( registeredSources ).forEach(\n\t\t( [ sourceName, { getFieldsList, usesContext } ] ) => {\n\t\t\tif ( getFieldsList ) {\n\t\t\t\t// Populate context.\n\t\t\t\tconst context = {};\n\t\t\t\tif ( usesContext?.length ) {\n\t\t\t\t\tfor ( const key of usesContext ) {\n\t\t\t\t\t\tcontext[ key ] = blockContext[ key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst sourceList = getFieldsList( {\n\t\t\t\t\tregistry,\n\t\t\t\t\tcontext,\n\t\t\t\t} );\n\t\t\t\t// Only add source if the list is not empty.\n\t\t\t\tif ( sourceList ) {\n\t\t\t\t\tfieldsList[ sourceName ] = { ...sourceList };\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\t// Remove empty sources.\n\tObject.entries( fieldsList ).forEach( ( [ key, value ] ) => {\n\t\tif ( ! Object.keys( value ).length ) {\n\t\t\tdelete fieldsList[ key ];\n\t\t}\n\t} );\n\n\t// Lock the UI when the experiment is not enabled or there are no fields to connect to.\n\tconst readOnly =\n\t\t! window.__experimentalBlockBindingsUI ||\n\t\t! Object.keys( fieldsList ).length;\n\n\tif ( readOnly && Object.keys( filteredBindings ).length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Attributes' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tremoveAllBlockBindings();\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\tclassName=\"block-editor-bindings__panel\"\n\t\t\t>\n\t\t\t\t<ItemGroup isBordered isSeparated>\n\t\t\t\t\t{ readOnly ? (\n\t\t\t\t\t\t<ReadOnlyBlockBindingsPanelItems\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<EditableBlockBindingsPanelItems\n\t\t\t\t\t\t\tattributes={ bindableAttributes }\n\t\t\t\t\t\t\tbindings={ filteredBindings }\n\t\t\t\t\t\t\tfieldsList={ fieldsList }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ItemGroup>\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Attributes connected to various sources.' ) }\n\t\t\t\t</Text>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n};\n\nexport default {\n\tedit: BlockBindingsPanel,\n\tattributeKeys: [ 'metadata' ],\n\thasSupport() {\n\t\treturn true;\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SACCC,uBAAuB,IAAIC,SAAS,EACpCC,kBAAkB,IAAIC,IAAI,EAC1BC,kBAAkB,IAAIC,IAAI,EAC1BC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,sBAAsB,IAAIC,QAAQ,EAClCC,oBAAoB,IAAIC,MAAM,EAC9Bf,WAAW,IAAIgB,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,EAAEC,QAAQ,QAAQ,oBAAoB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,SACCC,gBAAgB,EAChBC,qBAAqB,QACf,kCAAkC;AACzC,SAASC,MAAM,QAAQ,gBAAgB;AACvC,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,YAAY,MAAM,6BAA6B;AACtD,SAASC,qBAAqB,QAAQ,yBAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,K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H;EACA,MAAM6C,QAAQ,GACb,CAAEC,MAAM,CAACC,6BAA6B,IACtC,CAAE7C,MAAM,CAACM,IAAI,CAAEhB,UAAW,CAAC,CAACiB,MAAM;EAEnC,IAAKoC,QAAQ,IAAI3C,MAAM,CAACM,IAAI,CAAE+B,gBAAiB,CAAC,CAAC9B,MAAM,KAAK,CAAC,EAAG;IAC/D,OAAO,IAAI;EACZ;EAEA,oBACCvC,IAAA,CAACJ,iBAAiB;IAAAmC,QAAA,eACjB7B,KAAA,CAACrB,UAAU;MACV8D,KAAK,EAAGxE,EAAE,CAAE,YAAa,CAAG;MAC5B2G,QAAQ,EAAGA,CAAA,KAAM;QAChBZ,sBAAsB,CAAC,CAAC;MACzB,CAAG;MACHE,iBAAiB,EAAGA,iBAAmB;MACvC5B,SAAS,EAAC,8BAA8B;MAAAT,QAAA,gBAExC/B,IAAA,CAACzB,SAAS;QAACwG,UAAU;QAACC,WAAW;QAAAjD,QAAA,EAC9B4C,QAAQ,gBACT3E,IAAA,CAACoD,+BAA+B;UAC/BC,QAAQ,EAAGgB;QAAkB,CAC7B,CAAC,gBAEFrE,IAAA,CAACsD,+BAA+B;UAC/BC,UAAU,EAAGY,kBAAoB;UACjCd,QAAQ,EAAGgB,gBAAkB;UAC7B/C,UAAU,EAAGA;QAAY,CACzB;MACD,CACS,CAAC,eACZtB,IAAA,CAACrB,IAAI;QAAC+D,OAAO,EAAC,OAAO;QAAAX,QAAA,EAClB5D,EAAE,CAAE,0CAA2C;MAAC,CAC7C,CAAC;IAAA,CACI;EAAC,CACK,CAAC;AAEtB,CAAC;AAED,eAAe;EACd8G,IAAI,EAAEpB,kBAAkB;EACxBqB,aAAa,EAAE,CAAE,UAAU,CAAE;EAC7BC,UAAUA,CAAA,EAAG;IACZ,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
|
|
@@ -106,6 +106,7 @@ export default {
|
|
|
106
106
|
children: __('Customize the width for all elements that are assigned to the center or wide columns.')
|
|
107
107
|
})]
|
|
108
108
|
}), allowJustification && /*#__PURE__*/_jsx(ToggleGroupControl, {
|
|
109
|
+
__next40pxDefaultSize: true,
|
|
109
110
|
__nextHasNoMarginBottom: true,
|
|
110
111
|
label: __('Justification'),
|
|
111
112
|
value: justifyContent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOptionIcon","ToggleGroupControlOptionIcon","__","Icon","positionCenter","stretchWide","justifyLeft","justifyCenter","justifyRight","getCSSRules","useSettings","appendSelectors","getBlockGapCSS","getAlignmentsInfo","getGapCSSValue","BlockControls","JustifyContentControl","shouldSkipSerialization","LAYOUT_DEFINITIONS","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","name","label","inspectorControls","DefaultLayoutInspectorControls","layout","onChange","layoutBlockSupport","wideSize","contentSize","justifyContent","allowJustification","allowCustomContentAndWideSize","onJustificationChange","value","justificationOptions","icon","availableUnits","units","children","className","labelPosition","__unstableInputWidth","nextWidth","parseFloat","__nextHasNoMarginBottom","map","toolBarControls","DefaultLayoutToolbarControls","group","__experimentalShareWithChildBlocks","DefaultLayoutJustifyContentControl","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","blockGapStyleValue","spacing","blockGap","blockGapValue","top","marginLeft","marginRight","output","padding","paddingValues","forEach","rule","key","paddingRightValue","paddingLeftValue","getOrientation","getAlignments","alignmentInfo","alignments","undefined","includes","unshift","alignment","info","wide","none","POPOVER_PROPS","placement","allowedControls","popoverProps"],"sources":["@wordpress/block-editor/src/layouts/constrained.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tIcon,\n\tpositionCenter,\n\tstretchWide,\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n} from '@wordpress/icons';\nimport { getCSSRules } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../components/use-settings';\nimport { appendSelectors, getBlockGapCSS, getAlignmentsInfo } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { BlockControls, JustifyContentControl } from '../components';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\nexport default {\n\tname: 'constrained',\n\tlabel: __( 'Constrained' ),\n\tinspectorControls: function DefaultLayoutInspectorControls( {\n\t\tlayout,\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { wideSize, contentSize, justifyContent = 'center' } = layout;\n\t\tconst {\n\t\t\tallowJustification = true,\n\t\t\tallowCustomContentAndWideSize = true,\n\t\t} = layoutBlockSupport;\n\t\tconst onJustificationChange = ( value ) => {\n\t\t\tonChange( {\n\t\t\t\t...layout,\n\t\t\t\tjustifyContent: value,\n\t\t\t} );\n\t\t};\n\t\tconst justificationOptions = [\n\t\t\t{\n\t\t\t\tvalue: 'left',\n\t\t\t\ticon: justifyLeft,\n\t\t\t\tlabel: __( 'Justify items left' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'center',\n\t\t\t\ticon: justifyCenter,\n\t\t\t\tlabel: __( 'Justify items center' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'right',\n\t\t\t\ticon: justifyRight,\n\t\t\t\tlabel: __( 'Justify items right' ),\n\t\t\t},\n\t\t];\n\t\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\t\tconst units = useCustomUnits( {\n\t\t\tavailableUnits: availableUnits || [ '%', 'px', 'em', 'rem', 'vw' ],\n\t\t} );\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ allowCustomContentAndWideSize && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls\">\n\t\t\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__layout-controls-unit-input\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Content' ) }\n\t\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\t\tvalue={ contentSize || wideSize || '' }\n\t\t\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\t\tcontentSize: nextWidth,\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\tunits={ units }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Icon icon={ positionCenter } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__layout-controls-unit-input\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Wide' ) }\n\t\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\t\tvalue={ wideSize || contentSize || '' }\n\t\t\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\t\twideSize: nextWidth,\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\tunits={ units }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<p className=\"block-editor-hooks__layout-controls-helptext\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Customize the width for all elements that are assigned to the center or wide columns.'\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) }\n\t\t\t\t{ allowJustification && (\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Justification' ) }\n\t\t\t\t\t\tvalue={ justifyContent }\n\t\t\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ justificationOptions.map(\n\t\t\t\t\t\t\t( { value, icon, label } ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function DefaultLayoutToolbarControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport,\n\t} ) {\n\t\tconst { allowJustification = true } = layoutBlockSupport;\n\n\t\tif ( ! allowJustification ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<DefaultLayoutJustifyContentControl\n\t\t\t\t\tlayout={ layout }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t);\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout = {},\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { contentSize, wideSize, justifyContent } = layout;\n\t\tconst blockGapStyleValue = getGapCSSValue( style?.spacing?.blockGap );\n\n\t\t// If a block's block.json skips serialization for spacing or\n\t\t// spacing.blockGap, don't apply the user-defined value to the styles.\n\t\tlet blockGapValue = '';\n\t\tif ( ! shouldSkipSerialization( blockName, 'spacing', 'blockGap' ) ) {\n\t\t\t// If an object is provided only use the 'top' value for this kind of gap.\n\t\t\tif ( blockGapStyleValue?.top ) {\n\t\t\t\tblockGapValue = getGapCSSValue( blockGapStyleValue?.top );\n\t\t\t} else if ( typeof blockGapStyleValue === 'string' ) {\n\t\t\t\tblockGapValue = getGapCSSValue( blockGapStyleValue );\n\t\t\t}\n\t\t}\n\n\t\tconst marginLeft =\n\t\t\tjustifyContent === 'left' ? '0 !important' : 'auto !important';\n\t\tconst marginRight =\n\t\t\tjustifyContent === 'right' ? '0 !important' : 'auto !important';\n\n\t\tlet output =\n\t\t\t!! contentSize || !! wideSize\n\t\t\t\t? `\n\t\t\t\t\t${ appendSelectors(\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t\t\t) } {\n\t\t\t\t\t\tmax-width: ${ contentSize ?? wideSize };\n\t\t\t\t\t\tmargin-left: ${ marginLeft };\n\t\t\t\t\t\tmargin-right: ${ marginRight };\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignwide' ) } {\n\t\t\t\t\t\tmax-width: ${ wideSize ?? contentSize };\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`\n\t\t\t\t: '';\n\n\t\tif ( justifyContent === 'left' ) {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t) }\n\t\t\t{ margin-left: ${ marginLeft }; }`;\n\t\t} else if ( justifyContent === 'right' ) {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t) }\n\t\t\t{ margin-right: ${ marginRight }; }`;\n\t\t}\n\n\t\t// If there is custom padding, add negative margins for alignfull blocks.\n\t\tif ( style?.spacing?.padding ) {\n\t\t\t// The style object might be storing a preset so we need to make sure we get a usable value.\n\t\t\tconst paddingValues = getCSSRules( style );\n\t\t\tpaddingValues.forEach( ( rule ) => {\n\t\t\t\tif ( rule.key === 'paddingRight' ) {\n\t\t\t\t\t// Add unit if 0, to avoid calc(0 * -1) which is invalid.\n\t\t\t\t\tconst paddingRightValue =\n\t\t\t\t\t\trule.value === '0' ? '0px' : rule.value;\n\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-right: calc(${ paddingRightValue } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t} else if ( rule.key === 'paddingLeft' ) {\n\t\t\t\t\t// Add unit if 0, to avoid calc(0 * -1) which is invalid.\n\t\t\t\t\tconst paddingLeftValue =\n\t\t\t\t\t\trule.value === '0' ? '0px' : rule.value;\n\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-left: calc(${ paddingLeftValue } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'constrained',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'vertical';\n\t},\n\tgetAlignments( layout ) {\n\t\tconst alignmentInfo = getAlignmentsInfo( layout );\n\t\tif ( layout.alignments !== undefined ) {\n\t\t\tif ( ! layout.alignments.includes( 'none' ) ) {\n\t\t\t\tlayout.alignments.unshift( 'none' );\n\t\t\t}\n\t\t\treturn layout.alignments.map( ( alignment ) => ( {\n\t\t\t\tname: alignment,\n\t\t\t\tinfo: alignmentInfo[ alignment ],\n\t\t\t} ) );\n\t\t}\n\t\tconst { contentSize, wideSize } = layout;\n\n\t\tconst alignments = [\n\t\t\t{ name: 'left' },\n\t\t\t{ name: 'center' },\n\t\t\t{ name: 'right' },\n\t\t];\n\n\t\tif ( contentSize ) {\n\t\t\talignments.unshift( { name: 'full' } );\n\t\t}\n\n\t\tif ( wideSize ) {\n\t\t\talignments.unshift( { name: 'wide', info: alignmentInfo.wide } );\n\t\t}\n\n\t\talignments.unshift( { name: 'none', info: alignmentInfo.none } );\n\n\t\treturn alignments;\n\t},\n};\n\nconst POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\nfunction DefaultLayoutJustifyContentControl( { layout, onChange } ) {\n\tconst { justifyContent = 'center' } = layout;\n\tconst onJustificationChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tjustifyContent: value,\n\t\t} );\n\t};\n\tconst allowedControls = [ 'left', 'center', 'right' ];\n\n\treturn (\n\t\t<JustifyContentControl\n\t\t\tallowedControls={ allowedControls }\n\t\t\tvalue={ justifyContent }\n\t\t\tonChange={ onJustificationChange }\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,4BAA4B,IAAIC,cAAc,EAC9CC,yBAAyB,IAAIC,WAAW,EACxCC,gCAAgC,IAAIC,kBAAkB,EACtDC,0CAA0C,IAAIC,4BAA4B,QACpE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,IAAI,EACJC,cAAc,EACdC,WAAW,EACXC,WAAW,EACXC,aAAa,EACbC,YAAY,QACN,kBAAkB;AACzB,SAASC,WAAW,QAAQ,yBAAyB;;AAErD;AACA;AACA;AACA,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,eAAe,EAAEC,cAAc,EAAEC,iBAAiB,QAAQ,SAAS;AAC5E,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,aAAa,EAAEC,qBAAqB,QAAQ,eAAe;AACpE,SAASC,uBAAuB,QAAQ,gBAAgB;AACxD,SAASC,kBAAkB,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAEnD,eAAe;EACdC,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAExB,EAAE,CAAE,aAAc,CAAC;EAC1ByB,iBAAiB,EAAE,SAASC,8BAA8BA,CAAE;IAC3DC,MAAM;IACNC,QAAQ;IACRC,kBAAkB,GAAG,CAAC;EACvB,CAAC,EAAG;IACH,MAAM;MAAEC,QAAQ;MAAEC,WAAW;MAAEC,cAAc,GAAG;IAAS,CAAC,GAAGL,MAAM;IACnE,MAAM;MACLM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UnitControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOptionIcon","ToggleGroupControlOptionIcon","__","Icon","positionCenter","stretchWide","justifyLeft","justifyCenter","justifyRight","getCSSRules","useSettings","appendSelectors","getBlockGapCSS","getAlignmentsInfo","getGapCSSValue","BlockControls","JustifyContentControl","shouldSkipSerialization","LAYOUT_DEFINITIONS","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","name","label","inspectorControls","DefaultLayoutInspectorControls","layout","onChange","layoutBlockSupport","wideSize","contentSize","justifyContent","allowJustification","allowCustomContentAndWideSize","onJustificationChange","value","justificationOptions","icon","availableUnits","units","children","className","labelPosition","__unstableInputWidth","nextWidth","parseFloat","__next40pxDefaultSize","__nextHasNoMarginBottom","map","toolBarControls","DefaultLayoutToolbarControls","group","__experimentalShareWithChildBlocks","DefaultLayoutJustifyContentControl","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","blockGapStyleValue","spacing","blockGap","blockGapValue","top","marginLeft","marginRight","output","padding","paddingValues","forEach","rule","key","paddingRightValue","paddingLeftValue","getOrientation","getAlignments","alignmentInfo","alignments","undefined","includes","unshift","alignment","info","wide","none","POPOVER_PROPS","placement","allowedControls","popoverProps"],"sources":["@wordpress/block-editor/src/layouts/constrained.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tIcon,\n\tpositionCenter,\n\tstretchWide,\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n} from '@wordpress/icons';\nimport { getCSSRules } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../components/use-settings';\nimport { appendSelectors, getBlockGapCSS, getAlignmentsInfo } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { BlockControls, JustifyContentControl } from '../components';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\nexport default {\n\tname: 'constrained',\n\tlabel: __( 'Constrained' ),\n\tinspectorControls: function DefaultLayoutInspectorControls( {\n\t\tlayout,\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { wideSize, contentSize, justifyContent = 'center' } = layout;\n\t\tconst {\n\t\t\tallowJustification = true,\n\t\t\tallowCustomContentAndWideSize = true,\n\t\t} = layoutBlockSupport;\n\t\tconst onJustificationChange = ( value ) => {\n\t\t\tonChange( {\n\t\t\t\t...layout,\n\t\t\t\tjustifyContent: value,\n\t\t\t} );\n\t\t};\n\t\tconst justificationOptions = [\n\t\t\t{\n\t\t\t\tvalue: 'left',\n\t\t\t\ticon: justifyLeft,\n\t\t\t\tlabel: __( 'Justify items left' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'center',\n\t\t\t\ticon: justifyCenter,\n\t\t\t\tlabel: __( 'Justify items center' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'right',\n\t\t\t\ticon: justifyRight,\n\t\t\t\tlabel: __( 'Justify items right' ),\n\t\t\t},\n\t\t];\n\t\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\t\tconst units = useCustomUnits( {\n\t\t\tavailableUnits: availableUnits || [ '%', 'px', 'em', 'rem', 'vw' ],\n\t\t} );\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ allowCustomContentAndWideSize && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls\">\n\t\t\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__layout-controls-unit-input\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Content' ) }\n\t\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\t\tvalue={ contentSize || wideSize || '' }\n\t\t\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\t\tcontentSize: nextWidth,\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\tunits={ units }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Icon icon={ positionCenter } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__layout-controls-unit-input\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Wide' ) }\n\t\t\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\t\t\tvalue={ wideSize || contentSize || '' }\n\t\t\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\t\t\twideSize: nextWidth,\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\tunits={ units }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<p className=\"block-editor-hooks__layout-controls-helptext\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Customize the width for all elements that are assigned to the center or wide columns.'\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) }\n\t\t\t\t{ allowJustification && (\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Justification' ) }\n\t\t\t\t\t\tvalue={ justifyContent }\n\t\t\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ justificationOptions.map(\n\t\t\t\t\t\t\t( { value, icon, label } ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function DefaultLayoutToolbarControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport,\n\t} ) {\n\t\tconst { allowJustification = true } = layoutBlockSupport;\n\n\t\tif ( ! allowJustification ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn (\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<DefaultLayoutJustifyContentControl\n\t\t\t\t\tlayout={ layout }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t);\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout = {},\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { contentSize, wideSize, justifyContent } = layout;\n\t\tconst blockGapStyleValue = getGapCSSValue( style?.spacing?.blockGap );\n\n\t\t// If a block's block.json skips serialization for spacing or\n\t\t// spacing.blockGap, don't apply the user-defined value to the styles.\n\t\tlet blockGapValue = '';\n\t\tif ( ! shouldSkipSerialization( blockName, 'spacing', 'blockGap' ) ) {\n\t\t\t// If an object is provided only use the 'top' value for this kind of gap.\n\t\t\tif ( blockGapStyleValue?.top ) {\n\t\t\t\tblockGapValue = getGapCSSValue( blockGapStyleValue?.top );\n\t\t\t} else if ( typeof blockGapStyleValue === 'string' ) {\n\t\t\t\tblockGapValue = getGapCSSValue( blockGapStyleValue );\n\t\t\t}\n\t\t}\n\n\t\tconst marginLeft =\n\t\t\tjustifyContent === 'left' ? '0 !important' : 'auto !important';\n\t\tconst marginRight =\n\t\t\tjustifyContent === 'right' ? '0 !important' : 'auto !important';\n\n\t\tlet output =\n\t\t\t!! contentSize || !! wideSize\n\t\t\t\t? `\n\t\t\t\t\t${ appendSelectors(\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t\t\t) } {\n\t\t\t\t\t\tmax-width: ${ contentSize ?? wideSize };\n\t\t\t\t\t\tmargin-left: ${ marginLeft };\n\t\t\t\t\t\tmargin-right: ${ marginRight };\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignwide' ) } {\n\t\t\t\t\t\tmax-width: ${ wideSize ?? contentSize };\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`\n\t\t\t\t: '';\n\n\t\tif ( justifyContent === 'left' ) {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t) }\n\t\t\t{ margin-left: ${ marginLeft }; }`;\n\t\t} else if ( justifyContent === 'right' ) {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t) }\n\t\t\t{ margin-right: ${ marginRight }; }`;\n\t\t}\n\n\t\t// If there is custom padding, add negative margins for alignfull blocks.\n\t\tif ( style?.spacing?.padding ) {\n\t\t\t// The style object might be storing a preset so we need to make sure we get a usable value.\n\t\t\tconst paddingValues = getCSSRules( style );\n\t\t\tpaddingValues.forEach( ( rule ) => {\n\t\t\t\tif ( rule.key === 'paddingRight' ) {\n\t\t\t\t\t// Add unit if 0, to avoid calc(0 * -1) which is invalid.\n\t\t\t\t\tconst paddingRightValue =\n\t\t\t\t\t\trule.value === '0' ? '0px' : rule.value;\n\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-right: calc(${ paddingRightValue } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t} else if ( rule.key === 'paddingLeft' ) {\n\t\t\t\t\t// Add unit if 0, to avoid calc(0 * -1) which is invalid.\n\t\t\t\t\tconst paddingLeftValue =\n\t\t\t\t\t\trule.value === '0' ? '0px' : rule.value;\n\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-left: calc(${ paddingLeftValue } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'constrained',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'vertical';\n\t},\n\tgetAlignments( layout ) {\n\t\tconst alignmentInfo = getAlignmentsInfo( layout );\n\t\tif ( layout.alignments !== undefined ) {\n\t\t\tif ( ! layout.alignments.includes( 'none' ) ) {\n\t\t\t\tlayout.alignments.unshift( 'none' );\n\t\t\t}\n\t\t\treturn layout.alignments.map( ( alignment ) => ( {\n\t\t\t\tname: alignment,\n\t\t\t\tinfo: alignmentInfo[ alignment ],\n\t\t\t} ) );\n\t\t}\n\t\tconst { contentSize, wideSize } = layout;\n\n\t\tconst alignments = [\n\t\t\t{ name: 'left' },\n\t\t\t{ name: 'center' },\n\t\t\t{ name: 'right' },\n\t\t];\n\n\t\tif ( contentSize ) {\n\t\t\talignments.unshift( { name: 'full' } );\n\t\t}\n\n\t\tif ( wideSize ) {\n\t\t\talignments.unshift( { name: 'wide', info: alignmentInfo.wide } );\n\t\t}\n\n\t\talignments.unshift( { name: 'none', info: alignmentInfo.none } );\n\n\t\treturn alignments;\n\t},\n};\n\nconst POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\nfunction DefaultLayoutJustifyContentControl( { layout, onChange } ) {\n\tconst { justifyContent = 'center' } = layout;\n\tconst onJustificationChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tjustifyContent: value,\n\t\t} );\n\t};\n\tconst allowedControls = [ 'left', 'center', 'right' ];\n\n\treturn (\n\t\t<JustifyContentControl\n\t\t\tallowedControls={ allowedControls }\n\t\t\tvalue={ justifyContent }\n\t\t\tonChange={ onJustificationChange }\n\t\t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AQ,CAAC,CACjB;IAED,IAAKQ,WAAW,EAAG;MAClBgD,UAAU,CAACG,OAAO,CAAE;QAAE3D,IAAI,EAAE;MAAO,CAAE,CAAC;IACvC;IAEA,IAAKO,QAAQ,EAAG;MACfiD,UAAU,CAACG,OAAO,CAAE;QAAE3D,IAAI,EAAE,MAAM;QAAE6D,IAAI,EAAEN,aAAa,CAACO;MAAK,CAAE,CAAC;IACjE;IAEAN,UAAU,CAACG,OAAO,CAAE;MAAE3D,IAAI,EAAE,MAAM;MAAE6D,IAAI,EAAEN,aAAa,CAACQ;IAAK,CAAE,CAAC;IAEhE,OAAOP,UAAU;EAClB;AACD,CAAC;AAED,MAAMQ,aAAa,GAAG;EACrBC,SAAS,EAAE;AACZ,CAAC;AAED,SAASlC,kCAAkCA,CAAE;EAAE3B,MAAM;EAAEC;AAAS,CAAC,EAAG;EACnE,MAAM;IAAEI,cAAc,GAAG;EAAS,CAAC,GAAGL,MAAM;EAC5C,MAAMQ,qBAAqB,GAAKC,KAAK,IAAM;IAC1CR,QAAQ,CAAE;MACT,GAAGD,MAAM;MACTK,cAAc,EAAEI;IACjB,CAAE,CAAC;EACJ,CAAC;EACD,MAAMqD,eAAe,GAAG,CAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAE;EAErD,oBACCvE,IAAA,CAACJ,qBAAqB;IACrB2E,eAAe,EAAGA,eAAiB;IACnCrD,KAAK,EAAGJ,cAAgB;IACxBJ,QAAQ,EAAGO,qBAAuB;IAClCuD,YAAY,EAAGH;EAAe,CAC9B,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -265,6 +265,7 @@ function FlexLayoutJustifyContentControl({
|
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
return /*#__PURE__*/_jsx(ToggleGroupControl, {
|
|
268
|
+
__next40pxDefaultSize: true,
|
|
268
269
|
__nextHasNoMarginBottom: true,
|
|
269
270
|
label: __('Justification'),
|
|
270
271
|
value: justifyContent,
|
|
@@ -312,6 +313,7 @@ function OrientationControl({
|
|
|
312
313
|
justifyContent
|
|
313
314
|
} = layout;
|
|
314
315
|
return /*#__PURE__*/_jsxs(ToggleGroupControl, {
|
|
316
|
+
__next40pxDefaultSize: true,
|
|
315
317
|
__nextHasNoMarginBottom: true,
|
|
316
318
|
className: "block-editor-hooks__flex-layout-orientation-controls",
|
|
317
319
|
label: __('Orientation'),
|