@wordpress/block-editor 14.7.0 → 14.8.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/build/components/block-controls/slot.js +6 -3
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -2
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-lock/modal.js +1 -1
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-manager/category.js +79 -0
- package/build/components/block-manager/category.js.map +1 -0
- package/build/components/block-manager/checklist.js +40 -0
- package/build/components/block-manager/checklist.js.map +1 -0
- package/build/components/block-manager/index.js +108 -0
- package/build/components/block-manager/index.js.map +1 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +16 -4
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/switch-section-style.js +105 -0
- package/build/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build/components/collab/block-comment-icon-slot.js +2 -6
- package/build/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +4 -2
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/font-family/index.js +14 -13
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +1 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/iframe/index.js +13 -100
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-scale-canvas.js +377 -0
- package/build/components/iframe/use-scale-canvas.js.map +1 -0
- package/build/components/image-editor/use-save-image.js +22 -3
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -5
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +7 -8
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +2 -1
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +7 -4
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/media-placeholder/index.js +29 -21
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/hooks/border.js +3 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/style.js +6 -6
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +1 -1
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +1 -1
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/utils.js +1 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/flex.js +11 -9
- package/build/layouts/flex.js.map +1 -1
- package/build/private-apis.js +4 -4
- package/build/private-apis.js.map +1 -1
- package/build/store/private-selectors.js +1 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +3 -0
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-controls/slot.js +6 -3
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -2
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-lock/modal.js +1 -1
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-manager/category.js +71 -0
- package/build-module/components/block-manager/category.js.map +1 -0
- package/build-module/components/block-manager/checklist.js +32 -0
- package/build-module/components/block-manager/checklist.js.map +1 -0
- package/build-module/components/block-manager/index.js +102 -0
- package/build-module/components/block-manager/index.js.map +1 -0
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +2 -2
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +16 -4
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/switch-section-style.js +97 -0
- package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
- package/build-module/components/collab/block-comment-icon-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +4 -2
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/font-family/index.js +15 -14
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/iframe/index.js +15 -102
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-scale-canvas.js +371 -0
- package/build-module/components/iframe/use-scale-canvas.js.map +1 -0
- package/build-module/components/image-editor/use-save-image.js +22 -3
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -5
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +8 -9
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +2 -1
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +7 -4
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +29 -21
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/hooks/border.js +3 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/style.js +6 -6
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +1 -1
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +1 -1
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/utils.js +1 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/flex.js +11 -9
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/private-apis.js +6 -6
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-selectors.js +1 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +3 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/content-rtl.css +27 -28
- package/build-style/content.css +27 -28
- package/build-style/style-rtl.css +108 -0
- package/build-style/style.css +108 -0
- package/package.json +2 -2
- package/src/components/block-canvas/style.scss +2 -1
- package/src/components/block-controls/slot.js +5 -3
- package/src/components/block-inspector/index.js +0 -2
- package/src/components/block-lock/modal.js +1 -1
- package/src/components/block-manager/category.js +102 -0
- package/src/components/block-manager/checklist.js +34 -0
- package/src/components/block-manager/index.js +127 -0
- package/src/components/block-manager/style.scss +82 -0
- package/src/components/block-mover/README.md +15 -8
- package/src/components/block-mover/stories/index.story.js +73 -71
- package/src/components/block-mover/style.scss +3 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/src/components/block-settings-menu/index.js +2 -2
- package/src/components/block-toolbar/index.js +14 -0
- package/src/components/block-toolbar/switch-section-style.js +115 -0
- package/src/components/block-tools/style.scss +39 -0
- package/src/components/collab/block-comment-icon-slot.js +2 -6
- package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
- package/src/components/color-palette/test/__snapshots__/control.js.snap +2 -2
- package/src/components/color-palette/with-color-context.js +25 -7
- package/src/components/font-family/index.js +13 -13
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +1 -1
- package/src/components/iframe/content.scss +49 -43
- package/src/components/iframe/index.js +14 -171
- package/src/components/iframe/use-scale-canvas.js +468 -0
- package/src/components/image-editor/use-save-image.js +27 -2
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +7 -16
- package/src/components/inserter/category-tabs/index.js +8 -9
- package/src/components/inserter-draggable-blocks/index.js +10 -1
- package/src/components/inspector-controls/README.md +2 -0
- package/src/components/inspector-controls/slot.js +6 -4
- package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
- package/src/components/media-placeholder/index.js +37 -33
- package/src/components/provider/test/use-block-sync.js +3 -1
- package/src/components/rich-text/content.scss +15 -10
- package/src/hooks/border.js +3 -9
- package/src/hooks/color.js +1 -1
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/style.js +6 -12
- package/src/hooks/supports.js +1 -1
- package/src/hooks/test/style.js +1 -2
- package/src/hooks/typography.js +1 -1
- package/src/hooks/utils.js +1 -1
- package/src/layouts/flex.js +26 -18
- package/src/private-apis.js +6 -6
- package/src/store/private-selectors.js +1 -1
- package/src/store/selectors.js +3 -0
- package/src/store/test/selectors.js +87 -58
- package/src/style.scss +1 -0
- package/build/components/block-info-slot-fill/index.js +0 -39
- package/build/components/block-info-slot-fill/index.js.map +0 -1
- package/build-module/components/block-info-slot-fill/index.js +0 -32
- package/build-module/components/block-info-slot-fill/index.js.map +0 -1
- package/src/components/block-info-slot-fill/index.js +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_components","_utils","_gap","_components2","_utils2","_definitions","_jsxRuntime","justifyContentMap","left","right","center","alignItemsMap","stretch","verticalAlignmentMap","top","bottom","flexWrapOptions","_default","exports","default","name","label","__","inspectorControls","FlexLayoutInspectorControls","layout","onChange","layoutBlockSupport","allowOrientation","jsxs","Fragment","children","Flex","jsx","FlexItem","FlexLayoutJustifyContentControl","OrientationControl","FlexWrapControl","toolBarControls","FlexLayoutToolbarControls","allowSwitching","allowVerticalAlignment","BlockControls","group","__experimentalShareWithChildBlocks","isToolbar","FlexLayoutVerticalAlignmentControl","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","LAYOUT_DEFINITIONS","orientation","blockGapValue","spacing","blockGap","shouldSkipSerialization","getGapCSSValue","undefined","justifyContent","flexWrap","includes","verticalAlignment","alignItems","output","rules","push","length","appendSelectors","join","getBlockGapCSS","getOrientation","getAlignments","defaultVerticalAlignment","onVerticalAlignmentChange","value","BlockVerticalAlignmentControl","controls","POPOVER_PROPS","placement","onJustificationChange","allowedControls","JustifyContentControl","popoverProps","justificationOptions","icon","justifyLeft","justifyCenter","justifyRight","justifySpaceBetween","justifyStretch","__experimentalToggleGroupControl","__next40pxDefaultSize","__nextHasNoMarginBottom","className","map","__experimentalToggleGroupControlOptionIcon","ToggleControl","checked","newVerticalAlignment","newJustification","arrowRight","arrowDown"],"sources":["@wordpress/block-editor/src/layouts/flex.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n\tjustifySpaceBetween,\n\tjustifyStretch,\n\tarrowRight,\n\tarrowDown,\n} from '@wordpress/icons';\nimport {\n\tToggleControl,\n\tFlex,\n\tFlexItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport {\n\tBlockControls,\n\tJustifyContentControl,\n\tBlockVerticalAlignmentControl,\n} from '../components';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\n// Used with the default, horizontal flex orientation.\nconst justifyContentMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\t'space-between': 'space-between',\n};\n\n// Used with the vertical (column) flex orientation.\nconst alignItemsMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\tstretch: 'stretch',\n};\n\nconst verticalAlignmentMap = {\n\ttop: 'flex-start',\n\tcenter: 'center',\n\tbottom: 'flex-end',\n\tstretch: 'stretch',\n\t'space-between': 'space-between',\n};\n\nconst flexWrapOptions = [ 'wrap', 'nowrap' ];\n\nexport default {\n\tname: 'flex',\n\tlabel: __( 'Flex' ),\n\tinspectorControls: function FlexLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowOrientation = true } = layoutBlockSupport;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Flex>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t{ allowOrientation && (\n\t\t\t\t\t\t\t<OrientationControl\n\t\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t\t<FlexWrapControl layout={ layout } onChange={ onChange } />\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function FlexLayoutToolbarControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport,\n\t} ) {\n\t\tif ( layoutBlockSupport?.allowSwitching ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst { allowVerticalAlignment = true } = layoutBlockSupport;\n\t\treturn (\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\tlayout={ layout }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tisToolbar\n\t\t\t\t/>\n\t\t\t\t{ allowVerticalAlignment && (\n\t\t\t\t\t<FlexLayoutVerticalAlignmentControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t);\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\t\tconst justifyContent = justifyContentMap[ layout.justifyContent ];\n\t\tconst flexWrap = flexWrapOptions.includes( layout.flexWrap )\n\t\t\t? layout.flexWrap\n\t\t\t: 'wrap';\n\t\tconst verticalAlignment =\n\t\t\tverticalAlignmentMap[ layout.verticalAlignment ];\n\t\tconst alignItems =\n\t\t\talignItemsMap[ layout.justifyContent ] || alignItemsMap.left;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( flexWrap && flexWrap !== 'wrap' ) {\n\t\t\trules.push( `flex-wrap: ${ flexWrap }` );\n\t\t}\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `align-items: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\tif ( justifyContent ) {\n\t\t\t\trules.push( `justify-content: ${ justifyContent }` );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `justify-content: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\trules.push( 'flex-direction: column' );\n\t\t\trules.push( `align-items: ${ alignItems }` );\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\toutput = `${ appendSelectors( selector ) } {\n\t\t\t\t${ rules.join( '; ' ) };\n\t\t\t}`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'flex',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation( layout ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\t\treturn orientation;\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\nfunction FlexLayoutVerticalAlignmentControl( { layout, onChange } ) {\n\tconst { orientation = 'horizontal' } = layout;\n\n\tconst defaultVerticalAlignment =\n\t\torientation === 'horizontal'\n\t\t\t? verticalAlignmentMap.center\n\t\t\t: verticalAlignmentMap.top;\n\n\tconst { verticalAlignment = defaultVerticalAlignment } = layout;\n\n\tconst onVerticalAlignmentChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tverticalAlignment: value,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<BlockVerticalAlignmentControl\n\t\t\tonChange={ onVerticalAlignmentChange }\n\t\t\tvalue={ verticalAlignment }\n\t\t\tcontrols={\n\t\t\t\torientation === 'horizontal'\n\t\t\t\t\t? [ 'top', 'center', 'bottom', 'stretch' ]\n\t\t\t\t\t: [ 'top', 'center', 'bottom', 'space-between' ]\n\t\t\t}\n\t\t/>\n\t);\n}\n\nconst POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\nfunction FlexLayoutJustifyContentControl( {\n\tlayout,\n\tonChange,\n\tisToolbar = false,\n} ) {\n\tconst { justifyContent = 'left', orientation = 'horizontal' } = layout;\n\tconst onJustificationChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tjustifyContent: value,\n\t\t} );\n\t};\n\tconst allowedControls = [ 'left', 'center', 'right' ];\n\tif ( orientation === 'horizontal' ) {\n\t\tallowedControls.push( 'space-between' );\n\t} else {\n\t\tallowedControls.push( 'stretch' );\n\t}\n\tif ( isToolbar ) {\n\t\treturn (\n\t\t\t<JustifyContentControl\n\t\t\t\tallowedControls={ allowedControls }\n\t\t\t\tvalue={ justifyContent }\n\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst justificationOptions = [\n\t\t{\n\t\t\tvalue: 'left',\n\t\t\ticon: justifyLeft,\n\t\t\tlabel: __( 'Justify items left' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'center',\n\t\t\ticon: justifyCenter,\n\t\t\tlabel: __( 'Justify items center' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'right',\n\t\t\ticon: justifyRight,\n\t\t\tlabel: __( 'Justify items right' ),\n\t\t},\n\t];\n\tif ( orientation === 'horizontal' ) {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'space-between',\n\t\t\ticon: justifySpaceBetween,\n\t\t\tlabel: __( 'Space between items' ),\n\t\t} );\n\t} else {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'stretch',\n\t\t\ticon: justifyStretch,\n\t\t\tlabel: __( 'Stretch items' ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Justification' ) }\n\t\t\tvalue={ justifyContent }\n\t\t\tonChange={ onJustificationChange }\n\t\t\tclassName=\"block-editor-hooks__flex-layout-justification-controls\"\n\t\t>\n\t\t\t{ justificationOptions.map( ( { value, icon, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n\nfunction FlexWrapControl( { layout, onChange } ) {\n\tconst { flexWrap = 'wrap' } = layout;\n\treturn (\n\t\t<ToggleControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Allow to wrap to multiple lines' ) }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tonChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\tflexWrap: value ? 'wrap' : 'nowrap',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tchecked={ flexWrap === 'wrap' }\n\t\t/>\n\t);\n}\n\nfunction OrientationControl( { layout, onChange } ) {\n\tconst {\n\t\torientation = 'horizontal',\n\t\tverticalAlignment,\n\t\tjustifyContent,\n\t} = layout;\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"block-editor-hooks__flex-layout-orientation-controls\"\n\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\tvalue={ orientation }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\t// Make sure the vertical alignment and justification are compatible with the new orientation.\n\t\t\t\tlet newVerticalAlignment = verticalAlignment;\n\t\t\t\tlet newJustification = justifyContent;\n\t\t\t\tif ( value === 'horizontal' ) {\n\t\t\t\t\tif ( verticalAlignment === 'space-between' ) {\n\t\t\t\t\t\tnewVerticalAlignment = 'center';\n\t\t\t\t\t}\n\t\t\t\t\tif ( justifyContent === 'stretch' ) {\n\t\t\t\t\t\tnewJustification = 'left';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( verticalAlignment === 'stretch' ) {\n\t\t\t\t\t\tnewVerticalAlignment = 'top';\n\t\t\t\t\t}\n\t\t\t\t\tif ( justifyContent === 'space-between' ) {\n\t\t\t\t\t\tnewJustification = 'left';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn onChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\torientation: value,\n\t\t\t\t\tverticalAlignment: newVerticalAlignment,\n\t\t\t\t\tjustifyContent: newJustification,\n\t\t\t\t} );\n\t\t\t} }\n\t\t>\n\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\ticon={ arrowRight }\n\t\t\t\tvalue=\"horizontal\"\n\t\t\t\tlabel={ __( 'Horizontal' ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\ticon={ arrowDown }\n\t\t\t\tvalue=\"vertical\"\n\t\t\t\tlabel={ __( 'Vertical' ) }\n\t\t\t/>\n\t\t</ToggleGroupControl>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AASA,IAAAE,WAAA,GAAAF,OAAA;AAWA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAAmD,IAAAQ,WAAA,G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AAA2B,GAAA,EAACjC,WAAA,CAAAkG,0CAA4B;MAC5BX,IAAI,EAAGgB,iBAAY;MACnB1B,KAAK,EAAC,YAAY;MAClBxD,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa;IAAG,CAC5B,CAAC,eACF,IAAAhB,WAAA,CAAA2B,GAAA,EAACjC,WAAA,CAAAkG,0CAA4B;MAC5BX,IAAI,EAAGiB,gBAAW;MAClB3B,KAAK,EAAC,UAAU;MAChBxD,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW;IAAG,CAC1B,CAAC;EAAA,CACiB,CAAC;AAEvB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_components","_utils","_gap","_components2","_utils2","_definitions","_jsxRuntime","justifyContentMap","left","right","center","alignItemsMap","stretch","verticalAlignmentMap","top","bottom","flexWrapOptions","_default","exports","default","name","label","__","inspectorControls","FlexLayoutInspectorControls","layout","onChange","layoutBlockSupport","allowOrientation","allowJustification","jsxs","Fragment","children","Flex","jsx","FlexItem","FlexLayoutJustifyContentControl","OrientationControl","FlexWrapControl","toolBarControls","FlexLayoutToolbarControls","allowVerticalAlignment","BlockControls","group","__experimentalShareWithChildBlocks","isToolbar","FlexLayoutVerticalAlignmentControl","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","LAYOUT_DEFINITIONS","orientation","blockGapValue","spacing","blockGap","shouldSkipSerialization","getGapCSSValue","undefined","justifyContent","flexWrap","includes","verticalAlignment","alignItems","output","rules","push","length","appendSelectors","join","getBlockGapCSS","getOrientation","getAlignments","defaultVerticalAlignment","onVerticalAlignmentChange","value","BlockVerticalAlignmentControl","controls","POPOVER_PROPS","placement","onJustificationChange","allowedControls","JustifyContentControl","popoverProps","justificationOptions","icon","justifyLeft","justifyCenter","justifyRight","justifySpaceBetween","justifyStretch","__experimentalToggleGroupControl","__next40pxDefaultSize","__nextHasNoMarginBottom","className","map","__experimentalToggleGroupControlOptionIcon","ToggleControl","checked","newVerticalAlignment","newJustification","arrowRight","arrowDown"],"sources":["@wordpress/block-editor/src/layouts/flex.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n\tjustifySpaceBetween,\n\tjustifyStretch,\n\tarrowRight,\n\tarrowDown,\n} from '@wordpress/icons';\nimport {\n\tToggleControl,\n\tFlex,\n\tFlexItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport {\n\tBlockControls,\n\tJustifyContentControl,\n\tBlockVerticalAlignmentControl,\n} from '../components';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\n// Used with the default, horizontal flex orientation.\nconst justifyContentMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\t'space-between': 'space-between',\n};\n\n// Used with the vertical (column) flex orientation.\nconst alignItemsMap = {\n\tleft: 'flex-start',\n\tright: 'flex-end',\n\tcenter: 'center',\n\tstretch: 'stretch',\n};\n\nconst verticalAlignmentMap = {\n\ttop: 'flex-start',\n\tcenter: 'center',\n\tbottom: 'flex-end',\n\tstretch: 'stretch',\n\t'space-between': 'space-between',\n};\n\nconst flexWrapOptions = [ 'wrap', 'nowrap' ];\n\nexport default {\n\tname: 'flex',\n\tlabel: __( 'Flex' ),\n\tinspectorControls: function FlexLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { allowOrientation = true, allowJustification = true } =\n\t\t\tlayoutBlockSupport;\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<Flex>\n\t\t\t\t\t{ allowJustification && (\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ allowOrientation && (\n\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t<OrientationControl\n\t\t\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t) }\n\t\t\t\t</Flex>\n\t\t\t\t<FlexWrapControl layout={ layout } onChange={ onChange } />\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function FlexLayoutToolbarControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t\tlayoutBlockSupport,\n\t} ) {\n\t\tconst { allowVerticalAlignment = true, allowJustification = true } =\n\t\t\tlayoutBlockSupport;\n\n\t\tif ( ! allowJustification && ! allowVerticalAlignment ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockControls group=\"block\" __experimentalShareWithChildBlocks>\n\t\t\t\t{ allowJustification && (\n\t\t\t\t\t<FlexLayoutJustifyContentControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tisToolbar\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ allowVerticalAlignment && (\n\t\t\t\t\t<FlexLayoutVerticalAlignmentControl\n\t\t\t\t\t\tlayout={ layout }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t);\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\t\tconst justifyContent = justifyContentMap[ layout.justifyContent ];\n\t\tconst flexWrap = flexWrapOptions.includes( layout.flexWrap )\n\t\t\t? layout.flexWrap\n\t\t\t: 'wrap';\n\t\tconst verticalAlignment =\n\t\t\tverticalAlignmentMap[ layout.verticalAlignment ];\n\t\tconst alignItems =\n\t\t\talignItemsMap[ layout.justifyContent ] || alignItemsMap.left;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( flexWrap && flexWrap !== 'wrap' ) {\n\t\t\trules.push( `flex-wrap: ${ flexWrap }` );\n\t\t}\n\n\t\tif ( orientation === 'horizontal' ) {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `align-items: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\tif ( justifyContent ) {\n\t\t\t\trules.push( `justify-content: ${ justifyContent }` );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( verticalAlignment ) {\n\t\t\t\trules.push( `justify-content: ${ verticalAlignment }` );\n\t\t\t}\n\t\t\trules.push( 'flex-direction: column' );\n\t\t\trules.push( `align-items: ${ alignItems }` );\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\toutput = `${ appendSelectors( selector ) } {\n\t\t\t\t${ rules.join( '; ' ) };\n\t\t\t}`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'flex',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation( layout ) {\n\t\tconst { orientation = 'horizontal' } = layout;\n\t\treturn orientation;\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\nfunction FlexLayoutVerticalAlignmentControl( { layout, onChange } ) {\n\tconst { orientation = 'horizontal' } = layout;\n\n\tconst defaultVerticalAlignment =\n\t\torientation === 'horizontal'\n\t\t\t? verticalAlignmentMap.center\n\t\t\t: verticalAlignmentMap.top;\n\n\tconst { verticalAlignment = defaultVerticalAlignment } = layout;\n\n\tconst onVerticalAlignmentChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tverticalAlignment: value,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<BlockVerticalAlignmentControl\n\t\t\tonChange={ onVerticalAlignmentChange }\n\t\t\tvalue={ verticalAlignment }\n\t\t\tcontrols={\n\t\t\t\torientation === 'horizontal'\n\t\t\t\t\t? [ 'top', 'center', 'bottom', 'stretch' ]\n\t\t\t\t\t: [ 'top', 'center', 'bottom', 'space-between' ]\n\t\t\t}\n\t\t/>\n\t);\n}\n\nconst POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\nfunction FlexLayoutJustifyContentControl( {\n\tlayout,\n\tonChange,\n\tisToolbar = false,\n} ) {\n\tconst { justifyContent = 'left', orientation = 'horizontal' } = layout;\n\tconst onJustificationChange = ( value ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tjustifyContent: value,\n\t\t} );\n\t};\n\tconst allowedControls = [ 'left', 'center', 'right' ];\n\tif ( orientation === 'horizontal' ) {\n\t\tallowedControls.push( 'space-between' );\n\t} else {\n\t\tallowedControls.push( 'stretch' );\n\t}\n\tif ( isToolbar ) {\n\t\treturn (\n\t\t\t<JustifyContentControl\n\t\t\t\tallowedControls={ allowedControls }\n\t\t\t\tvalue={ justifyContent }\n\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst justificationOptions = [\n\t\t{\n\t\t\tvalue: 'left',\n\t\t\ticon: justifyLeft,\n\t\t\tlabel: __( 'Justify items left' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'center',\n\t\t\ticon: justifyCenter,\n\t\t\tlabel: __( 'Justify items center' ),\n\t\t},\n\t\t{\n\t\t\tvalue: 'right',\n\t\t\ticon: justifyRight,\n\t\t\tlabel: __( 'Justify items right' ),\n\t\t},\n\t];\n\tif ( orientation === 'horizontal' ) {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'space-between',\n\t\t\ticon: justifySpaceBetween,\n\t\t\tlabel: __( 'Space between items' ),\n\t\t} );\n\t} else {\n\t\tjustificationOptions.push( {\n\t\t\tvalue: 'stretch',\n\t\t\ticon: justifyStretch,\n\t\t\tlabel: __( 'Stretch items' ),\n\t\t} );\n\t}\n\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Justification' ) }\n\t\t\tvalue={ justifyContent }\n\t\t\tonChange={ onJustificationChange }\n\t\t\tclassName=\"block-editor-hooks__flex-layout-justification-controls\"\n\t\t>\n\t\t\t{ justificationOptions.map( ( { value, icon, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ToggleGroupControl>\n\t);\n}\n\nfunction FlexWrapControl( { layout, onChange } ) {\n\tconst { flexWrap = 'wrap' } = layout;\n\treturn (\n\t\t<ToggleControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ __( 'Allow to wrap to multiple lines' ) }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tonChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\tflexWrap: value ? 'wrap' : 'nowrap',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tchecked={ flexWrap === 'wrap' }\n\t\t/>\n\t);\n}\n\nfunction OrientationControl( { layout, onChange } ) {\n\tconst {\n\t\torientation = 'horizontal',\n\t\tverticalAlignment,\n\t\tjustifyContent,\n\t} = layout;\n\treturn (\n\t\t<ToggleGroupControl\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName=\"block-editor-hooks__flex-layout-orientation-controls\"\n\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\tvalue={ orientation }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\t// Make sure the vertical alignment and justification are compatible with the new orientation.\n\t\t\t\tlet newVerticalAlignment = verticalAlignment;\n\t\t\t\tlet newJustification = justifyContent;\n\t\t\t\tif ( value === 'horizontal' ) {\n\t\t\t\t\tif ( verticalAlignment === 'space-between' ) {\n\t\t\t\t\t\tnewVerticalAlignment = 'center';\n\t\t\t\t\t}\n\t\t\t\t\tif ( justifyContent === 'stretch' ) {\n\t\t\t\t\t\tnewJustification = 'left';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( verticalAlignment === 'stretch' ) {\n\t\t\t\t\t\tnewVerticalAlignment = 'top';\n\t\t\t\t\t}\n\t\t\t\t\tif ( justifyContent === 'space-between' ) {\n\t\t\t\t\t\tnewJustification = 'left';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn onChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\torientation: value,\n\t\t\t\t\tverticalAlignment: newVerticalAlignment,\n\t\t\t\t\tjustifyContent: newJustification,\n\t\t\t\t} );\n\t\t\t} }\n\t\t>\n\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\ticon={ arrowRight }\n\t\t\t\tvalue=\"horizontal\"\n\t\t\t\tlabel={ __( 'Horizontal' ) }\n\t\t\t/>\n\t\t\t<ToggleGroupControlOption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,EAAG;QAC7B,IAAKb,iBAAiB,KAAK,eAAe,EAAG;UAC5CqC,oBAAoB,GAAG,QAAQ;QAChC;QACA,IAAKxC,cAAc,KAAK,SAAS,EAAG;UACnCyC,gBAAgB,GAAG,MAAM;QAC1B;MACD,CAAC,MAAM;QACN,IAAKtC,iBAAiB,KAAK,SAAS,EAAG;UACtCqC,oBAAoB,GAAG,KAAK;QAC7B;QACA,IAAKxC,cAAc,KAAK,eAAe,EAAG;UACzCyC,gBAAgB,GAAG,MAAM;QAC1B;MACD;MACA,OAAO5E,QAAQ,CAAE;QAChB,GAAGD,MAAM;QACT6B,WAAW,EAAEuB,KAAK;QAClBb,iBAAiB,EAAEqC,oBAAoB;QACvCxC,cAAc,EAAEyC;MACjB,CAAE,CAAC;IACJ,CAAG;IAAAtE,QAAA,gBAEH,IAAA1B,WAAA,CAAA4B,GAAA,EAAClC,WAAA,CAAAkG,0CAA4B;MAC5BX,IAAI,EAAGgB,iBAAY;MACnB1B,KAAK,EAAC,YAAY;MAClBxD,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa;IAAG,CAC5B,CAAC,eACF,IAAAhB,WAAA,CAAA4B,GAAA,EAAClC,WAAA,CAAAkG,0CAA4B;MAC5BX,IAAI,EAAGiB,gBAAW;MAClB3B,KAAK,EAAC,UAAU;MAChBxD,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW;IAAG,CAC1B,CAAC;EAAA,CACiB,CAAC;AAEvB","ignoreList":[]}
|
package/build/private-apis.js
CHANGED
|
@@ -13,11 +13,11 @@ var _resizableBoxPopover = _interopRequireDefault(require("./components/resizabl
|
|
|
13
13
|
var _quickInserter = _interopRequireDefault(require("./components/inserter/quick-inserter"));
|
|
14
14
|
var _searchItems = require("./components/inserter/search-items");
|
|
15
15
|
var _listView = require("./components/list-view");
|
|
16
|
-
var _blockInfoSlotFill = _interopRequireDefault(require("./components/block-info-slot-fill"));
|
|
17
16
|
var _useHasBlockToolbar = require("./components/block-toolbar/use-has-block-toolbar");
|
|
18
17
|
var _utils = require("./hooks/utils");
|
|
19
18
|
var _blockQuickNavigation = _interopRequireDefault(require("./components/block-quick-navigation"));
|
|
20
19
|
var _layout = require("./components/block-list/layout");
|
|
20
|
+
var _blockManager = _interopRequireDefault(require("./components/block-manager"));
|
|
21
21
|
var _blockRemovalWarningModal = require("./components/block-removal-warning-modal");
|
|
22
22
|
var _hooks = require("./hooks");
|
|
23
23
|
var _dimensionsTool = _interopRequireDefault(require("./components/dimensions-tool"));
|
|
@@ -60,11 +60,11 @@ const privateApis = exports.privateApis = {};
|
|
|
60
60
|
normalizeString: _searchItems.normalizeString,
|
|
61
61
|
PrivateListView: _listView.PrivateListView,
|
|
62
62
|
ResizableBoxPopover: _resizableBoxPopover.default,
|
|
63
|
-
BlockInfo: _blockInfoSlotFill.default,
|
|
64
63
|
useHasBlockToolbar: _useHasBlockToolbar.useHasBlockToolbar,
|
|
65
64
|
cleanEmptyObject: _utils.cleanEmptyObject,
|
|
66
65
|
BlockQuickNavigation: _blockQuickNavigation.default,
|
|
67
66
|
LayoutStyle: _layout.LayoutStyle,
|
|
67
|
+
BlockManager: _blockManager.default,
|
|
68
68
|
BlockRemovalWarningModal: _blockRemovalWarningModal.BlockRemovalWarningModal,
|
|
69
69
|
useLayoutClasses: _hooks.useLayoutClasses,
|
|
70
70
|
useLayoutStyles: _hooks.useLayoutStyles,
|
|
@@ -89,7 +89,7 @@ const privateApis = exports.privateApis = {};
|
|
|
89
89
|
__unstableBlockStyleVariationOverridesWithConfig: _hooks.__unstableBlockStyleVariationOverridesWithConfig,
|
|
90
90
|
setBackgroundStyleDefaults: _hooks.setBackgroundStyleDefaults,
|
|
91
91
|
sectionRootClientIdKey: _privateKeys.sectionRootClientIdKey,
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
CommentIconSlotFill: _blockCommentIconSlot.default,
|
|
93
|
+
CommentIconToolbarSlotFill: _blockCommentIconToolbarSlot.default
|
|
94
94
|
});
|
|
95
95
|
//# sourceMappingURL=private-apis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["globalStyles","_interopRequireWildcard","require","_provider","_lockUnlock","_getRichTextValues","_resizableBoxPopover","_interopRequireDefault","_quickInserter","_searchItems","_listView","
|
|
1
|
+
{"version":3,"names":["globalStyles","_interopRequireWildcard","require","_provider","_lockUnlock","_getRichTextValues","_resizableBoxPopover","_interopRequireDefault","_quickInserter","_searchItems","_listView","_useHasBlockToolbar","_utils","_blockQuickNavigation","_layout","_blockManager","_blockRemovalWarningModal","_hooks","_dimensionsTool","_resolutionTool","_textAlignmentControl","_formatEdit","_blockCanvas","_utils2","_useFlashEditableBlocks","_privateKeys","_utils3","_richText","_blockPopover","_library","_publishDateTimePicker","_useSpacingSizes","_useBlockDisplayTitle","_tabbedSidebar","_blockCommentIconSlot","_blockCommentIconToolbarSlot","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","privateApis","exports","lock","ExperimentalBlockCanvas","ExperimentalBlockEditorProvider","getDuotoneFilter","getRichTextValues","PrivateQuickInserter","extractWords","getNormalizedSearchTerms","normalizeString","PrivateListView","ResizableBoxPopover","useHasBlockToolbar","cleanEmptyObject","BlockQuickNavigation","LayoutStyle","BlockManager","BlockRemovalWarningModal","useLayoutClasses","useLayoutStyles","DimensionsTool","ResolutionTool","TabbedSidebar","TextAlignmentControl","usesContextKey","useFlashEditableBlocks","useZoomOut","globalStylesDataKey","globalStylesLinksDataKey","selectBlockPatternsKey","requiresWrapperOnCopy","PrivateRichText","PrivateInserterLibrary","reusableBlocksSelectKey","PrivateBlockPopover","PrivatePublishDateTimePicker","useSpacingSizes","useBlockDisplayTitle","__unstableBlockStyleVariationOverridesWithConfig","setBackgroundStyleDefaults","sectionRootClientIdKey","CommentIconSlotFill","CommentIconToolbarSlotFill"],"sources":["@wordpress/block-editor/src/private-apis.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport * as globalStyles from './components/global-styles';\nimport { ExperimentalBlockEditorProvider } from './components/provider';\nimport { lock } from './lock-unlock';\nimport { getRichTextValues } from './components/rich-text/get-rich-text-values';\nimport ResizableBoxPopover from './components/resizable-box-popover';\nimport { default as PrivateQuickInserter } from './components/inserter/quick-inserter';\nimport {\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n} from './components/inserter/search-items';\nimport { PrivateListView } from './components/list-view';\nimport { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';\nimport { cleanEmptyObject } from './hooks/utils';\nimport BlockQuickNavigation from './components/block-quick-navigation';\nimport { LayoutStyle } from './components/block-list/layout';\nimport BlockManager from './components/block-manager';\nimport { BlockRemovalWarningModal } from './components/block-removal-warning-modal';\nimport {\n\tsetBackgroundStyleDefaults,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n\tuseZoomOut,\n} from './hooks';\nimport DimensionsTool from './components/dimensions-tool';\nimport ResolutionTool from './components/resolution-tool';\nimport TextAlignmentControl from './components/text-alignment-control';\nimport { usesContextKey } from './components/rich-text/format-edit';\nimport { ExperimentalBlockCanvas } from './components/block-canvas';\nimport { getDuotoneFilter } from './components/duotone/utils';\nimport { useFlashEditableBlocks } from './components/use-flash-editable-blocks';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tsectionRootClientIdKey,\n} from './store/private-keys';\nimport { requiresWrapperOnCopy } from './components/writing-flow/utils';\nimport { PrivateRichText } from './components/rich-text/';\nimport { PrivateBlockPopover } from './components/block-popover';\nimport { PrivateInserterLibrary } from './components/inserter/library';\nimport { PrivatePublishDateTimePicker } from './components/publish-date-time-picker';\nimport useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';\nimport useBlockDisplayTitle from './components/block-title/use-block-display-title';\nimport TabbedSidebar from './components/tabbed-sidebar';\nimport CommentIconSlotFill from './components/collab/block-comment-icon-slot';\nimport CommentIconToolbarSlotFill from './components/collab/block-comment-icon-toolbar-slot';\n/**\n * Private @wordpress/block-editor APIs.\n */\nexport const privateApis = {};\nlock( privateApis, {\n\t...globalStyles,\n\tExperimentalBlockCanvas,\n\tExperimentalBlockEditorProvider,\n\tgetDuotoneFilter,\n\tgetRichTextValues,\n\tPrivateQuickInserter,\n\textractWords,\n\tgetNormalizedSearchTerms,\n\tnormalizeString,\n\tPrivateListView,\n\tResizableBoxPopover,\n\tuseHasBlockToolbar,\n\tcleanEmptyObject,\n\tBlockQuickNavigation,\n\tLayoutStyle,\n\tBlockManager,\n\tBlockRemovalWarningModal,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tDimensionsTool,\n\tResolutionTool,\n\tTabbedSidebar,\n\tTextAlignmentControl,\n\tusesContextKey,\n\tuseFlashEditableBlocks,\n\tuseZoomOut,\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\trequiresWrapperOnCopy,\n\tPrivateRichText,\n\tPrivateInserterLibrary,\n\treusableBlocksSelectKey,\n\tPrivateBlockPopover,\n\tPrivatePublishDateTimePicker,\n\tuseSpacingSizes,\n\tuseBlockDisplayTitle,\n\t__unstableBlockStyleVariationOverridesWithConfig,\n\tsetBackgroundStyleDefaults,\n\tsectionRootClientIdKey,\n\tCommentIconSlotFill,\n\tCommentIconToolbarSlotFill,\n} );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,cAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,m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e,EAAfA,yBAAe;EACfC,mBAAmB,EAAnBA,4BAAmB;EACnBC,kBAAkB,EAAlBA,sCAAkB;EAClBC,gBAAgB,EAAhBA,uBAAgB;EAChBC,oBAAoB,EAApBA,6BAAoB;EACpBC,WAAW,EAAXA,mBAAW;EACXC,YAAY,EAAZA,qBAAY;EACZC,wBAAwB,EAAxBA,kDAAwB;EACxBC,gBAAgB,EAAhBA,uBAAgB;EAChBC,eAAe,EAAfA,sBAAe;EACfC,cAAc,EAAdA,uBAAc;EACdC,cAAc,EAAdA,uBAAc;EACdC,aAAa,EAAbA,sBAAa;EACbC,oBAAoB,EAApBA,6BAAoB;EACpBC,cAAc,EAAdA,0BAAc;EACdC,sBAAsB,EAAtBA,8CAAsB;EACtBC,UAAU,EAAVA,iBAAU;EACVC,mBAAmB,EAAnBA,gCAAmB;EACnBC,wBAAwB,EAAxBA,qCAAwB;EACxBC,sBAAsB,EAAtBA,mCAAsB;EACtBC,qBAAqB,EAArBA,6BAAqB;EACrBC,eAAe,EAAfA,yBAAe;EACfC,sBAAsB,EAAtBA,+BAAsB;EACtBC,uBAAuB,EAAvBA,oCAAuB;EACvBC,mBAAmB,EAAnBA,iCAAmB;EACnBC,4BAA4B,EAA5BA,mDAA4B;EAC5BC,eAAe,EAAfA,wBAAe;EACfC,oBAAoB,EAApBA,6BAAoB;EACpBC,gDAAgD,EAAhDA,uDAAgD;EAChDC,0BAA0B,EAA1BA,iCAA0B;EAC1BC,sBAAsB,EAAtBA,mCAAsB;EACtBC,mBAAmB,EAAnBA,6BAAmB;EACnBC,0BAA0B,EAA1BA;AACD,CAAE,CAAC","ignoreList":[]}
|
|
@@ -291,7 +291,7 @@ function mapUserPattern(userPattern, __experimentalUserPatternCategories = []) {
|
|
|
291
291
|
id: userPattern.id,
|
|
292
292
|
type: _utils2.INSERTER_PATTERN_TYPES.user,
|
|
293
293
|
title: userPattern.title.raw,
|
|
294
|
-
categories: userPattern.wp_pattern_category
|
|
294
|
+
categories: userPattern.wp_pattern_category?.map(catId => {
|
|
295
295
|
const category = __experimentalUserPatternCategories.find(({
|
|
296
296
|
id
|
|
297
297
|
}) => id === catId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_selectors","_utils","_utils2","_constants","_lockUnlock","_privateKeys","_getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","exports","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","createRegistrySelector","select","createSelector","order","blockEditingModes","settings","templateLock","blockListSettings","STORE_NAME","__unstableGetEditorMode","zoomLevel","getSectionRootClientId","getEnabledBlockParents","ascending","getBlockParents","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","getClientIdsWithDescendants","clientIdMap","reduce","acc","index","styleOverrides","sort","overrideA","overrideB","_clientIdMap$clientId","_clientIdMap$clientId2","clientIdA","clientIdB","aIndex","bIndex","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","getAllPatterns","unlock","patterns","allowedBlockTypes","getSettings","pattern","inserter","grammar","getGrammar","checkAllowListRecursive","blockName","canInsertBlockType","getAllPatternsDependants","getInsertBlockTypeDependants","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","INSERTER_PATTERN_TYPES","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","getPatternBySlug","patternName","_state$settings$__exp","_state$settings$selec","_id","parseInt","slice","block","getReusableBlocks","__experimentalBlockPatterns","selectBlockPatternsKey","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","arr","findIndex","y","isResolvingPatterns","blockPatternsSelect","reusableBlocksSelect","reusableBlocksSelectKey","undefined","EMPTY_ARRAY","_ref","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getTemplateLock","getParentSectionBlock","isSectionBlock","sectionRootClientId","sectionClientIds","getBlockName","isNavigationMode","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert","getBlockStyles","styles","attributes","style","sectionRootClientIdKey","isZoomOut","getZoomLevel","getClosestAllowedInsertionPoint","blockNames","Array","isArray","areBlockNamesAllowedInClientId","currentName","parentClientId","getBlockRootClientId","getClosestAllowedInsertionPointForPattern","isAllowed","names","getInsertionPoint","insertionPoint"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tisNavigationMode,\n\tgetBlockRootClientId,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n} from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createRegistrySelector( ( select ) =>\n\tcreateSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t\tselect( STORE_NAME ).__unstableGetEditorMode( state ),\n\t\tstate.zoomLevel,\n\t\tgetSectionRootClientId( state ),\n\t] )\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * Overrides are sorted to match the order of the blocks they relate to. This\n * is useful to maintain correct CSS cascade order.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} An array of style ID to style override pairs.\n */\nexport const getStyleOverrides = createSelector(\n\t( state ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst clientIdMap = clientIds.reduce( ( acc, clientId, index ) => {\n\t\t\tacc[ clientId ] = index;\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\treturn [ ...state.styleOverrides ].sort( ( overrideA, overrideB ) => {\n\t\t\t// Once the overrides Map is spread to an array, the first element\n\t\t\t// is the key, while the second is the override itself including\n\t\t\t// the clientId to sort by.\n\t\t\tconst [ , { clientId: clientIdA } ] = overrideA;\n\t\t\tconst [ , { clientId: clientIdB } ] = overrideB;\n\n\t\t\tconst aIndex = clientIdMap[ clientIdA ] ?? -1;\n\t\t\tconst bIndex = clientIdMap[ clientIdB ] ?? -1;\n\n\t\t\treturn aIndex - bIndex;\n\t\t} );\n\t},\n\t( state ) => [ state.blocks.order, state.styleOverrides ]\n);\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( pattern ) => {\n\t\t\t\tconst { inserter = true } = pattern;\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst grammar = getGrammar( pattern );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( grammar, allowedBlockTypes ) &&\n\t\t\t\t\tgrammar.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\nfunction mapUserPattern(\n\tuserPattern,\n\t__experimentalUserPatternCategories = []\n) {\n\treturn {\n\t\tname: `core/block/${ userPattern.id }`,\n\t\tid: userPattern.id,\n\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\ttitle: userPattern.title.raw,\n\t\tcategories: userPattern.wp_pattern_category.map( ( catId ) => {\n\t\t\tconst category = __experimentalUserPatternCategories.find(\n\t\t\t\t( { id } ) => id === catId\n\t\t\t);\n\t\t\treturn category ? category.slug : catId;\n\t\t} ),\n\t\tcontent: userPattern.content.raw,\n\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t};\n}\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nexport const isResolvingPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\tconst blockPatternsSelect = state.settings[ selectBlockPatternsKey ];\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( blockPatternsSelect\n\t\t\t\t? blockPatternsSelect( select ) === undefined\n\t\t\t\t: false ) ||\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select ) === undefined\n\t\t\t\t: false )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select )\n\t\t\t\t: state.settings.__experimentalReusableBlocks ) ?? EMPTY_ARRAY\n\t\t);\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( getTemplateLock( state, current ) === 'contentOnly' ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID of the parent section block.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getParentSectionBlock = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( isSectionBlock( state, current ) ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID is a content locking parent\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {boolean} Whether the block is a content locking parent.\n */\nexport function isSectionBlock( state, clientId ) {\n\tconst sectionRootClientId = getSectionRootClientId( state );\n\tconst sectionClientIds = getBlockOrder( state, sectionRootClientId );\n\treturn (\n\t\tgetBlockName( state, clientId ) === 'core/block' ||\n\t\tgetTemplateLock( state, clientId ) === 'contentOnly' ||\n\t\t( isNavigationMode( state ) && sectionClientIds.includes( clientId ) )\n\t);\n}\n\n/**\n * Retrieves the client ID of the block that is content locked but is\n * currently being temporarily edited as a non-locked block.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited as a non-locked block.\n */\nexport function getTemporarilyEditingAsBlocks( state ) {\n\treturn state.temporarilyEditingAsBlocks;\n}\n\n/**\n * Returns the focus mode that should be reapplied when the user stops editing\n * a content locked blocks as a block without locking.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The focus mode that should be re-set when temporarily editing as blocks stops.\n */\nexport function getTemporarilyEditingFocusModeToRevert( state ) {\n\treturn state.temporarilyEditingFocusModeRevert;\n}\n\n/**\n * Returns the style attributes of multiple blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds An array of block client IDs.\n *\n * @return {Object} An object where keys are client IDs and values are the corresponding block styles or undefined.\n */\nexport const getBlockStyles = createSelector(\n\t( state, clientIds ) =>\n\t\tclientIds.reduce( ( styles, clientId ) => {\n\t\t\tstyles[ clientId ] = state.blocks.attributes.get( clientId )?.style;\n\t\t\treturn styles;\n\t\t}, {} ),\n\t( state, clientIds ) => [\n\t\t...clientIds.map(\n\t\t\t( clientId ) => state.blocks.attributes.get( clientId )?.style\n\t\t),\n\t]\n);\n\n/**\n * Retrieves the client ID of the block which contains the blocks\n * acting as \"sections\" in the editor. This is typically the \"main content\"\n * of the template/post.\n *\n * @param {Object} state Editor state.\n *\n * @return {string|undefined} The section root client ID or undefined if not set.\n */\nexport function getSectionRootClientId( state ) {\n\treturn state.settings?.[ sectionRootClientIdKey ];\n}\n\n/**\n * Returns whether the editor is considered zoomed out.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the editor is zoomed.\n */\nexport function isZoomOut( state ) {\n\treturn state.zoomLevel === 'auto-scaled' || state.zoomLevel < 100;\n}\n\n/**\n * Returns whether the zoom level.\n *\n * @param {Object} state Global application state.\n * @return {number|\"auto-scaled\"} Zoom level.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Finds the closest block where the block is allowed to be inserted.\n *\n * @param {Object} state Editor state.\n * @param {string[] | string} name Block name or names.\n * @param {string} clientId Default insertion point.\n *\n * @return {string} clientID of the closest container when the block name can be inserted.\n */\nexport function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {\n\tconst blockNames = Array.isArray( name ) ? name : [ name ];\n\tconst areBlockNamesAllowedInClientId = ( id ) =>\n\t\tblockNames.every( ( currentName ) =>\n\t\t\tcanInsertBlockType( state, currentName, id )\n\t\t);\n\n\t// If we're trying to insert at the root level and it's not allowed\n\t// Try the section root instead.\n\tif ( ! clientId ) {\n\t\tif ( areBlockNamesAllowedInClientId( clientId ) ) {\n\t\t\treturn clientId;\n\t\t}\n\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif (\n\t\t\tsectionRootClientId &&\n\t\t\tareBlockNamesAllowedInClientId( sectionRootClientId )\n\t\t) {\n\t\t\treturn sectionRootClientId;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Traverse the block tree up until we find a place where we can insert.\n\tlet current = clientId;\n\twhile ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {\n\t\tconst parentClientId = getBlockRootClientId( state, current );\n\t\tcurrent = parentClientId;\n\t}\n\n\treturn current;\n}\n\nexport function getClosestAllowedInsertionPointForPattern(\n\tstate,\n\tpattern,\n\tclientId\n) {\n\tconst { allowedBlockTypes } = getSettings( state );\n\tconst isAllowed = checkAllowListRecursive(\n\t\tgetGrammar( pattern ),\n\t\tallowedBlockTypes\n\t);\n\tif ( ! isAllowed ) {\n\t\treturn null;\n\t}\n\tconst names = getGrammar( pattern ).map( ( { blockName: name } ) => name );\n\treturn getClosestAllowedInsertionPoint( state, names, clientId );\n}\n\n/**\n * Where the point where the next block will be inserted into.\n *\n * @param {Object} state\n * @return {Object} where the insertion point in the block editor is or null if none is set.\n */\nexport function getInsertionPoint( state ) {\n\treturn state.insertionPoint;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAYA,IAAAE,MAAA,GAAAF,OAAA;AAMA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAMA,IAAAO,iBAAA,GAAAP,OAAA;AAnCA;AACA;AACA;;AAGA;AACA;AACA;;AA8BA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,sBAAsBA,CAAEC,KAAK,EAAG;EAC/C,OAAOA,KAAK,CAACD,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,8BAA8BA,CAAED,KAAK,EAAG;EACvD,OAAOA,KAAK,EAAEE,iBAAiB,EAAEC,SAAS;AAC3C;AAEO,SAASC,yBAAyBA,CAAEJ,KAAK,EAAEK,QAAQ,EAAG;EAC5D,OAAOL,KAAK,CAACM,MAAM,CAACC,UAAU,CAACC,GAAG,CAAEH,QAAS,CAAC;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM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,IAAIJ,OAAO,GAAG5I,QAAQ;EACtB,OAAQ4I,OAAO,KAAK,IAAI,IAAI,CAAEuB,8BAA8B,CAAEvB,OAAQ,CAAC,EAAG;IACzE,MAAMyB,cAAc,GAAG,IAAAC,+BAAoB,EAAE3K,KAAK,EAAEiJ,OAAQ,CAAC;IAC7DA,OAAO,GAAGyB,cAAc;EACzB;EAEA,OAAOzB,OAAO;AACf;AAEO,SAAS2B,yCAAyCA,CACxD5K,KAAK,EACLwF,OAAO,EACPnF,QAAQ,EACP;EACD,MAAM;IAAEiF;EAAkB,CAAC,GAAG,IAAAC,sBAAW,EAAEvF,KAAM,CAAC;EAClD,MAAM6K,SAAS,GAAG,IAAAjF,8BAAuB,EACxC,IAAAD,iBAAU,EAAEH,OAAQ,CAAC,EACrBF,iBACD,CAAC;EACD,IAAK,CAAEuF,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EACA,MAAMC,KAAK,GAAG,IAAAnF,iBAAU,EAAEH,OAAQ,CAAC,CAACjB,GAAG,CAAE,CAAE;IAAEsB,SAAS,EAAErB;EAAK,CAAC,KAAMA,IAAK,CAAC;EAC1E,OAAO4F,+BAA+B,CAAEpK,KAAK,EAAE8K,KAAK,EAAEzK,QAAS,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS0K,iBAAiBA,CAAE/K,KAAK,EAAG;EAC1C,OAAOA,KAAK,CAACgL,cAAc;AAC5B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_data","require","_selectors","_utils","_utils2","_constants","_lockUnlock","_privateKeys","_getBlockSettings","isBlockInterfaceHidden","state","getLastInsertedBlocksClientIds","lastBlockInserted","clientIds","getBlockWithoutAttributes","clientId","blocks","byClientId","get","isBlockSubtreeDisabled","isChildSubtreeDisabled","childClientId","getBlockEditingMode","getBlockOrder","every","exports","getEnabledClientIdsTreeUnmemoized","rootClientId","blockOrder","result","innerBlocks","push","getEnabledClientIdsTree","createRegistrySelector","select","createSelector","order","blockEditingModes","settings","templateLock","blockListSettings","STORE_NAME","__unstableGetEditorMode","zoomLevel","getSectionRootClientId","getEnabledBlockParents","ascending","getBlockParents","filter","parent","parents","getRemovalPromptData","removalPromptData","getBlockRemovalRules","blockRemovalRules","getOpenedBlockSettingsMenu","openedBlockSettingsMenu","getStyleOverrides","getClientIdsWithDescendants","clientIdMap","reduce","acc","index","styleOverrides","sort","overrideA","overrideB","_clientIdMap$clientId","_clientIdMap$clientId2","clientIdA","clientIdB","aIndex","bIndex","getRegisteredInserterMediaCategories","registeredInserterMediaCategories","getInserterMediaCategories","inserterMediaCategories","allowedMimeTypes","enableOpenverseMediaCategory","length","coreInserterMediaCategoriesNames","map","name","mergedCategories","includes","category","Object","values","some","mimeType","startsWith","mediaType","hasAllowedPatterns","getAllPatterns","unlock","patterns","allowedBlockTypes","getSettings","pattern","inserter","grammar","getGrammar","checkAllowListRecursive","blockName","canInsertBlockType","getAllPatternsDependants","getInsertBlockTypeDependants","mapUserPattern","userPattern","__experimentalUserPatternCategories","id","type","INSERTER_PATTERN_TYPES","user","title","raw","categories","wp_pattern_category","catId","find","slug","content","syncStatus","wp_pattern_sync_status","getPatternBySlug","patternName","_state$settings$__exp","_state$settings$selec","_id","parseInt","slice","block","getReusableBlocks","__experimentalBlockPatterns","selectBlockPatternsKey","__experimentalReusableBlocks","_state$settings$__exp2","_state$settings$selec2","x","arr","findIndex","y","isResolvingPatterns","blockPatternsSelect","reusableBlocksSelect","reusableBlocksSelectKey","undefined","EMPTY_ARRAY","_ref","getLastFocus","lastFocus","isDragging","getExpandedBlock","expandedBlock","getContentLockingParent","current","getTemplateLock","getParentSectionBlock","isSectionBlock","sectionRootClientId","sectionClientIds","getBlockName","isNavigationMode","getTemporarilyEditingAsBlocks","temporarilyEditingAsBlocks","getTemporarilyEditingFocusModeToRevert","temporarilyEditingFocusModeRevert","getBlockStyles","styles","attributes","style","sectionRootClientIdKey","isZoomOut","getZoomLevel","getClosestAllowedInsertionPoint","blockNames","Array","isArray","areBlockNamesAllowedInClientId","currentName","parentClientId","getBlockRootClientId","getClosestAllowedInsertionPointForPattern","isAllowed","names","getInsertionPoint","insertionPoint"],"sources":["@wordpress/block-editor/src/store/private-selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetBlockOrder,\n\tgetBlockParents,\n\tgetBlockEditingMode,\n\tgetSettings,\n\tcanInsertBlockType,\n\tgetBlockName,\n\tgetTemplateLock,\n\tgetClientIdsWithDescendants,\n\tisNavigationMode,\n\tgetBlockRootClientId,\n} from './selectors';\nimport {\n\tcheckAllowListRecursive,\n\tgetAllPatternsDependants,\n\tgetInsertBlockTypeDependants,\n\tgetGrammar,\n} from './utils';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\nimport { STORE_NAME } from './constants';\nimport { unlock } from '../lock-unlock';\nimport {\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tsectionRootClientIdKey,\n} from './private-keys';\n\nexport { getBlockSettings } from './get-block-settings';\n\n/**\n * Returns true if the block interface is hidden, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the block toolbar is hidden.\n */\nexport function isBlockInterfaceHidden( state ) {\n\treturn state.isBlockInterfaceHidden;\n}\n\n/**\n * Gets the client ids of the last inserted blocks.\n *\n * @param {Object} state Global application state.\n * @return {Array|undefined} Client Ids of the last inserted block(s).\n */\nexport function getLastInsertedBlocksClientIds( state ) {\n\treturn state?.lastBlockInserted?.clientIds;\n}\n\nexport function getBlockWithoutAttributes( state, clientId ) {\n\treturn state.blocks.byClientId.get( clientId );\n}\n\n/**\n * Returns true if all of the descendants of a block with the given client ID\n * have an editing mode of 'disabled', or false otherwise.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n *\n * @return {boolean} Whether the block descendants are disabled.\n */\nexport const isBlockSubtreeDisabled = ( state, clientId ) => {\n\tconst isChildSubtreeDisabled = ( childClientId ) => {\n\t\treturn (\n\t\t\tgetBlockEditingMode( state, childClientId ) === 'disabled' &&\n\t\t\tgetBlockOrder( state, childClientId ).every(\n\t\t\t\tisChildSubtreeDisabled\n\t\t\t)\n\t\t);\n\t};\n\treturn getBlockOrder( state, clientId ).every( isChildSubtreeDisabled );\n};\n\nfunction getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {\n\tconst blockOrder = getBlockOrder( state, rootClientId );\n\tconst result = [];\n\n\tfor ( const clientId of blockOrder ) {\n\t\tconst innerBlocks = getEnabledClientIdsTreeUnmemoized(\n\t\t\tstate,\n\t\t\tclientId\n\t\t);\n\t\tif ( getBlockEditingMode( state, clientId ) !== 'disabled' ) {\n\t\t\tresult.push( { clientId, innerBlocks } );\n\t\t} else {\n\t\t\tresult.push( ...innerBlocks );\n\t\t}\n\t}\n\n\treturn result;\n}\n\n/**\n * Returns a tree of block objects with only clientID and innerBlocks set.\n * Blocks with a 'disabled' editing mode are not included.\n *\n * @param {Object} state Global application state.\n * @param {?string} rootClientId Optional root client ID of block list.\n *\n * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.\n */\nexport const getEnabledClientIdsTree = createRegistrySelector( ( select ) =>\n\tcreateSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [\n\t\tstate.blocks.order,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t\tselect( STORE_NAME ).__unstableGetEditorMode( state ),\n\t\tstate.zoomLevel,\n\t\tgetSectionRootClientId( state ),\n\t] )\n);\n\n/**\n * Returns a list of a given block's ancestors, from top to bottom. Blocks with\n * a 'disabled' editing mode are excluded.\n *\n * @see getBlockParents\n *\n * @param {Object} state Global application state.\n * @param {string} clientId The block client ID.\n * @param {boolean} ascending Order results from bottom to top (true) or top\n * to bottom (false).\n */\nexport const getEnabledBlockParents = createSelector(\n\t( state, clientId, ascending = false ) => {\n\t\treturn getBlockParents( state, clientId, ascending ).filter(\n\t\t\t( parent ) => getBlockEditingMode( state, parent ) !== 'disabled'\n\t\t);\n\t},\n\t( state ) => [\n\t\tstate.blocks.parents,\n\t\tstate.blockEditingModes,\n\t\tstate.settings.templateLock,\n\t\tstate.blockListSettings,\n\t]\n);\n\n/**\n * Selector that returns the data needed to display a prompt when certain\n * blocks are removed, or `false` if no such prompt is requested.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object|false} Data for removal prompt display, if any.\n */\nexport function getRemovalPromptData( state ) {\n\treturn state.removalPromptData;\n}\n\n/**\n * Returns true if removal prompt exists, or false otherwise.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether removal prompt exists.\n */\nexport function getBlockRemovalRules( state ) {\n\treturn state.blockRemovalRules;\n}\n\n/**\n * Returns the client ID of the block settings menu that is currently open.\n *\n * @param {Object} state Global application state.\n * @return {string|null} The client ID of the block menu that is currently open.\n */\nexport function getOpenedBlockSettingsMenu( state ) {\n\treturn state.openedBlockSettingsMenu;\n}\n\n/**\n * Returns all style overrides, intended to be merged with global editor styles.\n *\n * Overrides are sorted to match the order of the blocks they relate to. This\n * is useful to maintain correct CSS cascade order.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} An array of style ID to style override pairs.\n */\nexport const getStyleOverrides = createSelector(\n\t( state ) => {\n\t\tconst clientIds = getClientIdsWithDescendants( state );\n\t\tconst clientIdMap = clientIds.reduce( ( acc, clientId, index ) => {\n\t\t\tacc[ clientId ] = index;\n\t\t\treturn acc;\n\t\t}, {} );\n\n\t\treturn [ ...state.styleOverrides ].sort( ( overrideA, overrideB ) => {\n\t\t\t// Once the overrides Map is spread to an array, the first element\n\t\t\t// is the key, while the second is the override itself including\n\t\t\t// the clientId to sort by.\n\t\t\tconst [ , { clientId: clientIdA } ] = overrideA;\n\t\t\tconst [ , { clientId: clientIdB } ] = overrideB;\n\n\t\t\tconst aIndex = clientIdMap[ clientIdA ] ?? -1;\n\t\t\tconst bIndex = clientIdMap[ clientIdB ] ?? -1;\n\n\t\t\treturn aIndex - bIndex;\n\t\t} );\n\t},\n\t( state ) => [ state.blocks.order, state.styleOverrides ]\n);\n\n/** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */\n/**\n * Returns the registered inserter media categories through the public API.\n *\n * @param {Object} state Editor state.\n *\n * @return {InserterMediaCategory[]} Inserter media categories.\n */\nexport function getRegisteredInserterMediaCategories( state ) {\n\treturn state.registeredInserterMediaCategories;\n}\n\n/**\n * Returns an array containing the allowed inserter media categories.\n * It merges the registered media categories from extenders with the\n * core ones. It also takes into account the allowed `mime_types`, which\n * can be altered by `upload_mimes` filter and restrict some of them.\n *\n * @param {Object} state Global application state.\n *\n * @return {InserterMediaCategory[]} Client IDs of descendants.\n */\nexport const getInserterMediaCategories = createSelector(\n\t( state ) => {\n\t\tconst {\n\t\t\tsettings: {\n\t\t\t\tinserterMediaCategories,\n\t\t\t\tallowedMimeTypes,\n\t\t\t\tenableOpenverseMediaCategory,\n\t\t\t},\n\t\t\tregisteredInserterMediaCategories,\n\t\t} = state;\n\t\t// The allowed `mime_types` can be altered by `upload_mimes` filter and restrict\n\t\t// some of them. In this case we shouldn't add the category to the available media\n\t\t// categories list in the inserter.\n\t\tif (\n\t\t\t( ! inserterMediaCategories &&\n\t\t\t\t! registeredInserterMediaCategories.length ) ||\n\t\t\t! allowedMimeTypes\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst coreInserterMediaCategoriesNames =\n\t\t\tinserterMediaCategories?.map( ( { name } ) => name ) || [];\n\t\tconst mergedCategories = [\n\t\t\t...( inserterMediaCategories || [] ),\n\t\t\t...( registeredInserterMediaCategories || [] ).filter(\n\t\t\t\t( { name } ) =>\n\t\t\t\t\t! coreInserterMediaCategoriesNames.includes( name )\n\t\t\t),\n\t\t];\n\t\treturn mergedCategories.filter( ( category ) => {\n\t\t\t// Check if Openverse category is enabled.\n\t\t\tif (\n\t\t\t\t! enableOpenverseMediaCategory &&\n\t\t\t\tcategory.name === 'openverse'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn Object.values( allowedMimeTypes ).some( ( mimeType ) =>\n\t\t\t\tmimeType.startsWith( `${ category.mediaType }/` )\n\t\t\t);\n\t\t} );\n\t},\n\t( state ) => [\n\t\tstate.settings.inserterMediaCategories,\n\t\tstate.settings.allowedMimeTypes,\n\t\tstate.settings.enableOpenverseMediaCategory,\n\t\tstate.registeredInserterMediaCategories,\n\t]\n);\n\n/**\n * Returns whether there is at least one allowed pattern for inner blocks children.\n * This is useful for deferring the parsing of all patterns until needed.\n *\n * @param {Object} state Editor state.\n * @param {string} [rootClientId=null] Target root client ID.\n *\n * @return {boolean} If there is at least one allowed pattern.\n */\nexport const hasAllowedPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, rootClientId = null ) => {\n\t\t\tconst { getAllPatterns } = unlock( select( STORE_NAME ) );\n\t\t\tconst patterns = getAllPatterns();\n\t\t\tconst { allowedBlockTypes } = getSettings( state );\n\t\t\treturn patterns.some( ( pattern ) => {\n\t\t\t\tconst { inserter = true } = pattern;\n\t\t\t\tif ( ! inserter ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tconst grammar = getGrammar( pattern );\n\t\t\t\treturn (\n\t\t\t\t\tcheckAllowListRecursive( grammar, allowedBlockTypes ) &&\n\t\t\t\t\tgrammar.every( ( { name: blockName } ) =>\n\t\t\t\t\t\tcanInsertBlockType( state, blockName, rootClientId )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t( state, rootClientId ) => [\n\t\t\t...getAllPatternsDependants( select )( state ),\n\t\t\t...getInsertBlockTypeDependants( select )( state, rootClientId ),\n\t\t]\n\t)\n);\n\nfunction mapUserPattern(\n\tuserPattern,\n\t__experimentalUserPatternCategories = []\n) {\n\treturn {\n\t\tname: `core/block/${ userPattern.id }`,\n\t\tid: userPattern.id,\n\t\ttype: INSERTER_PATTERN_TYPES.user,\n\t\ttitle: userPattern.title.raw,\n\t\tcategories: userPattern.wp_pattern_category?.map( ( catId ) => {\n\t\t\tconst category = __experimentalUserPatternCategories.find(\n\t\t\t\t( { id } ) => id === catId\n\t\t\t);\n\t\t\treturn category ? category.slug : catId;\n\t\t} ),\n\t\tcontent: userPattern.content.raw,\n\t\tsyncStatus: userPattern.wp_pattern_sync_status,\n\t};\n}\n\nexport const getPatternBySlug = createRegistrySelector( ( select ) =>\n\tcreateSelector(\n\t\t( state, patternName ) => {\n\t\t\t// Only fetch reusable blocks if we know we need them. To do: maybe\n\t\t\t// use the entity record API to retrieve the block by slug.\n\t\t\tif ( patternName?.startsWith( 'core/block/' ) ) {\n\t\t\t\tconst _id = parseInt(\n\t\t\t\t\tpatternName.slice( 'core/block/'.length ),\n\t\t\t\t\t10\n\t\t\t\t);\n\t\t\t\tconst block = unlock( select( STORE_NAME ) )\n\t\t\t\t\t.getReusableBlocks()\n\t\t\t\t\t.find( ( { id } ) => id === _id );\n\n\t\t\t\tif ( ! block ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn mapUserPattern(\n\t\t\t\t\tblock,\n\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t// This setting is left for back compat.\n\t\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ??\n\t\t\t\t\t[] ),\n\t\t\t].find( ( { name } ) => name === patternName );\n\t\t},\n\t\t( state, patternName ) =>\n\t\t\tpatternName?.startsWith( 'core/block/' )\n\t\t\t\t? [\n\t\t\t\t\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t\t\t\t\t\tstate.settings.__experimentalReusableBlocks,\n\t\t\t\t ]\n\t\t\t\t: [\n\t\t\t\t\t\tstate.settings.__experimentalBlockPatterns,\n\t\t\t\t\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\t\t\t ]\n\t)\n);\n\nexport const getAllPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\treturn [\n\t\t\t...unlock( select( STORE_NAME ) )\n\t\t\t\t.getReusableBlocks()\n\t\t\t\t.map( ( userPattern ) =>\n\t\t\t\t\tmapUserPattern(\n\t\t\t\t\t\tuserPattern,\n\t\t\t\t\t\tstate.settings.__experimentalUserPatternCategories\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t// This setting is left for back compat.\n\t\t\t...( state.settings.__experimentalBlockPatterns ?? [] ),\n\t\t\t...( state.settings[ selectBlockPatternsKey ]?.( select ) ?? [] ),\n\t\t].filter(\n\t\t\t( x, index, arr ) =>\n\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nexport const isResolvingPatterns = createRegistrySelector( ( select ) =>\n\tcreateSelector( ( state ) => {\n\t\tconst blockPatternsSelect = state.settings[ selectBlockPatternsKey ];\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( blockPatternsSelect\n\t\t\t\t? blockPatternsSelect( select ) === undefined\n\t\t\t\t: false ) ||\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select ) === undefined\n\t\t\t\t: false )\n\t\t);\n\t}, getAllPatternsDependants( select ) )\n);\n\nconst EMPTY_ARRAY = [];\n\nexport const getReusableBlocks = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst reusableBlocksSelect = state.settings[ reusableBlocksSelectKey ];\n\t\treturn (\n\t\t\t( reusableBlocksSelect\n\t\t\t\t? reusableBlocksSelect( select )\n\t\t\t\t: state.settings.__experimentalReusableBlocks ) ?? EMPTY_ARRAY\n\t\t);\n\t}\n);\n\n/**\n * Returns the element of the last element that had focus when focus left the editor canvas.\n *\n * @param {Object} state Block editor state.\n *\n * @return {Object} Element.\n */\nexport function getLastFocus( state ) {\n\treturn state.lastFocus;\n}\n\n/**\n * Returns true if the user is dragging anything, or false otherwise. It is possible for a\n * user to be dragging data from outside of the editor, so this selector is separate from\n * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether user is dragging.\n */\nexport function isDragging( state ) {\n\treturn state.isDragging;\n}\n\n/**\n * Retrieves the expanded block from the state.\n *\n * @param {Object} state Block editor state.\n *\n * @return {string|null} The client ID of the expanded block, if set.\n */\nexport function getExpandedBlock( state ) {\n\treturn state.expandedBlock;\n}\n\n/**\n * Retrieves the client ID of the ancestor block that is content locking the block\n * with the provided client ID.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getContentLockingParent = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( getTemplateLock( state, current ) === 'contentOnly' ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID of the parent section block.\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {?string} Client ID of the ancestor block that is content locking the block.\n */\nexport const getParentSectionBlock = ( state, clientId ) => {\n\tlet current = clientId;\n\tlet result;\n\twhile ( ! result && ( current = state.blocks.parents.get( current ) ) ) {\n\t\tif ( isSectionBlock( state, current ) ) {\n\t\t\tresult = current;\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * Retrieves the client ID is a content locking parent\n *\n * @param {Object} state Global application state.\n * @param {string} clientId Client Id of the block.\n *\n * @return {boolean} Whether the block is a content locking parent.\n */\nexport function isSectionBlock( state, clientId ) {\n\tconst sectionRootClientId = getSectionRootClientId( state );\n\tconst sectionClientIds = getBlockOrder( state, sectionRootClientId );\n\treturn (\n\t\tgetBlockName( state, clientId ) === 'core/block' ||\n\t\tgetTemplateLock( state, clientId ) === 'contentOnly' ||\n\t\t( isNavigationMode( state ) && sectionClientIds.includes( clientId ) )\n\t);\n}\n\n/**\n * Retrieves the client ID of the block that is content locked but is\n * currently being temporarily edited as a non-locked block.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The client ID of the block being temporarily edited as a non-locked block.\n */\nexport function getTemporarilyEditingAsBlocks( state ) {\n\treturn state.temporarilyEditingAsBlocks;\n}\n\n/**\n * Returns the focus mode that should be reapplied when the user stops editing\n * a content locked blocks as a block without locking.\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} The focus mode that should be re-set when temporarily editing as blocks stops.\n */\nexport function getTemporarilyEditingFocusModeToRevert( state ) {\n\treturn state.temporarilyEditingFocusModeRevert;\n}\n\n/**\n * Returns the style attributes of multiple blocks.\n *\n * @param {Object} state Global application state.\n * @param {string[]} clientIds An array of block client IDs.\n *\n * @return {Object} An object where keys are client IDs and values are the corresponding block styles or undefined.\n */\nexport const getBlockStyles = createSelector(\n\t( state, clientIds ) =>\n\t\tclientIds.reduce( ( styles, clientId ) => {\n\t\t\tstyles[ clientId ] = state.blocks.attributes.get( clientId )?.style;\n\t\t\treturn styles;\n\t\t}, {} ),\n\t( state, clientIds ) => [\n\t\t...clientIds.map(\n\t\t\t( clientId ) => state.blocks.attributes.get( clientId )?.style\n\t\t),\n\t]\n);\n\n/**\n * Retrieves the client ID of the block which contains the blocks\n * acting as \"sections\" in the editor. This is typically the \"main content\"\n * of the template/post.\n *\n * @param {Object} state Editor state.\n *\n * @return {string|undefined} The section root client ID or undefined if not set.\n */\nexport function getSectionRootClientId( state ) {\n\treturn state.settings?.[ sectionRootClientIdKey ];\n}\n\n/**\n * Returns whether the editor is considered zoomed out.\n *\n * @param {Object} state Global application state.\n * @return {boolean} Whether the editor is zoomed.\n */\nexport function isZoomOut( state ) {\n\treturn state.zoomLevel === 'auto-scaled' || state.zoomLevel < 100;\n}\n\n/**\n * Returns whether the zoom level.\n *\n * @param {Object} state Global application state.\n * @return {number|\"auto-scaled\"} Zoom level.\n */\nexport function getZoomLevel( state ) {\n\treturn state.zoomLevel;\n}\n\n/**\n * Finds the closest block where the block is allowed to be inserted.\n *\n * @param {Object} state Editor state.\n * @param {string[] | string} name Block name or names.\n * @param {string} clientId Default insertion point.\n *\n * @return {string} clientID of the closest container when the block name can be inserted.\n */\nexport function getClosestAllowedInsertionPoint( state, name, clientId = '' ) {\n\tconst blockNames = Array.isArray( name ) ? name : [ name ];\n\tconst areBlockNamesAllowedInClientId = ( id ) =>\n\t\tblockNames.every( ( currentName ) =>\n\t\t\tcanInsertBlockType( state, currentName, id )\n\t\t);\n\n\t// If we're trying to insert at the root level and it's not allowed\n\t// Try the section root instead.\n\tif ( ! clientId ) {\n\t\tif ( areBlockNamesAllowedInClientId( clientId ) ) {\n\t\t\treturn clientId;\n\t\t}\n\n\t\tconst sectionRootClientId = getSectionRootClientId( state );\n\t\tif (\n\t\t\tsectionRootClientId &&\n\t\t\tareBlockNamesAllowedInClientId( sectionRootClientId )\n\t\t) {\n\t\t\treturn sectionRootClientId;\n\t\t}\n\t\treturn null;\n\t}\n\n\t// Traverse the block tree up until we find a place where we can insert.\n\tlet current = clientId;\n\twhile ( current !== null && ! areBlockNamesAllowedInClientId( current ) ) {\n\t\tconst parentClientId = getBlockRootClientId( state, current );\n\t\tcurrent = parentClientId;\n\t}\n\n\treturn current;\n}\n\nexport function getClosestAllowedInsertionPointForPattern(\n\tstate,\n\tpattern,\n\tclientId\n) {\n\tconst { allowedBlockTypes } = getSettings( state );\n\tconst isAllowed = checkAllowListRecursive(\n\t\tgetGrammar( pattern ),\n\t\tallowedBlockTypes\n\t);\n\tif ( ! isAllowed ) {\n\t\treturn null;\n\t}\n\tconst names = getGrammar( pattern ).map( ( { blockName: name } ) => name );\n\treturn getClosestAllowedInsertionPoint( state, names, clientId );\n}\n\n/**\n * Where the point where the next block will be inserted into.\n *\n * @param {Object} state\n * @return {Object} where the insertion point in the block editor is or null if none is set.\n */\nexport function getInsertionPoint( state ) {\n\treturn state.insertionPoint;\n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uB,EACxC,IAAAD,iBAAU,EAAEH,OAAQ,CAAC,EACrBF,iBACD,CAAC;EACD,IAAK,CAAEuF,SAAS,EAAG;IAClB,OAAO,IAAI;EACZ;EACA,MAAMC,KAAK,GAAG,IAAAnF,iBAAU,EAAEH,OAAQ,CAAC,CAACjB,GAAG,CAAE,CAAE;IAAEsB,SAAS,EAAErB;EAAK,CAAC,KAAMA,IAAK,CAAC;EAC1E,OAAO4F,+BAA+B,CAAEpK,KAAK,EAAE8K,KAAK,EAAEzK,QAAS,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS0K,iBAAiBA,CAAE/K,KAAK,EAAG;EAC1C,OAAOA,KAAK,CAACgL,cAAc;AAC5B","ignoreList":[]}
|
package/build/store/selectors.js
CHANGED
|
@@ -2397,6 +2397,9 @@ function isNavigationMode(state) {
|
|
|
2397
2397
|
*/
|
|
2398
2398
|
const __unstableGetEditorMode = exports.__unstableGetEditorMode = (0, _data.createRegistrySelector)(select => state => {
|
|
2399
2399
|
var _state$settings$edito;
|
|
2400
|
+
if (!window?.__experimentalEditorWriteMode) {
|
|
2401
|
+
return 'edit';
|
|
2402
|
+
}
|
|
2400
2403
|
return (_state$settings$edito = state.settings.editorTool) !== null && _state$settings$edito !== void 0 ? _state$settings$edito : select(_preferences.store).get('core', 'editorTool');
|
|
2401
2404
|
});
|
|
2402
2405
|
|