@wordpress/block-editor 12.19.7 → 12.19.9
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/build/components/block-patterns-paging/index.js +8 -4
- package/build/components/block-patterns-paging/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js +2 -1
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +5 -0
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/recursion-provider/index.js +2 -2
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +50 -36
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/hooks/layout.js +11 -4
- package/build/hooks/layout.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +8 -4
- package/build-module/components/block-patterns-paging/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js +2 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +5 -0
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/recursion-provider/index.js +2 -2
- package/build-module/components/recursion-provider/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +50 -36
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/hooks/layout.js +11 -4
- package/build-module/hooks/layout.js.map +1 -1
- package/package.json +5 -5
- package/src/components/block-patterns-paging/index.js +4 -0
- package/src/components/inserter/block-patterns-explorer/index.js +1 -0
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +7 -1
- package/src/components/list-view/use-list-view-drop-zone.js +5 -0
- package/src/components/recursion-provider/index.js +2 -2
- package/src/components/url-popover/image-url-input-ui.js +68 -51
- package/src/hooks/layout.js +20 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","createHigherOrderComponent","useInstanceId","addFilter","getBlockSupport","hasBlockSupport","useSelect","Button","ButtonGroup","ToggleControl","PanelBody","privateApis","componentsPrivateApis","__","store","blockEditorStore","InspectorControls","useSettings","getLayoutType","getLayoutTypes","useBlockEditingMode","LAYOUT_DEFINITIONS","useBlockSettings","useStyleOverride","unlock","layoutBlockSupportKey","hasLayoutBlockSupport","blockName","useLayoutClasses","blockAttributes","kebabCase","rootPaddingAlignment","select","getSettings","__experimentalFeatures","useRootPaddingAwareAlignments","layout","default","defaultBlockLayout","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","className","baseClassName","splitBlockName","split","fullBlockName","pop","join","compoundClassName","push","orientation","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","blockGapSupport","hasBlockGapSupport","css","getLayoutStyle","LayoutPanelPure","setAttributes","name","settings","layoutSettings","defaultThemeLayout","themeSupportsLayout","supportsLayout","blockEditingMode","layoutBlockSupport","blockSupportAndThemeSettings","allowSwitching","allowEditing","allowInheriting","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","createElement","Fragment","title","__nextHasNoMarginBottom","label","checked","onChange","help","LayoutTypeSwitcher","inspectorControls","toolBarControls","shareWithChildBlocks","edit","attributeKeys","hasSupport","map","key","isPressed","onClick","addAttribute","_settings$attributes$","attributes","BlockWithLayoutStyles","block","BlockListBlock","props","id","layoutClasses","selectorPrefix","layoutClassNames","__unstableLayoutClassNames","withLayoutStyles","blockSupportsLayout","shouldRenderLayoutStyles","disableLayoutStyles"],"sources":["@wordpress/block-editor/src/hooks/layout.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport { useSettings } from '../components/use-settings';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { LAYOUT_DEFINITIONS } from '../layouts/definitions';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { unlock } from '../lock-unlock';\n\nconst layoutBlockSupportKey = 'layout';\n\nfunction hasLayoutBlockSupport( blockName ) {\n\treturn (\n\t\thasBlockSupport( blockName, 'layout' ) ||\n\t\thasBlockSupport( blockName, '__experimentalLayout' )\n\t);\n}\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst rootPaddingAlignment = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalFeatures\n\t\t\t?.useRootPaddingAwareAlignments;\n\t}, [] );\n\tconst { layout } = blockAttributes;\n\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif ( LAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className ) {\n\t\tconst baseClassName =\n\t\t\tLAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className;\n\t\tconst splitBlockName = blockName.split( '/' );\n\t\tconst fullBlockName =\n\t\t\tsplitBlockName[ 0 ] === 'core'\n\t\t\t\t? splitBlockName.pop()\n\t\t\t\t: splitBlockName.join( '-' );\n\t\tconst compoundClassName = `wp-block-${ fullBlockName }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tif (\n\t\t( usedLayout?.inherit ||\n\t\t\tusedLayout?.contentSize ||\n\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\trootPaddingAlignment\n\t) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n\treturn css;\n}\n\nfunction LayoutPanelPure( { layout, setAttributes, name: blockName } ) {\n\tconst settings = useBlockSettings( blockName );\n\t// Block settings come from theme.json under settings.[blockName].\n\tconst { layout: layoutSettings } = settings;\n\t// Layout comes from block attributes.\n\tconst [ defaultThemeLayout ] = useSettings( 'layout' );\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\t// Layout block support comes from the block's block.json.\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst blockSupportAndThemeSettings = {\n\t\t...layoutSettings,\n\t\t...layoutBlockSupport,\n\t};\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = blockSupportAndThemeSettings;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t// Only show the inherit toggle if it's supported,\n\t// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t!! defaultThemeLayout &&\n\t\t( ! layout?.type ||\n\t\t\tlayout?.type === 'default' ||\n\t\t\tlayout?.type === 'constrained' ||\n\t\t\tlayout?.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst {\n\t\tinherit = false,\n\t\ttype = 'default',\n\t\tcontentSize = null,\n\t} = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( type === 'default' || type === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( type );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__toggle-control\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\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\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\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) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: LayoutPanelPure,\n\tattributeKeys: [ 'layout' ],\n\thasSupport( name ) {\n\t\treturn hasLayoutBlockSupport( name );\n\t},\n};\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasLayoutBlockSupport( settings ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockWithLayoutStyles( { block: BlockListBlock, props } ) {\n\tconst { name, attributes } = props;\n\tconst id = useInstanceId( BlockListBlock );\n\tconst { layout } = attributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\tconst layoutClasses = useLayoutClasses( attributes, name );\n\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst selectorPrefix = `wp-container-${ kebabCase( name ) }-is-layout-`;\n\t// Higher specificity to override defaults from theme.json.\n\tconst selector = `.${ selectorPrefix }${ id }.${ selectorPrefix }${ id }`;\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t// Get CSS string for the current layout type.\n\t// The CSS and `style` element is only output if it is not empty.\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName: name,\n\t\tselector,\n\t\tlayout: usedLayout,\n\t\tstyle: attributes?.style,\n\t\thasBlockGapSupport,\n\t} );\n\n\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\tconst layoutClassNames = classnames(\n\t\t{\n\t\t\t[ `${ selectorPrefix }${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t},\n\t\tlayoutClasses\n\t);\n\n\tuseStyleOverride( { css } );\n\n\treturn (\n\t\t<BlockListBlock\n\t\t\t{ ...props }\n\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t/>\n\t);\n}\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst blockSupportsLayout = hasLayoutBlockSupport( props.name );\n\t\tconst shouldRenderLayoutStyles = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// The callback returns early to avoid block editor subscription.\n\t\t\t\tif ( ! blockSupportsLayout ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn ! select( blockEditorStore ).getSettings()\n\t\t\t\t\t.disableLayoutStyles;\n\t\t\t},\n\t\t\t[ blockSupportsLayout ]\n\t\t);\n\n\t\tif ( ! shouldRenderLayoutStyles ) {\n\t\t\treturn <BlockListBlock { ...props } />;\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockWithLayoutStyles block={ BlockListBlock } props={ props } />\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,0BAA0B,EAAEC,aAAa,QAAQ,oBAAoB;AAC9E,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,eAAe,EAAEC,eAAe,QAAQ,mBAAmB;AACpE,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,MAAM,EACNC,WAAW,EACXC,aAAa,EACbC,SAAS,EACTC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,iBAAiB,QAAQ,eAAe;AACjD,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,aAAa,EAAEC,cAAc,QAAQ,YAAY;AAC1D,SAASC,mBAAmB,QAAQ,kCAAkC;AACtE,SAASC,kBAAkB,QAAQ,wBAAwB;AAC3D,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,SAAS;AAC5D,SAASC,MAAM,QAAQ,gBAAgB;AAEvC,MAAMC,qBAAqB,GAAG,QAAQ;AAEtC,SAASC,qBAAqBA,CAAEC,SAAS,EAAG;EAC3C,OACCtB,eAAe,CAAEsB,SAAS,EAAE,QAAS,CAAC,IACtCtB,eAAe,CAAEsB,SAAS,EAAE,sBAAuB,CAAC;AAEtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,eAAe,GAAG,CAAC,CAAC,EAAEF,S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;IACVK,0BAA0B,EAAGD;EAAkB,CAC/C,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,gBAAgB,GAAGtH,0BAA0B,CACvD+G,cAAc,IAAQC,KAAK,IAAM;EAClC,MAAMO,mBAAmB,GAAG9F,qBAAqB,CAAEuF,KAAK,CAAC9C,IAAK,CAAC;EAC/D,MAAMsD,wBAAwB,GAAGnH,SAAS,CACvC0B,MAAM,IAAM;IACb;IACA,IAAK,CAAEwF,mBAAmB,EAAG;MAC5B,OAAO,KAAK;IACb;IAEA,OAAO,CAAExF,MAAM,CAAEjB,gBAAiB,CAAC,CAACkB,WAAW,CAAC,CAAC,CAC/CyF,mBAAmB;EACtB,CAAC,EACD,CAAEF,mBAAmB,CACtB,CAAC;EAED,IAAK,CAAEC,wBAAwB,EAAG;IACjC,OAAOjC,aAAA,CAACwB,cAAc;MAAA,GAAMC;IAAK,CAAI,CAAC;EACvC;EAEA,OACCzB,aAAA,CAACsB,qBAAqB;IAACC,KAAK,EAAGC,cAAgB;IAACC,KAAK,EAAGA;EAAO,CAAE,CAAC;AAEpE,CAAC,EACD,kBACD,CAAC;AAED9G,SAAS,CACR,0BAA0B,EAC1B,0BAA0B,EAC1BwG,YACD,CAAC;AACDxG,SAAS,CACR,uBAAuB,EACvB,uCAAuC,EACvCoH,gBACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["classnames","createHigherOrderComponent","useInstanceId","addFilter","getBlockSupport","hasBlockSupport","useSelect","Button","ButtonGroup","ToggleControl","PanelBody","privateApis","componentsPrivateApis","__","store","blockEditorStore","InspectorControls","useSettings","getLayoutType","getLayoutTypes","useBlockEditingMode","LAYOUT_DEFINITIONS","useBlockSettings","useStyleOverride","unlock","layoutBlockSupportKey","hasLayoutBlockSupport","blockName","useLayoutClasses","blockAttributes","kebabCase","rootPaddingAlignment","select","getSettings","__experimentalFeatures","useRootPaddingAwareAlignments","layout","default","defaultBlockLayout","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","className","baseClassName","splitBlockName","split","fullBlockName","pop","join","compoundClassName","push","orientation","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","blockGapSupport","hasBlockGapSupport","css","getLayoutStyle","LayoutPanelPure","setAttributes","name","settings","layoutSettings","defaultThemeLayout","themeSupportsLayout","supportsLayout","blockEditingMode","layoutBlockSupport","blockSupportAndThemeSettings","allowSwitching","allowEditing","allowInheriting","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","createElement","Fragment","title","__nextHasNoMarginBottom","label","checked","onChange","help","LayoutTypeSwitcher","inspectorControls","toolBarControls","shareWithChildBlocks","edit","attributeKeys","hasSupport","map","key","isPressed","onClick","addAttribute","_settings$attributes$","attributes","BlockWithLayoutStyles","block","BlockListBlock","props","layoutClasses","id","selectorPrefix","layoutClassNames","__unstableLayoutClassNames","withLayoutStyles","blockSupportsLayout","shouldRenderLayoutStyles","disableLayoutStyles","undefined"],"sources":["@wordpress/block-editor/src/hooks/layout.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport { useSettings } from '../components/use-settings';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { LAYOUT_DEFINITIONS } from '../layouts/definitions';\nimport { useBlockSettings, useStyleOverride } from './utils';\nimport { unlock } from '../lock-unlock';\n\nconst layoutBlockSupportKey = 'layout';\n\nfunction hasLayoutBlockSupport( blockName ) {\n\treturn (\n\t\thasBlockSupport( blockName, 'layout' ) ||\n\t\thasBlockSupport( blockName, '__experimentalLayout' )\n\t);\n}\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst rootPaddingAlignment = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalFeatures\n\t\t\t?.useRootPaddingAwareAlignments;\n\t}, [] );\n\tconst { layout } = blockAttributes;\n\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif ( LAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className ) {\n\t\tconst baseClassName =\n\t\t\tLAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className;\n\t\tconst splitBlockName = blockName.split( '/' );\n\t\tconst fullBlockName =\n\t\t\tsplitBlockName[ 0 ] === 'core'\n\t\t\t\t? splitBlockName.pop()\n\t\t\t\t: splitBlockName.join( '-' );\n\t\tconst compoundClassName = `wp-block-${ fullBlockName }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tif (\n\t\t( usedLayout?.inherit ||\n\t\t\tusedLayout?.contentSize ||\n\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\trootPaddingAlignment\n\t) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n\treturn css;\n}\n\nfunction LayoutPanelPure( { layout, setAttributes, name: blockName } ) {\n\tconst settings = useBlockSettings( blockName );\n\t// Block settings come from theme.json under settings.[blockName].\n\tconst { layout: layoutSettings } = settings;\n\t// Layout comes from block attributes.\n\tconst [ defaultThemeLayout ] = useSettings( 'layout' );\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\t// Layout block support comes from the block's block.json.\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst blockSupportAndThemeSettings = {\n\t\t...layoutSettings,\n\t\t...layoutBlockSupport,\n\t};\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = blockSupportAndThemeSettings;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t// Only show the inherit toggle if it's supported,\n\t// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t!! defaultThemeLayout &&\n\t\t( ! layout?.type ||\n\t\t\tlayout?.type === 'default' ||\n\t\t\tlayout?.type === 'constrained' ||\n\t\t\tlayout?.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst {\n\t\tinherit = false,\n\t\ttype = 'default',\n\t\tcontentSize = null,\n\t} = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( type === 'default' || type === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( type );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__toggle-control\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\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\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\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) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default {\n\tshareWithChildBlocks: true,\n\tedit: LayoutPanelPure,\n\tattributeKeys: [ 'layout' ],\n\thasSupport( name ) {\n\t\treturn hasLayoutBlockSupport( name );\n\t},\n};\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasLayoutBlockSupport( settings ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\nfunction BlockWithLayoutStyles( {\n\tblock: BlockListBlock,\n\tprops,\n\tlayoutClasses,\n} ) {\n\tconst { name, attributes } = props;\n\tconst id = useInstanceId( BlockListBlock );\n\tconst { layout } = attributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst selectorPrefix = `wp-container-${ kebabCase( name ) }-is-layout-`;\n\t// Higher specificity to override defaults from theme.json.\n\tconst selector = `.${ selectorPrefix }${ id }.${ selectorPrefix }${ id }`;\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t// Get CSS string for the current layout type.\n\t// The CSS and `style` element is only output if it is not empty.\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName: name,\n\t\tselector,\n\t\tlayout: usedLayout,\n\t\tstyle: attributes?.style,\n\t\thasBlockGapSupport,\n\t} );\n\n\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\tconst layoutClassNames = classnames(\n\t\t{\n\t\t\t[ `${ selectorPrefix }${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t},\n\t\tlayoutClasses\n\t);\n\n\tuseStyleOverride( { css } );\n\n\treturn (\n\t\t<BlockListBlock\n\t\t\t{ ...props }\n\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t/>\n\t);\n}\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst blockSupportsLayout = hasLayoutBlockSupport( props.name );\n\t\tconst layoutClasses = useLayoutClasses( attributes, name );\n\t\tconst shouldRenderLayoutStyles = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// The callback returns early to avoid block editor subscription.\n\t\t\t\tif ( ! blockSupportsLayout ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn ! select( blockEditorStore ).getSettings()\n\t\t\t\t\t.disableLayoutStyles;\n\t\t\t},\n\t\t\t[ blockSupportsLayout ]\n\t\t);\n\n\t\tif ( ! shouldRenderLayoutStyles ) {\n\t\t\treturn (\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t__unstableLayoutClassNames={\n\t\t\t\t\t\tblockSupportsLayout ? layoutClasses : undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockWithLayoutStyles\n\t\t\t\tblock={ BlockListBlock }\n\t\t\t\tprops={ props }\n\t\t\t\tlayoutClasses={ layoutClasses }\n\t\t\t/>\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\n"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;EAC/D,MAAM+C,aAAa,GAAGtF,gBAAgB,CAAEiF,UAAU,EAAE1C,IAAK,CAAC;EAC1D,MAAMsD,wBAAwB,GAAGnH,SAAS,CACvC0B,MAAM,IAAM;IACb;IACA,IAAK,CAAEwF,mBAAmB,EAAG;MAC5B,OAAO,KAAK;IACb;IAEA,OAAO,CAAExF,MAAM,CAAEjB,gBAAiB,CAAC,CAACkB,WAAW,CAAC,CAAC,CAC/CyF,mBAAmB;EACtB,CAAC,EACD,CAAEF,mBAAmB,CACtB,CAAC;EAED,IAAK,CAAEC,wBAAwB,EAAG;IACjC,OACCjC,aAAA,CAACwB,cAAc;MAAA,GACTC,KAAK;MACVK,0BAA0B,EACzBE,mBAAmB,GAAGN,aAAa,GAAGS;IACtC,CACD,CAAC;EAEJ;EAEA,OACCnC,aAAA,CAACsB,qBAAqB;IACrBC,KAAK,EAAGC,cAAgB;IACxBC,KAAK,EAAGA,KAAO;IACfC,aAAa,EAAGA;EAAe,CAC/B,CAAC;AAEJ,CAAC,EACD,kBACD,CAAC;AAED/G,SAAS,CACR,0BAA0B,EAC1B,0BAA0B,EAC1BwG,YACD,CAAC;AACDxG,SAAS,CACR,uBAAuB,EACvB,uCAAuC,EACvCoH,gBACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "12.19.
|
|
3
|
+
"version": "12.19.9",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@wordpress/api-fetch": "^6.48.1",
|
|
40
40
|
"@wordpress/blob": "^3.51.1",
|
|
41
41
|
"@wordpress/blocks": "^12.28.6",
|
|
42
|
-
"@wordpress/commands": "^0.22.
|
|
43
|
-
"@wordpress/components": "^26.0.
|
|
42
|
+
"@wordpress/commands": "^0.22.6",
|
|
43
|
+
"@wordpress/components": "^26.0.6",
|
|
44
44
|
"@wordpress/compose": "^6.28.1",
|
|
45
45
|
"@wordpress/data": "^9.21.1",
|
|
46
46
|
"@wordpress/date": "^4.51.1",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@wordpress/keyboard-shortcuts": "^4.28.1",
|
|
57
57
|
"@wordpress/keycodes": "^3.51.1",
|
|
58
58
|
"@wordpress/notices": "^4.19.1",
|
|
59
|
-
"@wordpress/preferences": "^3.28.
|
|
59
|
+
"@wordpress/preferences": "^3.28.6",
|
|
60
60
|
"@wordpress/private-apis": "^0.33.1",
|
|
61
61
|
"@wordpress/rich-text": "^6.28.4",
|
|
62
62
|
"@wordpress/style-engine": "^1.34.1",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "88cd256155d396c639216515e05346c687a64112"
|
|
91
91
|
}
|
|
@@ -45,6 +45,7 @@ export default function Pagination( {
|
|
|
45
45
|
onClick={ () => changePage( 1 ) }
|
|
46
46
|
disabled={ currentPage === 1 }
|
|
47
47
|
aria-label={ __( 'First page' ) }
|
|
48
|
+
__experimentalIsFocusable
|
|
48
49
|
>
|
|
49
50
|
<span>«</span>
|
|
50
51
|
</Button>
|
|
@@ -53,6 +54,7 @@ export default function Pagination( {
|
|
|
53
54
|
onClick={ () => changePage( currentPage - 1 ) }
|
|
54
55
|
disabled={ currentPage === 1 }
|
|
55
56
|
aria-label={ __( 'Previous page' ) }
|
|
57
|
+
__experimentalIsFocusable
|
|
56
58
|
>
|
|
57
59
|
<span>‹</span>
|
|
58
60
|
</Button>
|
|
@@ -75,6 +77,7 @@ export default function Pagination( {
|
|
|
75
77
|
onClick={ () => changePage( currentPage + 1 ) }
|
|
76
78
|
disabled={ currentPage === numPages }
|
|
77
79
|
aria-label={ __( 'Next page' ) }
|
|
80
|
+
__experimentalIsFocusable
|
|
78
81
|
>
|
|
79
82
|
<span>›</span>
|
|
80
83
|
</Button>
|
|
@@ -84,6 +87,7 @@ export default function Pagination( {
|
|
|
84
87
|
disabled={ currentPage === numPages }
|
|
85
88
|
aria-label={ __( 'Last page' ) }
|
|
86
89
|
size="default"
|
|
90
|
+
__experimentalIsFocusable
|
|
87
91
|
>
|
|
88
92
|
<span>»</span>
|
|
89
93
|
</Button>
|
|
@@ -47,10 +47,16 @@ function PatternsListHeader( { filterValue, filteredBlockPatternsLength } ) {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function PatternList( {
|
|
50
|
+
function PatternList( {
|
|
51
|
+
searchValue,
|
|
52
|
+
selectedCategory,
|
|
53
|
+
patternCategories,
|
|
54
|
+
rootClientId,
|
|
55
|
+
} ) {
|
|
51
56
|
const container = useRef();
|
|
52
57
|
const debouncedSpeak = useDebounce( speak, 500 );
|
|
53
58
|
const [ destinationRootClientId, onInsertBlocks ] = useInsertionPoint( {
|
|
59
|
+
rootClientId,
|
|
54
60
|
shouldFocusBlock: true,
|
|
55
61
|
} );
|
|
56
62
|
const [ patterns, , onClickPattern ] = usePatternsState(
|
|
@@ -556,9 +556,14 @@ export default function useListViewDropZone( {
|
|
|
556
556
|
const ref = useDropZone( {
|
|
557
557
|
dropZoneElement,
|
|
558
558
|
onDrop( event ) {
|
|
559
|
+
throttled.cancel();
|
|
559
560
|
if ( target ) {
|
|
560
561
|
onBlockDrop( event );
|
|
561
562
|
}
|
|
563
|
+
// Use `undefined` value to indicate that the drag has concluded.
|
|
564
|
+
// This allows styling rules that are active only when a user is
|
|
565
|
+
// dragging to be removed.
|
|
566
|
+
setTarget( undefined );
|
|
562
567
|
},
|
|
563
568
|
onDragLeave() {
|
|
564
569
|
throttled.cancel();
|
|
@@ -92,10 +92,10 @@ export const DeprecatedExperimentalRecursionProvider = ( props ) => {
|
|
|
92
92
|
return <RecursionProvider { ...props } />;
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
export const DeprecatedExperimentalUseHasRecursion = (
|
|
95
|
+
export const DeprecatedExperimentalUseHasRecursion = ( ...args ) => {
|
|
96
96
|
deprecated( 'wp.blockEditor.__experimentalUseHasRecursion', {
|
|
97
97
|
since: '6.5',
|
|
98
98
|
alternative: 'wp.blockEditor.useHasRecursion',
|
|
99
99
|
} );
|
|
100
|
-
return useHasRecursion( ...
|
|
100
|
+
return useHasRecursion( ...args );
|
|
101
101
|
};
|
|
@@ -46,6 +46,7 @@ const ImageURLInputUI = ( {
|
|
|
46
46
|
showLightboxSetting,
|
|
47
47
|
lightboxEnabled,
|
|
48
48
|
onSetLightbox,
|
|
49
|
+
resetLightbox,
|
|
49
50
|
} ) => {
|
|
50
51
|
const [ isOpen, setIsOpen ] = useState( false );
|
|
51
52
|
// Use internal state instead of a ref to make sure that the component
|
|
@@ -241,7 +242,9 @@ const ImageURLInputUI = ( {
|
|
|
241
242
|
);
|
|
242
243
|
|
|
243
244
|
const linkEditorValue = urlInput !== null ? urlInput : url;
|
|
244
|
-
const
|
|
245
|
+
const hideLightboxPanel =
|
|
246
|
+
! lightboxEnabled || ( lightboxEnabled && ! showLightboxSetting );
|
|
247
|
+
const showLinkEditor = ! linkEditorValue && hideLightboxPanel;
|
|
245
248
|
|
|
246
249
|
const urlLabel = (
|
|
247
250
|
getLinkDestinations().find(
|
|
@@ -249,6 +252,65 @@ const ImageURLInputUI = ( {
|
|
|
249
252
|
) || {}
|
|
250
253
|
).title;
|
|
251
254
|
|
|
255
|
+
const PopoverChildren = () => {
|
|
256
|
+
if (
|
|
257
|
+
lightboxEnabled &&
|
|
258
|
+
showLightboxSetting &&
|
|
259
|
+
! url &&
|
|
260
|
+
! isEditingLink
|
|
261
|
+
) {
|
|
262
|
+
return (
|
|
263
|
+
<div className="block-editor-url-popover__expand-on-click">
|
|
264
|
+
<Icon icon={ fullscreen } />
|
|
265
|
+
<div className="text">
|
|
266
|
+
<p>{ __( 'Expand on click' ) }</p>
|
|
267
|
+
<p className="description">
|
|
268
|
+
{ __( 'Scales the image with a lightbox effect' ) }
|
|
269
|
+
</p>
|
|
270
|
+
</div>
|
|
271
|
+
<Button
|
|
272
|
+
icon={ linkOff }
|
|
273
|
+
label={ __( 'Disable expand on click' ) }
|
|
274
|
+
onClick={ () => {
|
|
275
|
+
onSetLightbox( false );
|
|
276
|
+
} }
|
|
277
|
+
size="compact"
|
|
278
|
+
/>
|
|
279
|
+
</div>
|
|
280
|
+
);
|
|
281
|
+
} else if ( ! url || isEditingLink ) {
|
|
282
|
+
return (
|
|
283
|
+
<URLPopover.LinkEditor
|
|
284
|
+
className="block-editor-format-toolbar__link-container-content"
|
|
285
|
+
value={ linkEditorValue }
|
|
286
|
+
onChangeInputValue={ setUrlInput }
|
|
287
|
+
onSubmit={ onSubmitLinkChange() }
|
|
288
|
+
autocompleteRef={ autocompleteRef }
|
|
289
|
+
/>
|
|
290
|
+
);
|
|
291
|
+
} else if ( url && ! isEditingLink ) {
|
|
292
|
+
return (
|
|
293
|
+
<>
|
|
294
|
+
<URLPopover.LinkViewer
|
|
295
|
+
className="block-editor-format-toolbar__link-container-content"
|
|
296
|
+
url={ url }
|
|
297
|
+
onEditLinkClick={ startEditLink }
|
|
298
|
+
urlLabel={ urlLabel }
|
|
299
|
+
/>
|
|
300
|
+
<Button
|
|
301
|
+
icon={ linkOff }
|
|
302
|
+
label={ __( 'Remove link' ) }
|
|
303
|
+
onClick={ () => {
|
|
304
|
+
onLinkRemove();
|
|
305
|
+
resetLightbox();
|
|
306
|
+
} }
|
|
307
|
+
size="compact"
|
|
308
|
+
/>
|
|
309
|
+
</>
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
|
|
252
314
|
return (
|
|
253
315
|
<>
|
|
254
316
|
<ToolbarButton
|
|
@@ -258,7 +320,9 @@ const ImageURLInputUI = ( {
|
|
|
258
320
|
aria-expanded={ isOpen }
|
|
259
321
|
onClick={ openLinkUI }
|
|
260
322
|
ref={ setPopoverAnchor }
|
|
261
|
-
isActive={
|
|
323
|
+
isActive={
|
|
324
|
+
!! url || ( lightboxEnabled && showLightboxSetting )
|
|
325
|
+
}
|
|
262
326
|
/>
|
|
263
327
|
{ isOpen && (
|
|
264
328
|
<URLPopover
|
|
@@ -267,7 +331,7 @@ const ImageURLInputUI = ( {
|
|
|
267
331
|
onFocusOutside={ onFocusOutside() }
|
|
268
332
|
onClose={ closeLinkUI }
|
|
269
333
|
renderSettings={
|
|
270
|
-
|
|
334
|
+
hideLightboxPanel ? () => advancedOptions : null
|
|
271
335
|
}
|
|
272
336
|
additionalControls={
|
|
273
337
|
showLinkEditor && (
|
|
@@ -314,54 +378,7 @@ const ImageURLInputUI = ( {
|
|
|
314
378
|
}
|
|
315
379
|
offset={ 13 }
|
|
316
380
|
>
|
|
317
|
-
{ (
|
|
318
|
-
<>
|
|
319
|
-
<URLPopover.LinkEditor
|
|
320
|
-
className="block-editor-format-toolbar__link-container-content"
|
|
321
|
-
value={ linkEditorValue }
|
|
322
|
-
onChangeInputValue={ setUrlInput }
|
|
323
|
-
onSubmit={ onSubmitLinkChange() }
|
|
324
|
-
autocompleteRef={ autocompleteRef }
|
|
325
|
-
/>
|
|
326
|
-
</>
|
|
327
|
-
) }
|
|
328
|
-
{ url && ! isEditingLink && ! lightboxEnabled && (
|
|
329
|
-
<>
|
|
330
|
-
<URLPopover.LinkViewer
|
|
331
|
-
className="block-editor-format-toolbar__link-container-content"
|
|
332
|
-
url={ url }
|
|
333
|
-
onEditLinkClick={ startEditLink }
|
|
334
|
-
urlLabel={ urlLabel }
|
|
335
|
-
/>
|
|
336
|
-
<Button
|
|
337
|
-
icon={ linkOff }
|
|
338
|
-
label={ __( 'Remove link' ) }
|
|
339
|
-
onClick={ onLinkRemove }
|
|
340
|
-
size="compact"
|
|
341
|
-
/>
|
|
342
|
-
</>
|
|
343
|
-
) }
|
|
344
|
-
{ ! url && ! isEditingLink && lightboxEnabled && (
|
|
345
|
-
<div className="block-editor-url-popover__expand-on-click">
|
|
346
|
-
<Icon icon={ fullscreen } />
|
|
347
|
-
<div className="text">
|
|
348
|
-
<p>{ __( 'Expand on click' ) }</p>
|
|
349
|
-
<p className="description">
|
|
350
|
-
{ __(
|
|
351
|
-
'Scales the image with a lightbox effect'
|
|
352
|
-
) }
|
|
353
|
-
</p>
|
|
354
|
-
</div>
|
|
355
|
-
<Button
|
|
356
|
-
icon={ linkOff }
|
|
357
|
-
label={ __( 'Disable expand on click' ) }
|
|
358
|
-
onClick={ () => {
|
|
359
|
-
onSetLightbox( false );
|
|
360
|
-
} }
|
|
361
|
-
size="compact"
|
|
362
|
-
/>
|
|
363
|
-
</div>
|
|
364
|
-
) }
|
|
381
|
+
{ PopoverChildren() }
|
|
365
382
|
</URLPopover>
|
|
366
383
|
) }
|
|
367
384
|
</>
|
package/src/hooks/layout.js
CHANGED
|
@@ -338,7 +338,11 @@ export function addAttribute( settings ) {
|
|
|
338
338
|
return settings;
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
function BlockWithLayoutStyles( {
|
|
341
|
+
function BlockWithLayoutStyles( {
|
|
342
|
+
block: BlockListBlock,
|
|
343
|
+
props,
|
|
344
|
+
layoutClasses,
|
|
345
|
+
} ) {
|
|
342
346
|
const { name, attributes } = props;
|
|
343
347
|
const id = useInstanceId( BlockListBlock );
|
|
344
348
|
const { layout } = attributes;
|
|
@@ -348,7 +352,6 @@ function BlockWithLayoutStyles( { block: BlockListBlock, props } ) {
|
|
|
348
352
|
layout?.inherit || layout?.contentSize || layout?.wideSize
|
|
349
353
|
? { ...layout, type: 'constrained' }
|
|
350
354
|
: layout || defaultBlockLayout || {};
|
|
351
|
-
const layoutClasses = useLayoutClasses( attributes, name );
|
|
352
355
|
|
|
353
356
|
const { kebabCase } = unlock( componentsPrivateApis );
|
|
354
357
|
const selectorPrefix = `wp-container-${ kebabCase( name ) }-is-layout-`;
|
|
@@ -395,7 +398,9 @@ function BlockWithLayoutStyles( { block: BlockListBlock, props } ) {
|
|
|
395
398
|
*/
|
|
396
399
|
export const withLayoutStyles = createHigherOrderComponent(
|
|
397
400
|
( BlockListBlock ) => ( props ) => {
|
|
401
|
+
const { name, attributes } = props;
|
|
398
402
|
const blockSupportsLayout = hasLayoutBlockSupport( props.name );
|
|
403
|
+
const layoutClasses = useLayoutClasses( attributes, name );
|
|
399
404
|
const shouldRenderLayoutStyles = useSelect(
|
|
400
405
|
( select ) => {
|
|
401
406
|
// The callback returns early to avoid block editor subscription.
|
|
@@ -410,11 +415,22 @@ export const withLayoutStyles = createHigherOrderComponent(
|
|
|
410
415
|
);
|
|
411
416
|
|
|
412
417
|
if ( ! shouldRenderLayoutStyles ) {
|
|
413
|
-
return
|
|
418
|
+
return (
|
|
419
|
+
<BlockListBlock
|
|
420
|
+
{ ...props }
|
|
421
|
+
__unstableLayoutClassNames={
|
|
422
|
+
blockSupportsLayout ? layoutClasses : undefined
|
|
423
|
+
}
|
|
424
|
+
/>
|
|
425
|
+
);
|
|
414
426
|
}
|
|
415
427
|
|
|
416
428
|
return (
|
|
417
|
-
<BlockWithLayoutStyles
|
|
429
|
+
<BlockWithLayoutStyles
|
|
430
|
+
block={ BlockListBlock }
|
|
431
|
+
props={ props }
|
|
432
|
+
layoutClasses={ layoutClasses }
|
|
433
|
+
/>
|
|
418
434
|
);
|
|
419
435
|
},
|
|
420
436
|
'withLayoutStyles'
|