@wordpress/block-editor 15.10.1-next.79a2f3cdd.0 → 15.10.1-next.v.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/build/components/block-bindings/attribute-control.cjs +1 -1
- package/build/components/block-bindings/attribute-control.cjs.map +1 -1
- package/build/components/block-bindings/source-fields-list.cjs +1 -1
- package/build/components/block-bindings/source-fields-list.cjs.map +1 -1
- package/build/components/block-edit/context.cjs +5 -5
- package/build/components/block-edit/context.cjs.map +1 -1
- package/build/components/block-list/block.cjs +24 -12
- package/build/components/block-list/block.cjs.map +3 -3
- package/build/components/block-list/use-block-props/index.cjs +8 -2
- package/build/components/block-list/use-block-props/index.cjs.map +2 -2
- package/build/components/block-tools/index.cjs +82 -70
- package/build/components/block-tools/index.cjs.map +2 -2
- package/build/components/block-visibility/block-visibility-info.cjs +0 -59
- package/build/components/block-visibility/block-visibility-info.cjs.map +3 -3
- package/build/components/block-visibility/constants.cjs +54 -0
- package/build/components/block-visibility/constants.cjs.map +7 -0
- package/build/components/block-visibility/index.cjs +15 -4
- package/build/components/block-visibility/index.cjs.map +3 -3
- package/build/components/block-visibility/modal.cjs +397 -0
- package/build/components/block-visibility/modal.cjs.map +7 -0
- package/build/components/block-visibility/toolbar.cjs +1 -1
- package/build/components/block-visibility/toolbar.cjs.map +2 -2
- package/build/components/block-visibility/use-block-visibility.cjs +65 -0
- package/build/components/block-visibility/use-block-visibility.cjs.map +7 -0
- package/build/components/block-visibility/utils.cjs +81 -0
- package/build/components/block-visibility/utils.cjs.map +7 -0
- package/build/components/block-visibility/viewport-menu-item.cjs +61 -0
- package/build/components/block-visibility/viewport-menu-item.cjs.map +7 -0
- package/build/components/block-visibility/viewport-toolbar.cjs +89 -0
- package/build/components/block-visibility/viewport-toolbar.cjs.map +7 -0
- package/build/components/collab/block-comment-icon-slot.cjs +1 -1
- package/build/components/collab/block-comment-icon-slot.cjs.map +1 -1
- package/build/components/collab/block-comment-icon-toolbar-slot.cjs +1 -1
- package/build/components/collab/block-comment-icon-toolbar-slot.cjs.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.cjs.map +1 -1
- package/build/components/inserter/menu.cjs +6 -2
- package/build/components/inserter/menu.cjs.map +2 -2
- package/build/components/inspector-controls/groups.cjs +1 -1
- package/build/components/inspector-controls/groups.cjs.map +1 -1
- package/build/components/inspector-controls-tabs/content-tab.cjs +1 -1
- package/build/components/inspector-controls-tabs/content-tab.cjs.map +2 -2
- package/build/components/list-view/block-select-button.cjs +2 -2
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/block.cjs +39 -22
- package/build/components/list-view/block.cjs.map +2 -2
- package/build/components/list-view/index.cjs +11 -6
- package/build/components/list-view/index.cjs.map +2 -2
- package/build/components/list-view/utils.cjs +24 -17
- package/build/components/list-view/utils.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/input-rules.cjs +13 -1
- package/build/components/rich-text/event-listeners/input-rules.cjs.map +2 -2
- package/build/components/rich-text/format-edit.cjs +1 -1
- package/build/components/rich-text/format-edit.cjs.map +1 -1
- package/build/components/rich-text/index.cjs +2 -2
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/url-input/index.cjs +2 -0
- package/build/components/url-input/index.cjs.map +2 -2
- package/build/components/use-block-commands/index.cjs +1 -1
- package/build/components/use-block-commands/index.cjs.map +2 -2
- package/build/components/writing-flow/utils.cjs +1 -1
- package/build/components/writing-flow/utils.cjs.map +1 -1
- package/build/hooks/block-fields/index.cjs +76 -167
- package/build/hooks/block-fields/index.cjs.map +2 -2
- package/build/hooks/block-fields/link/index.cjs +13 -23
- package/build/hooks/block-fields/link/index.cjs.map +2 -2
- package/build/hooks/block-fields/media/index.cjs +32 -58
- package/build/hooks/block-fields/media/index.cjs.map +2 -2
- package/build/hooks/block-fields/rich-text/index.cjs +1 -5
- package/build/hooks/block-fields/rich-text/index.cjs.map +2 -2
- package/build/hooks/cross-origin-isolation.cjs +102 -0
- package/build/hooks/cross-origin-isolation.cjs.map +7 -0
- package/build/hooks/fit-text.cjs +1 -1
- package/build/hooks/fit-text.cjs.map +1 -1
- package/build/hooks/index.cjs +1 -0
- package/build/hooks/index.cjs.map +2 -2
- package/build/layouts/flex.cjs +6 -2
- package/build/layouts/flex.cjs.map +2 -2
- package/build/store/private-keys.cjs +10 -10
- package/build/store/private-keys.cjs.map +1 -1
- package/build/store/private-selectors.cjs +33 -1
- package/build/store/private-selectors.cjs.map +3 -3
- package/build/store/reducer.cjs +1 -1
- package/build/store/reducer.cjs.map +1 -1
- package/build/store/selectors.cjs +7 -8
- package/build/store/selectors.cjs.map +2 -2
- package/build/store/utils.cjs +1 -1
- package/build/store/utils.cjs.map +1 -1
- package/build-module/components/block-bindings/attribute-control.mjs +1 -1
- package/build-module/components/block-bindings/attribute-control.mjs.map +1 -1
- package/build-module/components/block-bindings/source-fields-list.mjs +1 -1
- package/build-module/components/block-bindings/source-fields-list.mjs.map +1 -1
- package/build-module/components/block-edit/context.mjs +5 -5
- package/build-module/components/block-edit/context.mjs.map +1 -1
- package/build-module/components/block-list/block.mjs +24 -12
- package/build-module/components/block-list/block.mjs.map +3 -3
- package/build-module/components/block-list/use-block-props/index.mjs +8 -2
- package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
- package/build-module/components/block-tools/index.mjs +85 -73
- package/build-module/components/block-tools/index.mjs.map +2 -2
- package/build-module/components/block-visibility/block-visibility-info.mjs +0 -59
- package/build-module/components/block-visibility/block-visibility-info.mjs.map +3 -3
- package/build-module/components/block-visibility/constants.mjs +28 -0
- package/build-module/components/block-visibility/constants.mjs.map +7 -0
- package/build-module/components/block-visibility/index.mjs +13 -4
- package/build-module/components/block-visibility/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs +384 -0
- package/build-module/components/block-visibility/modal.mjs.map +7 -0
- package/build-module/components/block-visibility/toolbar.mjs +1 -1
- package/build-module/components/block-visibility/toolbar.mjs.map +2 -2
- package/build-module/components/block-visibility/use-block-visibility.mjs +44 -0
- package/build-module/components/block-visibility/use-block-visibility.mjs.map +7 -0
- package/build-module/components/block-visibility/utils.mjs +55 -0
- package/build-module/components/block-visibility/utils.mjs.map +7 -0
- package/build-module/components/block-visibility/viewport-menu-item.mjs +40 -0
- package/build-module/components/block-visibility/viewport-menu-item.mjs.map +7 -0
- package/build-module/components/block-visibility/viewport-toolbar.mjs +68 -0
- package/build-module/components/block-visibility/viewport-toolbar.mjs.map +7 -0
- package/build-module/components/collab/block-comment-icon-slot.mjs +1 -1
- package/build-module/components/collab/block-comment-icon-slot.mjs.map +1 -1
- package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs +1 -1
- package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.mjs.map +1 -1
- package/build-module/components/inserter/menu.mjs +6 -2
- package/build-module/components/inserter/menu.mjs.map +2 -2
- package/build-module/components/inspector-controls/groups.mjs +1 -1
- package/build-module/components/inspector-controls/groups.mjs.map +1 -1
- package/build-module/components/inspector-controls-tabs/content-tab.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/content-tab.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +2 -2
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/block.mjs +39 -22
- package/build-module/components/list-view/block.mjs.map +2 -2
- package/build-module/components/list-view/index.mjs +11 -7
- package/build-module/components/list-view/index.mjs.map +2 -2
- package/build-module/components/list-view/utils.mjs +24 -17
- package/build-module/components/list-view/utils.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/input-rules.mjs +13 -1
- package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
- package/build-module/components/rich-text/format-edit.mjs +1 -1
- package/build-module/components/rich-text/format-edit.mjs.map +1 -1
- package/build-module/components/rich-text/index.mjs +2 -2
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/url-input/index.mjs +2 -0
- package/build-module/components/url-input/index.mjs.map +2 -2
- package/build-module/components/use-block-commands/index.mjs +1 -1
- package/build-module/components/use-block-commands/index.mjs.map +2 -2
- package/build-module/components/writing-flow/utils.mjs +1 -1
- package/build-module/components/writing-flow/utils.mjs.map +1 -1
- package/build-module/hooks/block-fields/index.mjs +76 -167
- package/build-module/hooks/block-fields/index.mjs.map +2 -2
- package/build-module/hooks/block-fields/link/index.mjs +13 -23
- package/build-module/hooks/block-fields/link/index.mjs.map +2 -2
- package/build-module/hooks/block-fields/media/index.mjs +32 -58
- package/build-module/hooks/block-fields/media/index.mjs.map +2 -2
- package/build-module/hooks/block-fields/rich-text/index.mjs +1 -5
- package/build-module/hooks/block-fields/rich-text/index.mjs.map +2 -2
- package/build-module/hooks/cross-origin-isolation.mjs +100 -0
- package/build-module/hooks/cross-origin-isolation.mjs.map +7 -0
- package/build-module/hooks/fit-text.mjs +1 -1
- package/build-module/hooks/fit-text.mjs.map +1 -1
- package/build-module/hooks/index.mjs +1 -0
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/layouts/flex.mjs +6 -2
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/store/private-keys.mjs +10 -10
- package/build-module/store/private-keys.mjs.map +1 -1
- package/build-module/store/private-selectors.mjs +34 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +1 -1
- package/build-module/store/reducer.mjs.map +1 -1
- package/build-module/store/selectors.mjs +7 -8
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/store/utils.mjs +1 -1
- package/build-module/store/utils.mjs.map +1 -1
- package/build-style/content-rtl.css +4 -1
- package/build-style/content.css +4 -1
- package/build-style/style-rtl.css +54 -1
- package/build-style/style.css +54 -1
- package/package.json +39 -39
- package/src/components/block-bindings/attribute-control.js +1 -1
- package/src/components/block-bindings/source-fields-list.js +1 -1
- package/src/components/block-list/block.js +23 -9
- package/src/components/block-list/content.scss +4 -1
- package/src/components/block-list/use-block-props/index.js +10 -2
- package/src/components/block-toolbar/style.scss +0 -1
- package/src/components/block-tools/index.js +45 -33
- package/src/components/block-tools/style.scss +10 -0
- package/src/components/block-visibility/block-visibility-info.js +0 -1
- package/src/components/block-visibility/constants.js +33 -0
- package/src/components/block-visibility/index.js +21 -2
- package/src/components/block-visibility/modal.js +358 -0
- package/src/components/block-visibility/style.scss +58 -0
- package/src/components/block-visibility/test/use-block-visibility.js +316 -0
- package/src/components/block-visibility/test/utils.js +266 -0
- package/src/components/block-visibility/toolbar.js +1 -1
- package/src/components/block-visibility/use-block-visibility.js +70 -0
- package/src/components/block-visibility/utils.js +95 -0
- package/src/components/block-visibility/viewport-menu-item.js +42 -0
- package/src/components/block-visibility/viewport-toolbar.js +88 -0
- package/src/components/inner-blocks/use-inner-block-template-sync.js +1 -1
- package/src/components/inserter/menu.js +6 -2
- package/src/components/inspector-controls-tabs/content-tab.js +0 -1
- package/src/components/list-view/block-select-button.js +2 -2
- package/src/components/list-view/block.js +47 -25
- package/src/components/list-view/index.js +15 -11
- package/src/components/list-view/utils.js +31 -23
- package/src/components/rich-text/event-listeners/input-rules.js +17 -0
- package/src/components/rich-text/index.js +1 -1
- package/src/components/url-input/index.js +2 -0
- package/src/components/use-block-commands/index.js +4 -3
- package/src/hooks/block-fields/index.js +104 -225
- package/src/hooks/block-fields/link/index.js +13 -39
- package/src/hooks/block-fields/media/index.js +31 -90
- package/src/hooks/block-fields/rich-text/index.js +1 -5
- package/src/hooks/block-fields/styles.scss +2 -0
- package/src/hooks/cross-origin-isolation.js +143 -0
- package/src/hooks/fit-text.js +1 -1
- package/src/hooks/index.js +1 -0
- package/src/layouts/flex.js +8 -3
- package/src/layouts/test/flex.js +53 -0
- package/src/store/private-selectors.js +64 -1
- package/src/store/reducer.js +1 -1
- package/src/store/selectors.js +7 -9
- package/src/store/test/private-selectors.js +80 -0
- package/src/style.scss +1 -0
- package/src/components/block-visibility/styles.scss +0 -10
|
@@ -7,7 +7,7 @@ import { STORE_NAME } from "./constants.mjs";
|
|
|
7
7
|
import { getSectionRootClientId, isSectionBlock } from "./private-selectors.mjs";
|
|
8
8
|
import { getBlockEditingMode } from "./selectors.mjs";
|
|
9
9
|
import { INSERTER_PATTERN_TYPES } from "../components/inserter/block-patterns-tab/utils.mjs";
|
|
10
|
-
var isFiltered = Symbol("isFiltered");
|
|
10
|
+
var isFiltered = /* @__PURE__ */ Symbol("isFiltered");
|
|
11
11
|
var parsedPatternCache = /* @__PURE__ */ new WeakMap();
|
|
12
12
|
var grammarMapCache = /* @__PURE__ */ new WeakMap();
|
|
13
13
|
function mapUserPattern(userPattern, __experimentalUserPatternCategories = []) {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/store/utils.js"],
|
|
4
4
|
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport { parse as grammarParse } from '@wordpress/block-serialization-default-parser';\n\n/**\n * Internal dependencies\n */\nimport { selectBlockPatternsKey } from './private-keys';\nimport { unlock } from '../lock-unlock';\nimport { STORE_NAME } from './constants';\nimport { getSectionRootClientId, isSectionBlock } from './private-selectors';\nimport { getBlockEditingMode } from './selectors';\nimport { INSERTER_PATTERN_TYPES } from '../components/inserter/block-patterns-tab/utils';\n\nexport const isFiltered = Symbol( 'isFiltered' );\nconst parsedPatternCache = new WeakMap();\nconst grammarMapCache = new WeakMap();\n\nexport function 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\nfunction parsePattern( pattern ) {\n\tconst blocks = parse( pattern.content, {\n\t\t__unstableSkipMigrationLogs: true,\n\t} );\n\tif ( blocks.length === 1 ) {\n\t\tblocks[ 0 ].attributes = {\n\t\t\t...blocks[ 0 ].attributes,\n\t\t\tmetadata: {\n\t\t\t\t...( blocks[ 0 ].attributes.metadata || {} ),\n\t\t\t\tcategories: pattern.categories,\n\t\t\t\tpatternName: pattern.name,\n\t\t\t\tname: blocks[ 0 ].attributes.metadata?.name || pattern.title,\n\t\t\t},\n\t\t};\n\t}\n\treturn {\n\t\t...pattern,\n\t\tblocks,\n\t};\n}\n\nexport function getParsedPattern( pattern ) {\n\tlet parsedPattern = parsedPatternCache.get( pattern );\n\tif ( ! parsedPattern ) {\n\t\tparsedPattern = parsePattern( pattern );\n\t\tparsedPatternCache.set( pattern, parsedPattern );\n\t}\n\treturn parsedPattern;\n}\n\nexport function getGrammar( pattern ) {\n\tlet grammarMap = grammarMapCache.get( pattern );\n\tif ( ! grammarMap ) {\n\t\tgrammarMap = grammarParse( pattern.content );\n\t\t// Block names are null only at the top level for whitespace.\n\t\tgrammarMap = grammarMap.filter( ( block ) => block.blockName !== null );\n\t\tgrammarMapCache.set( pattern, grammarMap );\n\t}\n\treturn grammarMap;\n}\n\nexport const checkAllowList = ( list, item, defaultResult = null ) => {\n\tif ( typeof list === 'boolean' ) {\n\t\treturn list;\n\t}\n\tif ( Array.isArray( list ) ) {\n\t\t// TODO: when there is a canonical way to detect that we are editing a post\n\t\t// the following check should be changed to something like:\n\t\t// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )\n\t\tif ( list.includes( 'core/post-content' ) && item === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn list.includes( item );\n\t}\n\treturn defaultResult;\n};\n\nexport const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {\n\tif ( typeof allowedBlockTypes === 'boolean' ) {\n\t\treturn allowedBlockTypes;\n\t}\n\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\n\t\tconst isAllowed = checkAllowList(\n\t\t\tallowedBlockTypes,\n\t\t\tblock.name || block.blockName,\n\t\t\ttrue\n\t\t);\n\t\tif ( ! isAllowed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\n\treturn true;\n};\n\nexport const getAllPatternsDependants = ( select ) => ( state ) => {\n\treturn [\n\t\tstate.settings.__experimentalBlockPatterns,\n\t\tstate.settings.__experimentalUserPatternCategories,\n\t\tstate.settings.__experimentalReusableBlocks,\n\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\tstate.blockPatterns,\n\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t];\n};\n\nexport const getInsertBlockTypeDependants = () => ( state, rootClientId ) => {\n\treturn [\n\t\tstate.blockListSettings[ rootClientId ],\n\t\tstate.blocks.byClientId.get( rootClientId ),\n\t\tstate.settings.allowedBlockTypes,\n\t\tstate.settings.templateLock,\n\t\tgetBlockEditingMode( state, rootClientId ),\n\t\tgetSectionRootClientId( state ),\n\t\tisSectionBlock( state, rootClientId ),\n\t];\n};\n"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,aAAa;AACtB,SAAS,SAAS,oBAAoB;AAKtC,SAAS,8BAA8B;AACvC,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB,sBAAsB;AACvD,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AAEhC,IAAM,aAAa,
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -208,13 +208,16 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
208
208
|
border: none !important;
|
|
209
209
|
padding: 0 !important;
|
|
210
210
|
opacity: 0;
|
|
211
|
-
margin: 0 !important;
|
|
211
|
+
margin-top: 0 !important;
|
|
212
|
+
margin-bottom: 0 !important;
|
|
212
213
|
}
|
|
213
214
|
.block-editor-block-list__layout.is-layout-flex:not(.is-vertical) > .is-block-hidden {
|
|
214
215
|
width: 0;
|
|
215
216
|
height: auto;
|
|
216
217
|
align-self: stretch;
|
|
217
218
|
white-space: nowrap !important;
|
|
219
|
+
margin-right: 0 !important;
|
|
220
|
+
margin-left: 0 !important;
|
|
218
221
|
}
|
|
219
222
|
.block-editor-block-list__layout [class^=components-] {
|
|
220
223
|
-webkit-user-select: text;
|
package/build-style/content.css
CHANGED
|
@@ -208,13 +208,16 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
208
208
|
border: none !important;
|
|
209
209
|
padding: 0 !important;
|
|
210
210
|
opacity: 0;
|
|
211
|
-
margin: 0 !important;
|
|
211
|
+
margin-top: 0 !important;
|
|
212
|
+
margin-bottom: 0 !important;
|
|
212
213
|
}
|
|
213
214
|
.block-editor-block-list__layout.is-layout-flex:not(.is-vertical) > .is-block-hidden {
|
|
214
215
|
width: 0;
|
|
215
216
|
height: auto;
|
|
216
217
|
align-self: stretch;
|
|
217
218
|
white-space: nowrap !important;
|
|
219
|
+
margin-left: 0 !important;
|
|
220
|
+
margin-right: 0 !important;
|
|
218
221
|
}
|
|
219
222
|
.block-editor-block-list__layout [class^=components-] {
|
|
220
223
|
-webkit-user-select: text;
|
|
@@ -503,6 +503,9 @@ iframe[name=editor-canvas] {
|
|
|
503
503
|
.components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector::before {
|
|
504
504
|
content: "";
|
|
505
505
|
}
|
|
506
|
+
.components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector::after {
|
|
507
|
+
display: none;
|
|
508
|
+
}
|
|
506
509
|
.components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
|
|
507
510
|
border: 1px solid #1e1e1e;
|
|
508
511
|
padding-left: 6px;
|
|
@@ -518,6 +521,9 @@ iframe[name=editor-canvas] {
|
|
|
518
521
|
right: auto;
|
|
519
522
|
margin-right: -1px;
|
|
520
523
|
}
|
|
524
|
+
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector::after {
|
|
525
|
+
display: inline-flex;
|
|
526
|
+
}
|
|
521
527
|
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-mover__move-button-container,
|
|
522
528
|
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-toolbar__block-controls .block-editor-block-mover {
|
|
523
529
|
border-right: 1px solid #1e1e1e;
|
|
@@ -3563,6 +3569,7 @@ iframe[name=editor-canvas] {
|
|
|
3563
3569
|
|
|
3564
3570
|
.block-editor-block-fields__header-title {
|
|
3565
3571
|
flex: 1;
|
|
3572
|
+
margin: 0 !important;
|
|
3566
3573
|
}
|
|
3567
3574
|
|
|
3568
3575
|
.block-editor-hooks__block-hooks {
|
|
@@ -3786,7 +3793,6 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3786
3793
|
display: inline-flex;
|
|
3787
3794
|
height: 2px;
|
|
3788
3795
|
position: absolute;
|
|
3789
|
-
left: 0;
|
|
3790
3796
|
top: 15px;
|
|
3791
3797
|
width: 2px;
|
|
3792
3798
|
}
|
|
@@ -4519,4 +4525,51 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
4519
4525
|
|
|
4520
4526
|
.spacing-sizes-control__wrapper .preset-input-control__icon {
|
|
4521
4527
|
margin-right: -4px;
|
|
4528
|
+
}
|
|
4529
|
+
|
|
4530
|
+
.block-editor-block-visibility-modal {
|
|
4531
|
+
z-index: 1000001;
|
|
4532
|
+
}
|
|
4533
|
+
.block-editor-block-visibility-modal__options {
|
|
4534
|
+
border: 0;
|
|
4535
|
+
padding: 0;
|
|
4536
|
+
list-style: none;
|
|
4537
|
+
margin: 24px 0;
|
|
4538
|
+
}
|
|
4539
|
+
.block-editor-block-visibility-modal__options-item {
|
|
4540
|
+
display: flex;
|
|
4541
|
+
align-items: center;
|
|
4542
|
+
justify-content: space-between;
|
|
4543
|
+
margin: 0 0 16px 0;
|
|
4544
|
+
gap: 24px;
|
|
4545
|
+
}
|
|
4546
|
+
.block-editor-block-visibility-modal__options-item:last-child {
|
|
4547
|
+
margin: 0;
|
|
4548
|
+
}
|
|
4549
|
+
.block-editor-block-visibility-modal__options-item--everywhere {
|
|
4550
|
+
flex-direction: column;
|
|
4551
|
+
align-items: start;
|
|
4552
|
+
}
|
|
4553
|
+
.block-editor-block-visibility-modal__options-checkbox--everywhere {
|
|
4554
|
+
font-weight: 600;
|
|
4555
|
+
}
|
|
4556
|
+
.block-editor-block-visibility-modal__options-icon--checked {
|
|
4557
|
+
fill: #ddd;
|
|
4558
|
+
}
|
|
4559
|
+
.block-editor-block-visibility-modal__sub-options {
|
|
4560
|
+
width: 100%;
|
|
4561
|
+
padding-inline-start: 12px;
|
|
4562
|
+
}
|
|
4563
|
+
.block-editor-block-visibility-modal__description {
|
|
4564
|
+
font-size: 12px;
|
|
4565
|
+
color: #757575;
|
|
4566
|
+
}
|
|
4567
|
+
|
|
4568
|
+
.block-editor-block-visibility-info {
|
|
4569
|
+
padding-top: 4px;
|
|
4570
|
+
padding-bottom: 4px;
|
|
4571
|
+
margin: 0 16px 16px;
|
|
4572
|
+
display: flex;
|
|
4573
|
+
align-items: center;
|
|
4574
|
+
justify-content: start;
|
|
4522
4575
|
}
|
package/build-style/style.css
CHANGED
|
@@ -503,6 +503,9 @@ iframe[name=editor-canvas] {
|
|
|
503
503
|
.components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector::before {
|
|
504
504
|
content: "";
|
|
505
505
|
}
|
|
506
|
+
.components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector::after {
|
|
507
|
+
display: none;
|
|
508
|
+
}
|
|
506
509
|
.components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector .block-editor-block-parent-selector__button {
|
|
507
510
|
border: 1px solid #1e1e1e;
|
|
508
511
|
padding-right: 6px;
|
|
@@ -518,6 +521,9 @@ iframe[name=editor-canvas] {
|
|
|
518
521
|
left: auto;
|
|
519
522
|
margin-left: -1px;
|
|
520
523
|
}
|
|
524
|
+
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-parent-selector::after {
|
|
525
|
+
display: inline-flex;
|
|
526
|
+
}
|
|
521
527
|
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-mover__move-button-container,
|
|
522
528
|
.show-icon-labels .components-popover.block-editor-block-list__block-popover .block-editor-block-toolbar__block-controls .block-editor-block-mover {
|
|
523
529
|
border-left: 1px solid #1e1e1e;
|
|
@@ -3565,6 +3571,7 @@ iframe[name=editor-canvas] {
|
|
|
3565
3571
|
|
|
3566
3572
|
.block-editor-block-fields__header-title {
|
|
3567
3573
|
flex: 1;
|
|
3574
|
+
margin: 0 !important;
|
|
3568
3575
|
}
|
|
3569
3576
|
|
|
3570
3577
|
.block-editor-hooks__block-hooks {
|
|
@@ -3788,7 +3795,6 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
3788
3795
|
display: inline-flex;
|
|
3789
3796
|
height: 2px;
|
|
3790
3797
|
position: absolute;
|
|
3791
|
-
right: 0;
|
|
3792
3798
|
top: 15px;
|
|
3793
3799
|
width: 2px;
|
|
3794
3800
|
}
|
|
@@ -4521,4 +4527,51 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
4521
4527
|
|
|
4522
4528
|
.spacing-sizes-control__wrapper .preset-input-control__icon {
|
|
4523
4529
|
margin-left: -4px;
|
|
4530
|
+
}
|
|
4531
|
+
|
|
4532
|
+
.block-editor-block-visibility-modal {
|
|
4533
|
+
z-index: 1000001;
|
|
4534
|
+
}
|
|
4535
|
+
.block-editor-block-visibility-modal__options {
|
|
4536
|
+
border: 0;
|
|
4537
|
+
padding: 0;
|
|
4538
|
+
list-style: none;
|
|
4539
|
+
margin: 24px 0;
|
|
4540
|
+
}
|
|
4541
|
+
.block-editor-block-visibility-modal__options-item {
|
|
4542
|
+
display: flex;
|
|
4543
|
+
align-items: center;
|
|
4544
|
+
justify-content: space-between;
|
|
4545
|
+
margin: 0 0 16px 0;
|
|
4546
|
+
gap: 24px;
|
|
4547
|
+
}
|
|
4548
|
+
.block-editor-block-visibility-modal__options-item:last-child {
|
|
4549
|
+
margin: 0;
|
|
4550
|
+
}
|
|
4551
|
+
.block-editor-block-visibility-modal__options-item--everywhere {
|
|
4552
|
+
flex-direction: column;
|
|
4553
|
+
align-items: start;
|
|
4554
|
+
}
|
|
4555
|
+
.block-editor-block-visibility-modal__options-checkbox--everywhere {
|
|
4556
|
+
font-weight: 600;
|
|
4557
|
+
}
|
|
4558
|
+
.block-editor-block-visibility-modal__options-icon--checked {
|
|
4559
|
+
fill: #ddd;
|
|
4560
|
+
}
|
|
4561
|
+
.block-editor-block-visibility-modal__sub-options {
|
|
4562
|
+
width: 100%;
|
|
4563
|
+
padding-inline-start: 12px;
|
|
4564
|
+
}
|
|
4565
|
+
.block-editor-block-visibility-modal__description {
|
|
4566
|
+
font-size: 12px;
|
|
4567
|
+
color: #757575;
|
|
4568
|
+
}
|
|
4569
|
+
|
|
4570
|
+
.block-editor-block-visibility-info {
|
|
4571
|
+
padding-top: 4px;
|
|
4572
|
+
padding-bottom: 4px;
|
|
4573
|
+
margin: 0 16px 16px;
|
|
4574
|
+
display: flex;
|
|
4575
|
+
align-items: center;
|
|
4576
|
+
justify-content: start;
|
|
4524
4577
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "15.10.1-next.
|
|
3
|
+
"version": "15.10.1-next.v.0+500f87dd8",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -61,43 +61,43 @@
|
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@react-spring/web": "^9.4.5",
|
|
64
|
-
"@wordpress/a11y": "^4.37.1-next.
|
|
65
|
-
"@wordpress/api-fetch": "^7.37.1-next.
|
|
66
|
-
"@wordpress/base-styles": "^6.13.2-next.
|
|
67
|
-
"@wordpress/blob": "^4.37.1-next.
|
|
68
|
-
"@wordpress/block-serialization-default-parser": "^5.37.1-next.
|
|
69
|
-
"@wordpress/blocks": "^15.10.1-next.
|
|
70
|
-
"@wordpress/commands": "^1.37.1-next.
|
|
71
|
-
"@wordpress/components": "^32.0.1-next.
|
|
72
|
-
"@wordpress/compose": "^7.37.1-next.
|
|
73
|
-
"@wordpress/data": "^10.37.1-next.
|
|
74
|
-
"@wordpress/dataviews": "^11.2.1-next.
|
|
75
|
-
"@wordpress/date": "^5.37.2-next.
|
|
76
|
-
"@wordpress/deprecated": "^4.37.1-next.
|
|
77
|
-
"@wordpress/dom": "^4.37.1-next.
|
|
78
|
-
"@wordpress/element": "^6.37.1-next.
|
|
79
|
-
"@wordpress/escape-html": "^3.37.1-next.
|
|
80
|
-
"@wordpress/global-styles-engine": "^1.4.1-next.
|
|
81
|
-
"@wordpress/hooks": "^4.37.1-next.
|
|
82
|
-
"@wordpress/html-entities": "^4.37.1-next.
|
|
83
|
-
"@wordpress/i18n": "^6.10.1-next.
|
|
84
|
-
"@wordpress/icons": "^11.4.1-next.
|
|
85
|
-
"@wordpress/image-cropper": "^1.1.1-next.
|
|
86
|
-
"@wordpress/interactivity": "^6.37.
|
|
87
|
-
"@wordpress/is-shallow-equal": "^5.37.1-next.
|
|
88
|
-
"@wordpress/keyboard-shortcuts": "^5.37.1-next.
|
|
89
|
-
"@wordpress/keycodes": "^4.38.1-next.
|
|
90
|
-
"@wordpress/notices": "^5.
|
|
91
|
-
"@wordpress/preferences": "^4.37.1-next.
|
|
92
|
-
"@wordpress/priority-queue": "^3.37.1-next.
|
|
93
|
-
"@wordpress/private-apis": "^1.37.1-next.
|
|
94
|
-
"@wordpress/rich-text": "^7.37.1-next.
|
|
95
|
-
"@wordpress/style-engine": "^2.37.1-next.
|
|
96
|
-
"@wordpress/token-list": "^3.37.1-next.
|
|
97
|
-
"@wordpress/upload-media": "^0.22.1-next.
|
|
98
|
-
"@wordpress/url": "^4.37.1-next.
|
|
99
|
-
"@wordpress/warning": "^3.37.1-next.
|
|
100
|
-
"@wordpress/wordcount": "^4.37.1-next.
|
|
64
|
+
"@wordpress/a11y": "^4.37.1-next.v.0+500f87dd8",
|
|
65
|
+
"@wordpress/api-fetch": "^7.37.1-next.v.0+500f87dd8",
|
|
66
|
+
"@wordpress/base-styles": "^6.13.2-next.v.0+500f87dd8",
|
|
67
|
+
"@wordpress/blob": "^4.37.1-next.v.0+500f87dd8",
|
|
68
|
+
"@wordpress/block-serialization-default-parser": "^5.37.1-next.v.0+500f87dd8",
|
|
69
|
+
"@wordpress/blocks": "^15.10.1-next.v.0+500f87dd8",
|
|
70
|
+
"@wordpress/commands": "^1.37.1-next.v.0+500f87dd8",
|
|
71
|
+
"@wordpress/components": "^32.0.1-next.v.0+500f87dd8",
|
|
72
|
+
"@wordpress/compose": "^7.37.1-next.v.0+500f87dd8",
|
|
73
|
+
"@wordpress/data": "^10.37.1-next.v.0+500f87dd8",
|
|
74
|
+
"@wordpress/dataviews": "^11.2.1-next.v.0+500f87dd8",
|
|
75
|
+
"@wordpress/date": "^5.37.2-next.v.0+500f87dd8",
|
|
76
|
+
"@wordpress/deprecated": "^4.37.1-next.v.0+500f87dd8",
|
|
77
|
+
"@wordpress/dom": "^4.37.1-next.v.0+500f87dd8",
|
|
78
|
+
"@wordpress/element": "^6.37.1-next.v.0+500f87dd8",
|
|
79
|
+
"@wordpress/escape-html": "^3.37.1-next.v.0+500f87dd8",
|
|
80
|
+
"@wordpress/global-styles-engine": "^1.4.1-next.v.0+500f87dd8",
|
|
81
|
+
"@wordpress/hooks": "^4.37.1-next.v.0+500f87dd8",
|
|
82
|
+
"@wordpress/html-entities": "^4.37.1-next.v.0+500f87dd8",
|
|
83
|
+
"@wordpress/i18n": "^6.10.1-next.v.0+500f87dd8",
|
|
84
|
+
"@wordpress/icons": "^11.4.1-next.v.0+500f87dd8",
|
|
85
|
+
"@wordpress/image-cropper": "^1.1.1-next.v.0+500f87dd8",
|
|
86
|
+
"@wordpress/interactivity": "^6.37.2-next.v.0+500f87dd8",
|
|
87
|
+
"@wordpress/is-shallow-equal": "^5.37.1-next.v.0+500f87dd8",
|
|
88
|
+
"@wordpress/keyboard-shortcuts": "^5.37.1-next.v.0+500f87dd8",
|
|
89
|
+
"@wordpress/keycodes": "^4.38.1-next.v.0+500f87dd8",
|
|
90
|
+
"@wordpress/notices": "^5.38.1-next.v.0+500f87dd8",
|
|
91
|
+
"@wordpress/preferences": "^4.37.1-next.v.0+500f87dd8",
|
|
92
|
+
"@wordpress/priority-queue": "^3.37.1-next.v.0+500f87dd8",
|
|
93
|
+
"@wordpress/private-apis": "^1.37.1-next.v.0+500f87dd8",
|
|
94
|
+
"@wordpress/rich-text": "^7.37.1-next.v.0+500f87dd8",
|
|
95
|
+
"@wordpress/style-engine": "^2.37.1-next.v.0+500f87dd8",
|
|
96
|
+
"@wordpress/token-list": "^3.37.1-next.v.0+500f87dd8",
|
|
97
|
+
"@wordpress/upload-media": "^0.22.1-next.v.0+500f87dd8",
|
|
98
|
+
"@wordpress/url": "^4.37.1-next.v.0+500f87dd8",
|
|
99
|
+
"@wordpress/warning": "^3.37.1-next.v.0+500f87dd8",
|
|
100
|
+
"@wordpress/wordcount": "^4.37.1-next.v.0+500f87dd8",
|
|
101
101
|
"change-case": "^4.1.2",
|
|
102
102
|
"clsx": "^2.1.1",
|
|
103
103
|
"colord": "^2.7.0",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"publishConfig": {
|
|
125
125
|
"access": "public"
|
|
126
126
|
},
|
|
127
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "ca0db0ee8ac2116cd307650136027d26d0cdd9bd"
|
|
128
128
|
}
|
|
@@ -38,8 +38,9 @@ import { useBlockProps } from './use-block-props';
|
|
|
38
38
|
import { store as blockEditorStore } from '../../store';
|
|
39
39
|
import { useLayout } from './layout';
|
|
40
40
|
import { PrivateBlockContext } from './private-block-context';
|
|
41
|
-
|
|
41
|
+
import { useBlockVisibility } from '../block-visibility/';
|
|
42
42
|
import { unlock } from '../../lock-unlock';
|
|
43
|
+
import { deviceTypeKey } from '../../store/private-keys';
|
|
43
44
|
|
|
44
45
|
/**
|
|
45
46
|
* Merges wrapper props with special handling for classNames and styles.
|
|
@@ -607,16 +608,17 @@ function BlockListBlockProvider( props ) {
|
|
|
607
608
|
const attributes = getBlockAttributes( clientId );
|
|
608
609
|
const { name: blockName, isValid } = blockWithoutAttributes;
|
|
609
610
|
const blockType = getBlockType( blockName );
|
|
611
|
+
const settings = getSettings();
|
|
610
612
|
const {
|
|
611
613
|
supportsLayout,
|
|
612
614
|
isPreviewMode,
|
|
613
615
|
__experimentalBlockBindingsSupportedAttributes,
|
|
614
|
-
} =
|
|
615
|
-
const { isBlockHidden: _isBlockHidden } = unlock(
|
|
616
|
-
select( blockEditorStore )
|
|
617
|
-
);
|
|
616
|
+
} = settings;
|
|
618
617
|
const bindableAttributes =
|
|
619
618
|
__experimentalBlockBindingsSupportedAttributes?.[ blockName ];
|
|
619
|
+
const blockVisibility = attributes?.metadata?.blockVisibility;
|
|
620
|
+
const deviceType =
|
|
621
|
+
settings?.[ deviceTypeKey ]?.toLowerCase() || 'desktop';
|
|
620
622
|
|
|
621
623
|
const hasLightBlockWrapper = blockType?.apiVersion > 1;
|
|
622
624
|
const previewContext = {
|
|
@@ -635,8 +637,9 @@ function BlockListBlockProvider( props ) {
|
|
|
635
637
|
? getBlockDefaultClassName( blockName )
|
|
636
638
|
: undefined,
|
|
637
639
|
blockTitle: blockType?.title,
|
|
638
|
-
isBlockHidden: _isBlockHidden( clientId ),
|
|
639
640
|
bindableAttributes,
|
|
641
|
+
blockVisibility,
|
|
642
|
+
deviceType,
|
|
640
643
|
};
|
|
641
644
|
|
|
642
645
|
// When in preview mode, we can avoid a lot of selection and
|
|
@@ -725,6 +728,8 @@ function BlockListBlockProvider( props ) {
|
|
|
725
728
|
originalBlockClientId: isInvalid
|
|
726
729
|
? blocksWithSameName[ 0 ]
|
|
727
730
|
: false,
|
|
731
|
+
blockVisibility,
|
|
732
|
+
deviceType,
|
|
728
733
|
};
|
|
729
734
|
},
|
|
730
735
|
[ clientId, rootClientId ]
|
|
@@ -770,10 +775,17 @@ function BlockListBlockProvider( props ) {
|
|
|
770
775
|
className,
|
|
771
776
|
defaultClassName,
|
|
772
777
|
originalBlockClientId,
|
|
773
|
-
isBlockHidden,
|
|
774
778
|
bindableAttributes,
|
|
779
|
+
blockVisibility,
|
|
780
|
+
deviceType,
|
|
775
781
|
} = selectedProps;
|
|
776
782
|
|
|
783
|
+
// Use block visibility hook with data from existing useSelect to avoid extra subscription
|
|
784
|
+
const { isBlockCurrentlyHidden } = useBlockVisibility( {
|
|
785
|
+
blockVisibility,
|
|
786
|
+
deviceType,
|
|
787
|
+
} );
|
|
788
|
+
|
|
777
789
|
// Users of the editor.BlockListBlock filter used to be able to
|
|
778
790
|
// access the block prop.
|
|
779
791
|
// Ideally these blocks would rely on the clientId prop only.
|
|
@@ -823,12 +835,14 @@ function BlockListBlockProvider( props ) {
|
|
|
823
835
|
originalBlockClientId,
|
|
824
836
|
themeSupportsLayout,
|
|
825
837
|
canMove,
|
|
826
|
-
|
|
838
|
+
isBlockCurrentlyHidden,
|
|
827
839
|
bindableAttributes,
|
|
840
|
+
blockVisibility,
|
|
841
|
+
deviceType,
|
|
828
842
|
};
|
|
829
843
|
|
|
830
844
|
if (
|
|
831
|
-
|
|
845
|
+
isBlockCurrentlyHidden &&
|
|
832
846
|
! isSelected &&
|
|
833
847
|
! isMultiSelected &&
|
|
834
848
|
! hasChildSelected
|
|
@@ -109,7 +109,8 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
109
109
|
border: none !important;
|
|
110
110
|
padding: 0 !important;
|
|
111
111
|
opacity: 0;
|
|
112
|
-
margin: 0 !important;
|
|
112
|
+
margin-top: 0 !important;
|
|
113
|
+
margin-bottom: 0 !important;
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
&.is-layout-flex:not(.is-vertical) > .is-block-hidden {
|
|
@@ -117,6 +118,8 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
117
118
|
height: auto;
|
|
118
119
|
align-self: stretch;
|
|
119
120
|
white-space: nowrap !important;
|
|
121
|
+
margin-left: 0 !important;
|
|
122
|
+
margin-right: 0 !important;
|
|
120
123
|
}
|
|
121
124
|
|
|
122
125
|
// Re-enable it on components inside.
|
|
@@ -30,6 +30,7 @@ import { useIntersectionObserver } from './use-intersection-observer';
|
|
|
30
30
|
import { useScrollIntoView } from './use-scroll-into-view';
|
|
31
31
|
import { useFlashEditableBlocks } from '../../use-flash-editable-blocks';
|
|
32
32
|
import { useFirefoxDraggableCompatibility } from './use-firefox-draggable-compatibility';
|
|
33
|
+
import { useBlockVisibility } from '../../block-visibility/';
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* This hook is used to lightly mark an element as a block element. The element
|
|
@@ -102,7 +103,8 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
102
103
|
isSectionBlock,
|
|
103
104
|
isWithinSectionBlock,
|
|
104
105
|
canMove,
|
|
105
|
-
|
|
106
|
+
blockVisibility,
|
|
107
|
+
deviceType,
|
|
106
108
|
} = useContext( PrivateBlockContext );
|
|
107
109
|
|
|
108
110
|
// translators: %s: Type of block (i.e. Text, Image etc)
|
|
@@ -138,6 +140,12 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
138
140
|
}
|
|
139
141
|
: {};
|
|
140
142
|
|
|
143
|
+
// Use block visibility hook with data from context to avoid extra subscription.
|
|
144
|
+
const { isBlockCurrentlyHidden } = useBlockVisibility( {
|
|
145
|
+
blockVisibility,
|
|
146
|
+
deviceType,
|
|
147
|
+
} );
|
|
148
|
+
|
|
141
149
|
// Ensures it warns only inside the `edit` implementation for the block.
|
|
142
150
|
if ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {
|
|
143
151
|
warning(
|
|
@@ -185,7 +193,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
185
193
|
'has-editable-outline': hasEditableOutline,
|
|
186
194
|
'has-negative-margin': hasNegativeMargin,
|
|
187
195
|
'is-editing-content-only-section': isEditingContentOnlySection,
|
|
188
|
-
'is-block-hidden':
|
|
196
|
+
'is-block-hidden': isBlockCurrentlyHidden,
|
|
189
197
|
},
|
|
190
198
|
className,
|
|
191
199
|
props.className,
|
|
@@ -10,11 +10,11 @@ import { useSelect, useDispatch } from '@wordpress/data';
|
|
|
10
10
|
import { isTextField } from '@wordpress/dom';
|
|
11
11
|
import { Popover } from '@wordpress/components';
|
|
12
12
|
import { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';
|
|
13
|
-
import { useRef } from '@wordpress/element';
|
|
13
|
+
import { useRef, useState } from '@wordpress/element';
|
|
14
14
|
import {
|
|
15
15
|
switchToBlockType,
|
|
16
|
-
store as blocksStore,
|
|
17
16
|
hasBlockSupport,
|
|
17
|
+
store as blocksStore,
|
|
18
18
|
} from '@wordpress/blocks';
|
|
19
19
|
import { speak } from '@wordpress/a11y';
|
|
20
20
|
import { __, sprintf, _n } from '@wordpress/i18n';
|
|
@@ -33,8 +33,9 @@ import usePopoverScroll from '../block-popover/use-popover-scroll';
|
|
|
33
33
|
import ZoomOutModeInserters from './zoom-out-mode-inserters';
|
|
34
34
|
import { useShowBlockTools } from './use-show-block-tools';
|
|
35
35
|
import { unlock } from '../../lock-unlock';
|
|
36
|
-
import { cleanEmptyObject } from '../../hooks/utils';
|
|
37
36
|
import usePasteStyles from '../use-paste-styles';
|
|
37
|
+
import { BlockVisibilityModal } from '../block-visibility';
|
|
38
|
+
import { cleanEmptyObject } from '../../hooks/utils';
|
|
38
39
|
|
|
39
40
|
function selector( select ) {
|
|
40
41
|
const {
|
|
@@ -74,14 +75,14 @@ export default function BlockTools( {
|
|
|
74
75
|
} ) {
|
|
75
76
|
const { clientId, hasFixedToolbar, isTyping, isZoomOutMode, isDragging } =
|
|
76
77
|
useSelect( selector, [] );
|
|
77
|
-
|
|
78
|
+
const [ visibilityModalClientIds, setVisibilityModalClientIds ] =
|
|
79
|
+
useState( null );
|
|
78
80
|
const isMatch = useShortcutEventMatch();
|
|
79
81
|
const {
|
|
80
82
|
getBlocksByClientId,
|
|
81
83
|
getSelectedBlockClientIds,
|
|
82
84
|
getBlockRootClientId,
|
|
83
85
|
isGroupable,
|
|
84
|
-
getBlockName,
|
|
85
86
|
getEditedContentOnlySection,
|
|
86
87
|
} = unlock( useSelect( blockEditorStore ) );
|
|
87
88
|
const { getGroupingBlockName } = useSelect( blocksStore );
|
|
@@ -99,8 +100,8 @@ export default function BlockTools( {
|
|
|
99
100
|
moveBlocksUp,
|
|
100
101
|
moveBlocksDown,
|
|
101
102
|
expandBlock,
|
|
102
|
-
updateBlockAttributes,
|
|
103
103
|
stopEditingContentOnlySection,
|
|
104
|
+
updateBlockAttributes,
|
|
104
105
|
} = unlock( useDispatch( blockEditorStore ) );
|
|
105
106
|
|
|
106
107
|
function onKeyDown( event ) {
|
|
@@ -221,36 +222,41 @@ export default function BlockTools( {
|
|
|
221
222
|
if ( clientIds.length ) {
|
|
222
223
|
event.preventDefault();
|
|
223
224
|
const blocks = getBlocksByClientId( clientIds );
|
|
224
|
-
const
|
|
225
|
-
hasBlockSupport(
|
|
226
|
-
getBlockName( block.clientId ),
|
|
227
|
-
'visibility',
|
|
228
|
-
true
|
|
229
|
-
)
|
|
225
|
+
const supportsBlockVisibility = blocks.every( ( block ) =>
|
|
226
|
+
hasBlockSupport( block.name, 'visibility', true )
|
|
230
227
|
);
|
|
231
|
-
|
|
228
|
+
|
|
229
|
+
if ( ! supportsBlockVisibility ) {
|
|
232
230
|
return;
|
|
233
231
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
blocks.
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
232
|
+
|
|
233
|
+
if ( window.__experimentalHideBlocksBasedOnScreenSize ) {
|
|
234
|
+
// Open the visibility breakpoints modal.
|
|
235
|
+
setVisibilityModalClientIds( clientIds );
|
|
236
|
+
} else {
|
|
237
|
+
const hasHiddenBlock = blocks.some(
|
|
238
|
+
( block ) =>
|
|
239
|
+
block.attributes.metadata?.blockVisibility === false
|
|
240
|
+
);
|
|
241
|
+
const attributesByClientId = Object.fromEntries(
|
|
242
|
+
blocks.map(
|
|
243
|
+
( { clientId: mapClientId, attributes } ) => [
|
|
244
|
+
mapClientId,
|
|
245
|
+
{
|
|
246
|
+
metadata: cleanEmptyObject( {
|
|
247
|
+
...attributes?.metadata,
|
|
248
|
+
blockVisibility: hasHiddenBlock
|
|
249
|
+
? undefined
|
|
250
|
+
: false,
|
|
251
|
+
} ),
|
|
252
|
+
},
|
|
253
|
+
]
|
|
254
|
+
)
|
|
255
|
+
);
|
|
256
|
+
updateBlockAttributes( clientIds, attributesByClientId, {
|
|
257
|
+
uniqueByBlock: true,
|
|
258
|
+
} );
|
|
259
|
+
}
|
|
254
260
|
}
|
|
255
261
|
}
|
|
256
262
|
|
|
@@ -317,6 +323,12 @@ export default function BlockTools( {
|
|
|
317
323
|
/>
|
|
318
324
|
) }
|
|
319
325
|
</InsertionPointOpenRef.Provider>
|
|
326
|
+
{ visibilityModalClientIds && (
|
|
327
|
+
<BlockVisibilityModal
|
|
328
|
+
clientIds={ visibilityModalClientIds }
|
|
329
|
+
onClose={ () => setVisibilityModalClientIds( null ) }
|
|
330
|
+
/>
|
|
331
|
+
) }
|
|
320
332
|
</div>
|
|
321
333
|
);
|
|
322
334
|
}
|