@wordpress/block-editor 14.3.5 → 14.3.7
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/README.md +6 -2
- package/build/components/block-list/block.js +0 -3
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +1 -4
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
- package/build/components/block-list/zoom-out-separator.js +10 -7
- package/build/components/block-list/zoom-out-separator.js.map +1 -1
- package/build/components/block-popover/index.js +1 -1
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-toolbar/index.js +28 -16
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/use-has-block-toolbar.js +3 -3
- package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build/components/block-tools/index.js +1 -6
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +4 -6
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +22 -36
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/iframe/index.js +45 -10
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +4 -0
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +16 -4
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +4 -0
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/menu.js +8 -2
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/tool-selector/index.js +5 -1
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +1 -2
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/hooks/block-bindings.js +12 -1
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/grid-visualizer.js +13 -11
- package/build/hooks/grid-visualizer.js.map +1 -1
- package/build/hooks/layout-child.js +41 -3
- package/build/hooks/layout-child.js.map +1 -1
- package/build/hooks/use-zoom-out.js +24 -16
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/private-selectors.js +37 -2
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/selectors.js +15 -8
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-bindings.js +9 -6
- package/build/utils/block-bindings.js.map +1 -1
- package/build-module/components/block-list/block.js +0 -3
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -4
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
- package/build-module/components/block-list/zoom-out-separator.js +10 -7
- package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
- package/build-module/components/block-popover/index.js +1 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +30 -18
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/use-has-block-toolbar.js +3 -3
- package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
- package/build-module/components/block-tools/index.js +1 -6
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +4 -6
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +22 -36
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/iframe/index.js +45 -10
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +5 -1
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +16 -4
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +5 -1
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/menu.js +8 -2
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/tool-selector/index.js +5 -1
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +1 -2
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/hooks/block-bindings.js +13 -2
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/grid-visualizer.js +13 -11
- package/build-module/hooks/grid-visualizer.js.map +1 -1
- package/build-module/hooks/layout-child.js +41 -3
- package/build-module/hooks/layout-child.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +24 -17
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-selectors.js +35 -2
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/selectors.js +15 -8
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-bindings.js +9 -6
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-style/content-rtl.css +19 -26
- package/build-style/content.css +19 -26
- package/build-style/style-rtl.css +36 -21
- package/build-style/style.css +36 -21
- package/package.json +6 -6
- package/src/components/block-canvas/style.scss +1 -0
- package/src/components/block-list/block.js +0 -3
- package/src/components/block-list/content.scss +3 -2
- package/src/components/block-list/use-block-props/index.js +1 -2
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +25 -4
- package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +19 -11
- package/src/components/block-list/zoom-out-separator.js +8 -6
- package/src/components/block-popover/index.js +2 -2
- package/src/components/block-toolbar/index.js +37 -24
- package/src/components/block-toolbar/style.scss +10 -1
- package/src/components/block-toolbar/use-has-block-toolbar.js +19 -28
- package/src/components/block-tools/index.js +0 -9
- package/src/components/block-tools/style.scss +2 -26
- package/src/components/block-tools/use-show-block-tools.js +2 -10
- package/src/components/block-tools/zoom-out-mode-inserters.js +26 -50
- package/src/components/iframe/content.scss +23 -32
- package/src/components/iframe/index.js +60 -13
- package/src/components/iframe/style.scss +18 -0
- package/src/components/inserter/block-patterns-tab/index.js +6 -1
- package/src/components/inserter/hooks/use-insertion-point.js +23 -5
- package/src/components/inserter/media-tab/media-tab.js +6 -1
- package/src/components/inserter/menu.js +12 -1
- package/src/components/inserter/style.scss +6 -0
- package/src/components/list-view/style.scss +9 -0
- package/src/components/rich-text/style.scss +5 -0
- package/src/components/tool-selector/index.js +5 -2
- package/src/components/use-resize-canvas/index.js +1 -3
- package/src/hooks/block-bindings.js +40 -23
- package/src/hooks/grid-visualizer.js +23 -9
- package/src/hooks/layout-child.js +48 -3
- package/src/hooks/use-zoom-out.js +36 -20
- package/src/private-apis.js +2 -0
- package/src/store/private-selectors.js +40 -1
- package/src/store/selectors.js +16 -8
- package/src/style.scss +1 -0
- package/src/utils/block-bindings.js +9 -6
- package/src/utils/test/use-block-bindings-utils.js +174 -0
- package/build/components/block-tools/zoom-out-popover.js +0 -57
- package/build/components/block-tools/zoom-out-popover.js.map +0 -1
- package/build/components/block-tools/zoom-out-toolbar.js +0 -159
- package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
- package/build-module/components/block-tools/zoom-out-popover.js +0 -48
- package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +0 -152
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
- package/src/components/block-tools/zoom-out-popover.js +0 -46
- package/src/components/block-tools/zoom-out-toolbar.js +0 -167
|
@@ -36,6 +36,8 @@ function isObjectEmpty(object) {
|
|
|
36
36
|
* - `updateBlockBindings`: Updates the value of the bindings connected to block attributes. It can be used to remove a specific binding by setting the value to `undefined`.
|
|
37
37
|
* - `removeAllBlockBindings`: Removes the bindings property of the `metadata` attribute.
|
|
38
38
|
*
|
|
39
|
+
* @param {?string} clientId Optional block client ID. If not set, it will use the current block client ID from the context.
|
|
40
|
+
*
|
|
39
41
|
* @return {?WPBlockBindingsUtils} Object containing the block bindings utils.
|
|
40
42
|
*
|
|
41
43
|
* @example
|
|
@@ -66,10 +68,11 @@ function isObjectEmpty(object) {
|
|
|
66
68
|
* removeAllBlockBindings();
|
|
67
69
|
* ```
|
|
68
70
|
*/
|
|
69
|
-
function useBlockBindingsUtils() {
|
|
71
|
+
function useBlockBindingsUtils(clientId) {
|
|
70
72
|
const {
|
|
71
|
-
clientId
|
|
73
|
+
clientId: contextClientId
|
|
72
74
|
} = (0, _blockEdit.useBlockEditContext)();
|
|
75
|
+
const blockClientId = clientId || contextClientId;
|
|
73
76
|
const {
|
|
74
77
|
updateBlockAttributes
|
|
75
78
|
} = (0, _data.useDispatch)(_store.store);
|
|
@@ -112,7 +115,7 @@ function useBlockBindingsUtils() {
|
|
|
112
115
|
bindings: currentBindings,
|
|
113
116
|
...metadata
|
|
114
117
|
} = {}
|
|
115
|
-
} = getBlockAttributes(
|
|
118
|
+
} = getBlockAttributes(blockClientId);
|
|
116
119
|
const newBindings = {
|
|
117
120
|
...currentBindings
|
|
118
121
|
};
|
|
@@ -130,7 +133,7 @@ function useBlockBindingsUtils() {
|
|
|
130
133
|
if (isObjectEmpty(newMetadata.bindings)) {
|
|
131
134
|
delete newMetadata.bindings;
|
|
132
135
|
}
|
|
133
|
-
updateBlockAttributes(
|
|
136
|
+
updateBlockAttributes(blockClientId, {
|
|
134
137
|
metadata: isObjectEmpty(newMetadata) ? undefined : newMetadata
|
|
135
138
|
});
|
|
136
139
|
};
|
|
@@ -152,8 +155,8 @@ function useBlockBindingsUtils() {
|
|
|
152
155
|
bindings,
|
|
153
156
|
...metadata
|
|
154
157
|
} = {}
|
|
155
|
-
} = getBlockAttributes(
|
|
156
|
-
updateBlockAttributes(
|
|
158
|
+
} = getBlockAttributes(blockClientId);
|
|
159
|
+
updateBlockAttributes(blockClientId, {
|
|
157
160
|
metadata: isObjectEmpty(metadata) ? undefined : metadata
|
|
158
161
|
});
|
|
159
162
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_store","_blockEdit","isObjectEmpty","object","Object","keys","length","useBlockBindingsUtils","clientId","useBlockEditContext","updateBlockAttributes","useDispatch","blockEditorStore","getBlockAttributes","useRegistry","select","updateBlockBindings","bindings","metadata","currentBindings","newBindings","entries","forEach","attribute","binding","newMetadata","undefined","removeAllBlockBindings"],"sources":["@wordpress/block-editor/src/utils/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useBlockEditContext } from '../components/block-edit';\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Contains utils to update the block `bindings` metadata.\n *\n * @typedef {Object} WPBlockBindingsUtils\n *\n * @property {Function} updateBlockBindings Updates the value of the bindings connected to block attributes.\n * @property {Function} removeAllBlockBindings Removes the bindings property of the `metadata` attribute.\n */\n\n/**\n * Retrieves the existing utils needed to update the block `bindings` metadata.\n * They can be used to create, modify, or remove connections from the existing block attributes.\n *\n * It contains the following utils:\n * - `updateBlockBindings`: Updates the value of the bindings connected to block attributes. It can be used to remove a specific binding by setting the value to `undefined`.\n * - `removeAllBlockBindings`: Removes the bindings property of the `metadata` attribute.\n *\n * @return {?WPBlockBindingsUtils} Object containing the block bindings utils.\n *\n * @example\n * ```js\n * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n * const { updateBlockBindings, removeAllBlockBindings } = useBlockBindingsUtils();\n *\n * // Update url and alt attributes.\n * updateBlockBindings( {\n * url: {\n * source: 'core/post-meta',\n * args: {\n * key: 'url_custom_field',\n * },\n * },\n * alt: {\n * source: 'core/post-meta',\n * args: {\n * key: 'text_custom_field',\n * },\n * },\n * } );\n *\n * // Remove binding from url attribute.\n * updateBlockBindings( { url: undefined } );\n *\n * // Remove bindings from all attributes.\n * removeAllBlockBindings();\n * ```\n */\nexport function useBlockBindingsUtils() {\n\tconst { clientId } = useBlockEditContext();\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { getBlockAttributes } = useRegistry().select( blockEditorStore );\n\n\t/**\n\t * Updates the value of the bindings connected to block attributes.\n\t * It removes the binding when the new value is `undefined`.\n\t *\n\t * @param {Object} bindings Bindings including the attributes to update and the new object.\n\t * @param {string} bindings.source The source name to connect to.\n\t * @param {Object} [bindings.args] Object containing the arguments needed by the source.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { updateBlockBindings } = useBlockBindingsUtils();\n\t * updateBlockBindings( {\n\t * url: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'url_custom_field',\n\t * },\n\t * \t },\n\t * alt: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'text_custom_field',\n\t * },\n\t * \t }\n\t * } );\n\t * ```\n\t */\n\tconst updateBlockBindings = ( bindings ) => {\n\t\tconst { metadata: { bindings: currentBindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes(
|
|
1
|
+
{"version":3,"names":["_data","require","_store","_blockEdit","isObjectEmpty","object","Object","keys","length","useBlockBindingsUtils","clientId","contextClientId","useBlockEditContext","blockClientId","updateBlockAttributes","useDispatch","blockEditorStore","getBlockAttributes","useRegistry","select","updateBlockBindings","bindings","metadata","currentBindings","newBindings","entries","forEach","attribute","binding","newMetadata","undefined","removeAllBlockBindings"],"sources":["@wordpress/block-editor/src/utils/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useBlockEditContext } from '../components/block-edit';\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Contains utils to update the block `bindings` metadata.\n *\n * @typedef {Object} WPBlockBindingsUtils\n *\n * @property {Function} updateBlockBindings Updates the value of the bindings connected to block attributes.\n * @property {Function} removeAllBlockBindings Removes the bindings property of the `metadata` attribute.\n */\n\n/**\n * Retrieves the existing utils needed to update the block `bindings` metadata.\n * They can be used to create, modify, or remove connections from the existing block attributes.\n *\n * It contains the following utils:\n * - `updateBlockBindings`: Updates the value of the bindings connected to block attributes. It can be used to remove a specific binding by setting the value to `undefined`.\n * - `removeAllBlockBindings`: Removes the bindings property of the `metadata` attribute.\n *\n * @param {?string} clientId Optional block client ID. If not set, it will use the current block client ID from the context.\n *\n * @return {?WPBlockBindingsUtils} Object containing the block bindings utils.\n *\n * @example\n * ```js\n * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n * const { updateBlockBindings, removeAllBlockBindings } = useBlockBindingsUtils();\n *\n * // Update url and alt attributes.\n * updateBlockBindings( {\n * url: {\n * source: 'core/post-meta',\n * args: {\n * key: 'url_custom_field',\n * },\n * },\n * alt: {\n * source: 'core/post-meta',\n * args: {\n * key: 'text_custom_field',\n * },\n * },\n * } );\n *\n * // Remove binding from url attribute.\n * updateBlockBindings( { url: undefined } );\n *\n * // Remove bindings from all attributes.\n * removeAllBlockBindings();\n * ```\n */\nexport function useBlockBindingsUtils( clientId ) {\n\tconst { clientId: contextClientId } = useBlockEditContext();\n\tconst blockClientId = clientId || contextClientId;\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { getBlockAttributes } = useRegistry().select( blockEditorStore );\n\n\t/**\n\t * Updates the value of the bindings connected to block attributes.\n\t * It removes the binding when the new value is `undefined`.\n\t *\n\t * @param {Object} bindings Bindings including the attributes to update and the new object.\n\t * @param {string} bindings.source The source name to connect to.\n\t * @param {Object} [bindings.args] Object containing the arguments needed by the source.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { updateBlockBindings } = useBlockBindingsUtils();\n\t * updateBlockBindings( {\n\t * url: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'url_custom_field',\n\t * },\n\t * \t },\n\t * alt: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'text_custom_field',\n\t * },\n\t * \t }\n\t * } );\n\t * ```\n\t */\n\tconst updateBlockBindings = ( bindings ) => {\n\t\tconst { metadata: { bindings: currentBindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( blockClientId );\n\t\tconst newBindings = { ...currentBindings };\n\n\t\tObject.entries( bindings ).forEach( ( [ attribute, binding ] ) => {\n\t\t\tif ( ! binding && newBindings[ attribute ] ) {\n\t\t\t\tdelete newBindings[ attribute ];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnewBindings[ attribute ] = binding;\n\t\t} );\n\n\t\tconst newMetadata = {\n\t\t\t...metadata,\n\t\t\tbindings: newBindings,\n\t\t};\n\n\t\tif ( isObjectEmpty( newMetadata.bindings ) ) {\n\t\t\tdelete newMetadata.bindings;\n\t\t}\n\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\tmetadata: isObjectEmpty( newMetadata ) ? undefined : newMetadata,\n\t\t} );\n\t};\n\n\t/**\n\t * Removes the bindings property of the `metadata` attribute.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { removeAllBlockBindings } = useBlockBindingsUtils();\n\t * removeAllBlockBindings();\n\t * ```\n\t */\n\tconst removeAllBlockBindings = () => {\n\t\tconst { metadata: { bindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( blockClientId );\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\tmetadata: isObjectEmpty( metadata ) ? undefined : metadata,\n\t\t} );\n\t};\n\n\treturn { updateBlockBindings, removeAllBlockBindings };\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA,SAASG,aAAaA,CAAEC,MAAM,EAAG;EAChC,OAAO,CAAEA,MAAM,IAAIC,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,KAAK,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,qBAAqBA,CAAEC,QAAQ,EAAG;EACjD,MAAM;IAAEA,QAAQ,EAAEC;EAAgB,CAAC,GAAG,IAAAC,8BAAmB,EAAC,CAAC;EAC3D,MAAMC,aAAa,GAAGH,QAAQ,IAAIC,eAAe;EACjD,MAAM;IAAEG;EAAsB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EACjE,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAC,iBAAW,EAAC,CAAC,CAACC,MAAM,CAAEH,YAAiB,CAAC;;EAEvE;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAMI,mBAAmB,GAAKC,QAAQ,IAAM;IAC3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6 @@ function BlockListBlockProvider(props) {
|
|
|
549
549
|
mayDisplayParentControls: _hasBlockSupport(getBlockName(clientId), '__experimentalExposeControlsToChildren', false) && hasSelectedInnerBlock(clientId),
|
|
550
550
|
blockApiVersion: blockType?.apiVersion || 1,
|
|
551
551
|
blockTitle: match?.title || blockType?.title,
|
|
552
|
-
editorMode,
|
|
553
552
|
isSubtreeDisabled: blockEditingMode === 'disabled' && isBlockSubtreeDisabled(clientId),
|
|
554
553
|
hasOverlay: __unstableHasActiveBlockOverlayActive(clientId) && !isDragging(),
|
|
555
554
|
initialPosition: _isSelected && (editorMode === 'edit' || editorMode === 'zoom-out') // Don't recalculate the initialPosition when toggling in/out of zoom-out mode
|
|
@@ -583,7 +582,6 @@ function BlockListBlockProvider(props) {
|
|
|
583
582
|
themeSupportsLayout,
|
|
584
583
|
isTemporarilyEditingAsBlocks,
|
|
585
584
|
blockEditingMode,
|
|
586
|
-
editorMode,
|
|
587
585
|
mayDisplayControls,
|
|
588
586
|
mayDisplayParentControls,
|
|
589
587
|
index,
|
|
@@ -637,7 +635,6 @@ function BlockListBlockProvider(props) {
|
|
|
637
635
|
hasOverlay,
|
|
638
636
|
initialPosition,
|
|
639
637
|
blockEditingMode,
|
|
640
|
-
editorMode,
|
|
641
638
|
isHighlighted,
|
|
642
639
|
isMultiSelected,
|
|
643
640
|
isPartiallySelected,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","memo","useCallback","RawHTML","useContext","useMemo","getBlockType","getSaveContent","isUnmodifiedDefaultBlock","serializeRawBlock","switchToBlockType","getDefaultBlockName","isUnmodifiedBlock","isReusableBlock","getBlockDefaultClassName","hasBlockSupport","store","blocksStore","privateApis","blocksPrivateApis","withFilters","withDispatch","useDispatch","useSelect","compose","safeHTML","BlockEdit","BlockInvalidWarning","BlockCrashWarning","BlockCrashBoundary","BlockHtml","useBlockProps","blockEditorStore","useLayout","PrivateBlockContext","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","isUnmodifiedBlockContent","mergeWrapperProps","propsA","propsB","newProps","hasOwnProperty","className","style","Block","children","isHtml","props","__unstableIsHtml","BlockListBlock","block","__unstableBlockSource","mode","isLocked","canRemove","clientId","isSelected","isSelectionEnabled","__unstableLayoutClassNames","layoutClassNames","name","isValid","attributes","wrapperProps","setAttributes","onReplace","onInsertBlocksAfter","onMerge","toggleSelection","_wrapperProps","mayDisplayControls","mayDisplayParentControls","themeSupportsLayout","context","removeBlock","onRemove","parentLayout","blockEdit","insertBlocksAfter","undefined","mergeBlocks","__unstableParentLayout","Object","keys","length","blockEditingMode","isPreviewMode","blockType","getEditWrapperProps","isAligned","isSticky","includes","saveContent","display","apiVersion","dataAlign","restWrapperProps","updatedWrapperProps","Provider","value","fallback","applyWithDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","selectBlock","newAttributes","getMultiSelectedBlockClientIds","select","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","rootClientId","getBlockIndex","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockAttributes","getBlockName","getBlockOrder","getBlockRootClientId","canInsertBlockType","switchToDefaultOrRemove","defaultBlockName","replacement","nextBlockClientId","batch","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","blockOrder","firstClientId","firstBlock","isFirstBlockContentUnmodified","canTransformToDefaultBlock","every","canLiftAndTransformToDefaultBlock","nextRootClientId","rootAttributes","previousRootAttributes","key","previousBlockClientId","previousRootClientId","indexToSelect","initialPosition","replacementBlocks","Array","isArray","selectionEnabled","BlockListBlockProvider","selectedProps","isBlockSelected","getBlockMode","getTemplateLock","getBlockWithoutAttributes","canRemoveBlock","canMoveBlock","getSettings","getTemporarilyEditingAsBlocks","getBlockEditingMode","isFirstMultiSelectedBlock","hasSelectedInnerBlock","getBlocksByName","isBlockMultiSelected","isBlockSubtreeDisabled","isBlockHighlighted","__unstableIsFullySelected","__unstableSelectionHasUnmergeableBlock","isBlockBeingDragged","isDragging","hasBlockMovingClientId","__unstableHasActiveBlockOverlayActive","__unstableGetEditorMode","getSelectedBlocksInitialCaretPosition","blockWithoutAttributes","_hasBlockSupport","getActiveBlockVariation","blockName","supportsLayout","__unstableIsPreviewMode","hasLightBlockWrapper","previewContext","isReusable","defaultClassName","blockTitle","title","_isSelected","canMove","match","isMultiSelected","checkDeep","isAncestorOfSelectedBlock","movingClientId","multiple","blocksWithSameName","isInvalid","editorMode","templateLock","isTemporarilyEditingAsBlocks","id","blockApiVersion","isSubtreeDisabled","hasOverlay","isHighlighted","isPartiallySelected","hasChildSelected","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","originalBlockClientId","privateContext"],"sources":["@wordpress/block-editor/src/components/block-list/block.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tmemo,\n\tuseCallback,\n\tRawHTML,\n\tuseContext,\n\tuseMemo,\n} from '@wordpress/element';\nimport {\n\tgetBlockType,\n\tgetSaveContent,\n\tisUnmodifiedDefaultBlock,\n\tserializeRawBlock,\n\tswitchToBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n\tisReusableBlock,\n\tgetBlockDefaultClassName,\n\thasBlockSupport,\n\tstore as blocksStore,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\nimport { withFilters } from '@wordpress/components';\nimport { withDispatch, useDispatch, useSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { safeHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport BlockEdit from '../block-edit';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockCrashWarning from './block-crash-warning';\nimport BlockCrashBoundary from './block-crash-boundary';\nimport BlockHtml from './block-html';\nimport { useBlockProps } from './use-block-props';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport { PrivateBlockContext } from './private-block-context';\n\nimport { unlock } from '../../lock-unlock';\n\nconst { isUnmodifiedBlockContent } = unlock( blocksPrivateApis );\n\n/**\n * Merges wrapper props with special handling for classNames and styles.\n *\n * @param {Object} propsA\n * @param {Object} propsB\n *\n * @return {Object} Merged props.\n */\nfunction mergeWrapperProps( propsA, propsB ) {\n\tconst newProps = {\n\t\t...propsA,\n\t\t...propsB,\n\t};\n\n\t// May be set to undefined, so check if the property is set!\n\tif (\n\t\tpropsA?.hasOwnProperty( 'className' ) &&\n\t\tpropsB?.hasOwnProperty( 'className' )\n\t) {\n\t\tnewProps.className = clsx( propsA.className, propsB.className );\n\t}\n\n\tif (\n\t\tpropsA?.hasOwnProperty( 'style' ) &&\n\t\tpropsB?.hasOwnProperty( 'style' )\n\t) {\n\t\tnewProps.style = { ...propsA.style, ...propsB.style };\n\t}\n\n\treturn newProps;\n}\n\nfunction Block( { children, isHtml, ...props } ) {\n\treturn (\n\t\t<div { ...useBlockProps( props, { __unstableIsHtml: isHtml } ) }>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nfunction BlockListBlock( {\n\tblock: { __unstableBlockSource },\n\tmode,\n\tisLocked,\n\tcanRemove,\n\tclientId,\n\tisSelected,\n\tisSelectionEnabled,\n\tclassName,\n\t__unstableLayoutClassNames: layoutClassNames,\n\tname,\n\tisValid,\n\tattributes,\n\twrapperProps,\n\tsetAttributes,\n\tonReplace,\n\tonInsertBlocksAfter,\n\tonMerge,\n\ttoggleSelection,\n} ) {\n\tconst {\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\tthemeSupportsLayout,\n\t\t...context\n\t} = useContext( PrivateBlockContext );\n\tconst { removeBlock } = useDispatch( blockEditorStore );\n\tconst onRemove = useCallback(\n\t\t() => removeBlock( clientId ),\n\t\t[ clientId, removeBlock ]\n\t);\n\n\tconst parentLayout = useLayout() || {};\n\n\t// We wrap the BlockEdit component in a div that hides it when editing in\n\t// HTML mode. This allows us to render all of the ancillary pieces\n\t// (InspectorControls, etc.) which are inside `BlockEdit` but not\n\t// `BlockHTML`, even in HTML mode.\n\tlet blockEdit = (\n\t\t<BlockEdit\n\t\t\tname={ name }\n\t\t\tisSelected={ isSelected }\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tinsertBlocksAfter={ isLocked ? undefined : onInsertBlocksAfter }\n\t\t\tonReplace={ canRemove ? onReplace : undefined }\n\t\t\tonRemove={ canRemove ? onRemove : undefined }\n\t\t\tmergeBlocks={ canRemove ? onMerge : undefined }\n\t\t\tclientId={ clientId }\n\t\t\tisSelectionEnabled={ isSelectionEnabled }\n\t\t\ttoggleSelection={ toggleSelection }\n\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t\t__unstableParentLayout={\n\t\t\t\tObject.keys( parentLayout ).length ? parentLayout : undefined\n\t\t\t}\n\t\t\tmayDisplayControls={ mayDisplayControls }\n\t\t\tmayDisplayParentControls={ mayDisplayParentControls }\n\t\t\tblockEditingMode={ context.blockEditingMode }\n\t\t\tisPreviewMode={ context.isPreviewMode }\n\t\t/>\n\t);\n\n\tconst blockType = getBlockType( name );\n\n\t// Determine whether the block has props to apply to the wrapper.\n\tif ( blockType?.getEditWrapperProps ) {\n\t\twrapperProps = mergeWrapperProps(\n\t\t\twrapperProps,\n\t\t\tblockType.getEditWrapperProps( attributes )\n\t\t);\n\t}\n\n\tconst isAligned =\n\t\twrapperProps &&\n\t\t!! wrapperProps[ 'data-align' ] &&\n\t\t! themeSupportsLayout;\n\n\t// Support for sticky position in classic themes with alignment wrappers.\n\n\tconst isSticky = className?.includes( 'is-position-sticky' );\n\n\t// For aligned blocks, provide a wrapper element so the block can be\n\t// positioned relative to the block column.\n\t// This is only kept for classic themes that don't support layout\n\t// Historically we used to rely on extra divs and data-align to\n\t// provide the alignments styles in the editor.\n\t// Due to the differences between frontend and backend, we migrated\n\t// to the layout feature, and we're now aligning the markup of frontend\n\t// and backend.\n\tif ( isAligned ) {\n\t\tblockEdit = (\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'wp-block', isSticky && className ) }\n\t\t\t\tdata-align={ wrapperProps[ 'data-align' ] }\n\t\t\t>\n\t\t\t\t{ blockEdit }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet block;\n\n\tif ( ! isValid ) {\n\t\tconst saveContent = __unstableBlockSource\n\t\t\t? serializeRawBlock( __unstableBlockSource )\n\t\t\t: getSaveContent( blockType, attributes );\n\n\t\tblock = (\n\t\t\t<Block className=\"has-warning\">\n\t\t\t\t<BlockInvalidWarning clientId={ clientId } />\n\t\t\t\t<RawHTML>{ safeHTML( saveContent ) }</RawHTML>\n\t\t\t</Block>\n\t\t);\n\t} else if ( mode === 'html' ) {\n\t\t// Render blockEdit so the inspector controls don't disappear.\n\t\t// See #8969.\n\t\tblock = (\n\t\t\t<>\n\t\t\t\t<div style={ { display: 'none' } }>{ blockEdit }</div>\n\t\t\t\t<Block isHtml>\n\t\t\t\t\t<BlockHtml clientId={ clientId } />\n\t\t\t\t</Block>\n\t\t\t</>\n\t\t);\n\t} else if ( blockType?.apiVersion > 1 ) {\n\t\tblock = blockEdit;\n\t} else {\n\t\tblock = <Block>{ blockEdit }</Block>;\n\t}\n\n\tconst { 'data-align': dataAlign, ...restWrapperProps } = wrapperProps ?? {};\n\tconst updatedWrapperProps = {\n\t\t...restWrapperProps,\n\t\tclassName: clsx(\n\t\t\trestWrapperProps.className,\n\t\t\tdataAlign && themeSupportsLayout && `align${ dataAlign }`,\n\t\t\t! ( dataAlign && isSticky ) && className\n\t\t),\n\t};\n\n\t// We set a new context with the adjusted and filtered wrapperProps (through\n\t// `editor.BlockListBlock`), which the `BlockListBlockProvider` did not have\n\t// access to.\n\t// Note that the context value doesn't have to be memoized in this case\n\t// because when it changes, this component will be re-rendered anyway, and\n\t// none of the consumers (BlockListBlock and useBlockProps) are memoized or\n\t// \"pure\". This is different from the public BlockEditContext, where\n\t// consumers might be memoized or \"pure\".\n\treturn (\n\t\t<PrivateBlockContext.Provider\n\t\t\tvalue={ {\n\t\t\t\twrapperProps: updatedWrapperProps,\n\t\t\t\tisAligned,\n\t\t\t\t...context,\n\t\t\t} }\n\t\t>\n\t\t\t<BlockCrashBoundary\n\t\t\t\tfallback={\n\t\t\t\t\t<Block className=\"has-warning\">\n\t\t\t\t\t\t<BlockCrashWarning />\n\t\t\t\t\t</Block>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ block }\n\t\t\t</BlockCrashBoundary>\n\t\t</PrivateBlockContext.Provider>\n\t);\n}\n\nconst applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tinsertBlocks,\n\t\tmergeBlocks,\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tmoveBlocksToPosition,\n\t\tremoveBlock,\n\t\tselectBlock,\n\t} = dispatch( blockEditorStore );\n\n\t// Do not add new properties here, use `useDispatch` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tsetAttributes( newAttributes ) {\n\t\t\tconst { getMultiSelectedBlockClientIds } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst multiSelectedBlockClientIds =\n\t\t\t\tgetMultiSelectedBlockClientIds();\n\t\t\tconst { clientId } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes );\n\t\t},\n\t\tonInsertBlocks( blocks, index ) {\n\t\t\tconst { rootClientId } = ownProps;\n\t\t\tinsertBlocks( blocks, index, rootClientId );\n\t\t},\n\t\tonInsertBlocksAfter( blocks ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst { getBlockIndex } = registry.select( blockEditorStore );\n\t\t\tconst index = getBlockIndex( clientId );\n\t\t\tinsertBlocks( blocks, index + 1, rootClientId );\n\t\t},\n\t\tonMerge( forward ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst {\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\tfunction switchToDefaultOrRemove() {\n\t\t\t\tconst block = getBlock( clientId );\n\t\t\t\tconst defaultBlockName = getDefaultBlockName();\n\t\t\t\tif ( getBlockName( clientId ) !== defaultBlockName ) {\n\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tdefaultBlockName\n\t\t\t\t\t);\n\t\t\t\t\tif ( replacement && replacement.length ) {\n\t\t\t\t\t\treplaceBlocks( clientId, replacement );\n\t\t\t\t\t}\n\t\t\t\t} else if ( isUnmodifiedDefaultBlock( block ) ) {\n\t\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\t\t\t\t\tif ( nextBlockClientId ) {\n\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t\t\t\tselectBlock( nextBlockClientId );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t * convert to the default block type.\n\t\t\t *\n\t\t\t * @param {string} _clientId The block to move.\n\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t * to the moved block.\n\t\t\t */\n\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\tconst targetRootClientId = getBlockRootClientId( _clientId );\n\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\tif (\n\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t) {\n\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t} else {\n\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\tconst firstBlock = getBlock( firstClientId );\n\t\t\t\t\t\tconst isFirstBlockContentUnmodified =\n\t\t\t\t\t\t\tisUnmodifiedBlockContent( firstBlock );\n\t\t\t\t\t\tconst defaultBlockName = getDefaultBlockName();\n\t\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\t\tfirstBlock,\n\t\t\t\t\t\t\tdefaultBlockName\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst canTransformToDefaultBlock =\n\t\t\t\t\t\t\t!! replacement?.length &&\n\t\t\t\t\t\t\treplacement.every( ( block ) =>\n\t\t\t\t\t\t\t\tcanInsertBlockType( block.name, _clientId )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tisFirstBlockContentUnmodified &&\n\t\t\t\t\t\t\tcanTransformToDefaultBlock\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Step 1: If the block is empty and can be transformed to the default block type.\n\t\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\t\tfirstClientId,\n\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tisFirstBlockContentUnmodified &&\n\t\t\t\t\t\t\tfirstBlock.name === defaultBlockName\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Step 2: If the block is empty and is already the default block type.\n\t\t\t\t\t\t\tremoveBlock( firstClientId );\n\t\t\t\t\t\t\tconst nextBlockClientId =\n\t\t\t\t\t\t\t\tgetNextBlockClientId( clientId );\n\t\t\t\t\t\t\tif ( nextBlockClientId ) {\n\t\t\t\t\t\t\t\tselectBlock( nextBlockClientId );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tfirstBlock.name,\n\t\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Step 3: If the block can be moved up.\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ firstClientId ],\n\t\t\t\t\t\t\t\t_clientId,\n\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\tgetBlockIndex( _clientId )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst canLiftAndTransformToDefaultBlock =\n\t\t\t\t\t\t\t\t!! replacement?.length &&\n\t\t\t\t\t\t\t\treplacement.every( ( block ) =>\n\t\t\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( canLiftAndTransformToDefaultBlock ) {\n\t\t\t\t\t\t\t\t// Step 4: If the block can be transformed to the default block type and moved up.\n\t\t\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Step 5: Continue the default behavior.\n\t\t\t\t\t\t\t\tswitchToDefaultOrRemove();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! getBlockOrder( _clientId ).length &&\n\t\t\t\t\t\t\tisUnmodifiedBlock( getBlock( _clientId ) )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tremoveBlock( _clientId, false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t// as `Backspace`, but from the other block.\n\t\t\tif ( forward ) {\n\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( nextRootClientId );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\tgetBlockOrder( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t} else {\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t} else {\n\t\t\t\t\tswitchToDefaultOrRemove();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonReplace( blocks, indexToSelect, initialPosition ) {\n\t\t\tif (\n\t\t\t\tblocks.length &&\n\t\t\t\t! isUnmodifiedDefaultBlock( blocks[ blocks.length - 1 ] )\n\t\t\t) {\n\t\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t\t//Unsynced patterns are nested in an array so we need to flatten them.\n\t\t\tconst replacementBlocks =\n\t\t\t\tblocks?.length === 1 && Array.isArray( blocks[ 0 ] )\n\t\t\t\t\t? blocks[ 0 ]\n\t\t\t\t\t: blocks;\n\t\t\treplaceBlocks(\n\t\t\t\t[ ownProps.clientId ],\n\t\t\t\treplacementBlocks,\n\t\t\t\tindexToSelect,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t},\n\t\ttoggleSelection( selectionEnabled ) {\n\t\t\ttoggleSelection( selectionEnabled );\n\t\t},\n\t};\n} );\n\n// This component is used by the BlockListBlockProvider component below. It will\n// add the props necessary for the `editor.BlockListBlock` filters.\nBlockListBlock = compose(\n\tapplyWithDispatch,\n\twithFilters( 'editor.BlockListBlock' )\n)( BlockListBlock );\n\n// This component provides all the information we need through a single store\n// subscription (useSelect mapping). Only the necessary props are passed down\n// to the BlockListBlock component, which is a filtered component, so these\n// props are public API. To avoid adding to the public API, we use a private\n// context to pass the rest of the information to the filtered BlockListBlock\n// component, and useBlockProps.\nfunction BlockListBlockProvider( props ) {\n\tconst { clientId, rootClientId } = props;\n\tconst selectedProps = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockSelected,\n\t\t\t\tgetBlockMode,\n\t\t\t\tisSelectionEnabled,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockWithoutAttributes,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tcanRemoveBlock,\n\t\t\t\tcanMoveBlock,\n\n\t\t\t\tgetSettings,\n\t\t\t\tgetTemporarilyEditingAsBlocks,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockName,\n\t\t\t\tisFirstMultiSelectedBlock,\n\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlocksByName,\n\n\t\t\t\tgetBlockIndex,\n\t\t\t\tisBlockMultiSelected,\n\t\t\t\tisBlockSubtreeDisabled,\n\t\t\t\tisBlockHighlighted,\n\t\t\t\t__unstableIsFullySelected,\n\t\t\t\t__unstableSelectionHasUnmergeableBlock,\n\t\t\t\tisBlockBeingDragged,\n\t\t\t\tisDragging,\n\t\t\t\thasBlockMovingClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t\t__unstableHasActiveBlockOverlayActive,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t\tgetSelectedBlocksInitialCaretPosition,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst blockWithoutAttributes =\n\t\t\t\tgetBlockWithoutAttributes( clientId );\n\n\t\t\t// This is a temporary fix.\n\t\t\t// This function should never be called when a block is not\n\t\t\t// present in the state. It happens now because the order in\n\t\t\t// withSelect rendering is not correct.\n\t\t\tif ( ! blockWithoutAttributes ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\thasBlockSupport: _hasBlockSupport,\n\t\t\t\tgetActiveBlockVariation,\n\t\t\t} = select( blocksStore );\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\tconst { name: blockName, isValid } = blockWithoutAttributes;\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tconst { supportsLayout, __unstableIsPreviewMode: isPreviewMode } =\n\t\t\t\tgetSettings();\n\t\t\tconst hasLightBlockWrapper = blockType?.apiVersion > 1;\n\t\t\tconst previewContext = {\n\t\t\t\tisPreviewMode,\n\t\t\t\tblockWithoutAttributes,\n\t\t\t\tname: blockName,\n\t\t\t\tattributes,\n\t\t\t\tisValid,\n\t\t\t\tthemeSupportsLayout: supportsLayout,\n\t\t\t\tindex: getBlockIndex( clientId ),\n\t\t\t\tisReusable: isReusableBlock( blockType ),\n\t\t\t\tclassName: hasLightBlockWrapper\n\t\t\t\t\t? attributes.className\n\t\t\t\t\t: undefined,\n\t\t\t\tdefaultClassName: hasLightBlockWrapper\n\t\t\t\t\t? getBlockDefaultClassName( blockName )\n\t\t\t\t\t: undefined,\n\t\t\t\tblockTitle: blockType?.title,\n\t\t\t};\n\n\t\t\t// When in preview mode, we can avoid a lot of selection and\n\t\t\t// editing related selectors.\n\t\t\tif ( isPreviewMode ) {\n\t\t\t\treturn previewContext;\n\t\t\t}\n\n\t\t\tconst _isSelected = isBlockSelected( clientId );\n\t\t\tconst canRemove = canRemoveBlock( clientId );\n\t\t\tconst canMove = canMoveBlock( clientId );\n\t\t\tconst match = getActiveBlockVariation( blockName, attributes );\n\t\t\tconst isMultiSelected = isBlockMultiSelected( clientId );\n\t\t\tconst checkDeep = true;\n\t\t\tconst isAncestorOfSelectedBlock = hasSelectedInnerBlock(\n\t\t\t\tclientId,\n\t\t\t\tcheckDeep\n\t\t\t);\n\t\t\tconst movingClientId = hasBlockMovingClientId();\n\t\t\tconst blockEditingMode = getBlockEditingMode( clientId );\n\n\t\t\tconst multiple = hasBlockSupport( blockName, 'multiple', true );\n\n\t\t\t// For block types with `multiple` support, there is no \"original\n\t\t\t// block\" to be found in the content, as the block itself is valid.\n\t\t\tconst blocksWithSameName = multiple\n\t\t\t\t? []\n\t\t\t\t: getBlocksByName( blockName );\n\t\t\tconst isInvalid =\n\t\t\t\tblocksWithSameName.length &&\n\t\t\t\tblocksWithSameName[ 0 ] !== clientId;\n\n\t\t\tconst editorMode = __unstableGetEditorMode();\n\n\t\t\treturn {\n\t\t\t\t...previewContext,\n\t\t\t\tmode: getBlockMode( clientId ),\n\t\t\t\tisSelectionEnabled: isSelectionEnabled(),\n\t\t\t\tisLocked: !! getTemplateLock( rootClientId ),\n\t\t\t\ttemplateLock: getTemplateLock( clientId ),\n\t\t\t\tcanRemove,\n\t\t\t\tcanMove,\n\t\t\t\tisSelected: _isSelected,\n\t\t\t\tisTemporarilyEditingAsBlocks:\n\t\t\t\t\tgetTemporarilyEditingAsBlocks() === clientId,\n\t\t\t\tblockEditingMode,\n\t\t\t\tmayDisplayControls:\n\t\t\t\t\t_isSelected ||\n\t\t\t\t\t( isFirstMultiSelectedBlock( clientId ) &&\n\t\t\t\t\t\tgetMultiSelectedBlockClientIds().every(\n\t\t\t\t\t\t\t( id ) => getBlockName( id ) === blockName\n\t\t\t\t\t\t) ),\n\t\t\t\tmayDisplayParentControls:\n\t\t\t\t\t_hasBlockSupport(\n\t\t\t\t\t\tgetBlockName( clientId ),\n\t\t\t\t\t\t'__experimentalExposeControlsToChildren',\n\t\t\t\t\t\tfalse\n\t\t\t\t\t) && hasSelectedInnerBlock( clientId ),\n\t\t\t\tblockApiVersion: blockType?.apiVersion || 1,\n\t\t\t\tblockTitle: match?.title || blockType?.title,\n\t\t\t\teditorMode,\n\t\t\t\tisSubtreeDisabled:\n\t\t\t\t\tblockEditingMode === 'disabled' &&\n\t\t\t\t\tisBlockSubtreeDisabled( clientId ),\n\t\t\t\thasOverlay:\n\t\t\t\t\t__unstableHasActiveBlockOverlayActive( clientId ) &&\n\t\t\t\t\t! isDragging(),\n\t\t\t\tinitialPosition:\n\t\t\t\t\t_isSelected &&\n\t\t\t\t\t( editorMode === 'edit' || editorMode === 'zoom-out' ) // Don't recalculate the initialPosition when toggling in/out of zoom-out mode\n\t\t\t\t\t\t? getSelectedBlocksInitialCaretPosition()\n\t\t\t\t\t\t: undefined,\n\t\t\t\tisHighlighted: isBlockHighlighted( clientId ),\n\t\t\t\tisMultiSelected,\n\t\t\t\tisPartiallySelected:\n\t\t\t\t\tisMultiSelected &&\n\t\t\t\t\t! __unstableIsFullySelected() &&\n\t\t\t\t\t! __unstableSelectionHasUnmergeableBlock(),\n\t\t\t\tisDragging: isBlockBeingDragged( clientId ),\n\t\t\t\thasChildSelected: isAncestorOfSelectedBlock,\n\t\t\t\tisBlockMovingMode: !! movingClientId,\n\t\t\t\tcanInsertMovingBlock:\n\t\t\t\t\tmovingClientId &&\n\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\tgetBlockName( movingClientId ),\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\tisEditingDisabled: blockEditingMode === 'disabled',\n\t\t\t\thasEditableOutline:\n\t\t\t\t\tblockEditingMode !== 'disabled' &&\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled',\n\t\t\t\toriginalBlockClientId: isInvalid\n\t\t\t\t\t? blocksWithSameName[ 0 ]\n\t\t\t\t\t: false,\n\t\t\t};\n\t\t},\n\t\t[ clientId, rootClientId ]\n\t);\n\n\tconst {\n\t\tisPreviewMode,\n\t\t// Fill values that end up as a public API and may not be defined in\n\t\t// preview mode.\n\t\tmode = 'visual',\n\t\tisSelectionEnabled = false,\n\t\tisLocked = false,\n\t\tcanRemove = false,\n\t\tcanMove = false,\n\t\tblockWithoutAttributes,\n\t\tname,\n\t\tattributes,\n\t\tisValid,\n\t\tisSelected = false,\n\t\tthemeSupportsLayout,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tblockEditingMode,\n\t\teditorMode,\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\tindex,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\ttemplateLock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tclassName,\n\t\tdefaultClassName,\n\t\toriginalBlockClientId,\n\t} = selectedProps;\n\n\t// Users of the editor.BlockListBlock filter used to be able to\n\t// access the block prop.\n\t// Ideally these blocks would rely on the clientId prop only.\n\t// This is kept for backward compatibility reasons.\n\tconst block = useMemo(\n\t\t() => ( { ...blockWithoutAttributes, attributes } ),\n\t\t[ blockWithoutAttributes, attributes ]\n\t);\n\n\t// Block is sometimes not mounted at the right time, causing it be\n\t// undefined see issue for more info\n\t// https://github.com/WordPress/gutenberg/issues/17013\n\tif ( ! selectedProps ) {\n\t\treturn null;\n\t}\n\n\tconst privateContext = {\n\t\tisPreviewMode,\n\t\tclientId,\n\t\tclassName,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\teditorMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\ttemplateLock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\toriginalBlockClientId,\n\t\tthemeSupportsLayout,\n\t};\n\n\t// Here we separate between the props passed to BlockListBlock and any other\n\t// information we selected for internal use. BlockListBlock is a filtered\n\t// component and thus ALL the props are PUBLIC API.\n\n\t// Note that the context value doesn't have to be memoized in this case\n\t// because when it changes, this component will be re-rendered anyway, and\n\t// none of the consumers (BlockListBlock and useBlockProps) are memoized or\n\t// \"pure\". This is different from the public BlockEditContext, where\n\t// consumers might be memoized or \"pure\".\n\treturn (\n\t\t<PrivateBlockContext.Provider value={ privateContext }>\n\t\t\t<BlockListBlock\n\t\t\t\t{ ...props }\n\t\t\t\t// WARNING: all the following props are public API (through the\n\t\t\t\t// editor.BlockListBlock filter) and normally nothing new should\n\t\t\t\t// be added to it.\n\t\t\t\t{ ...{\n\t\t\t\t\tmode,\n\t\t\t\t\tisSelectionEnabled,\n\t\t\t\t\tisLocked,\n\t\t\t\t\tcanRemove,\n\t\t\t\t\tcanMove,\n\t\t\t\t\t// Users of the editor.BlockListBlock filter used to be able\n\t\t\t\t\t// to access the block prop. Ideally these blocks would rely\n\t\t\t\t\t// on the clientId prop only. This is kept for backward\n\t\t\t\t\t// compatibility reasons.\n\t\t\t\t\tblock,\n\t\t\t\t\tname,\n\t\t\t\t\tattributes,\n\t\t\t\t\tisValid,\n\t\t\t\t\tisSelected,\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PrivateBlockContext.Provider>\n\t);\n}\n\nexport default memo( BlockListBlockProvider );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,IAAI,EACJC,WAAW,EACXC,OAAO,EACPC,UAAU,EACVC,OAAO,QACD,oBAAoB;AAC3B,SACCC,YAAY,EACZC,cAAc,EACdC,wBAAwB,EACxBC,iBAAiB,EACjBC,iBAAiB,EACjBC,mBAAmB,EACnBC,iBAAiB,EACjBC,eAAe,EACfC,wBAAwB,EACxBC,eAAe,EACfC,KAAK,IAAIC,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;AAC1B,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,YAAY,EAAEC,WAAW,EAAEC,SAAS,QAAQ,iB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2B,CAAC;AAEjC;AAEA,eAAe7D,IAAI,CAAEmK,sBAAuB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","memo","useCallback","RawHTML","useContext","useMemo","getBlockType","getSaveContent","isUnmodifiedDefaultBlock","serializeRawBlock","switchToBlockType","getDefaultBlockName","isUnmodifiedBlock","isReusableBlock","getBlockDefaultClassName","hasBlockSupport","store","blocksStore","privateApis","blocksPrivateApis","withFilters","withDispatch","useDispatch","useSelect","compose","safeHTML","BlockEdit","BlockInvalidWarning","BlockCrashWarning","BlockCrashBoundary","BlockHtml","useBlockProps","blockEditorStore","useLayout","PrivateBlockContext","unlock","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","isUnmodifiedBlockContent","mergeWrapperProps","propsA","propsB","newProps","hasOwnProperty","className","style","Block","children","isHtml","props","__unstableIsHtml","BlockListBlock","block","__unstableBlockSource","mode","isLocked","canRemove","clientId","isSelected","isSelectionEnabled","__unstableLayoutClassNames","layoutClassNames","name","isValid","attributes","wrapperProps","setAttributes","onReplace","onInsertBlocksAfter","onMerge","toggleSelection","_wrapperProps","mayDisplayControls","mayDisplayParentControls","themeSupportsLayout","context","removeBlock","onRemove","parentLayout","blockEdit","insertBlocksAfter","undefined","mergeBlocks","__unstableParentLayout","Object","keys","length","blockEditingMode","isPreviewMode","blockType","getEditWrapperProps","isAligned","isSticky","includes","saveContent","display","apiVersion","dataAlign","restWrapperProps","updatedWrapperProps","Provider","value","fallback","applyWithDispatch","dispatch","ownProps","registry","updateBlockAttributes","insertBlocks","replaceBlocks","__unstableMarkLastChangeAsPersistent","moveBlocksToPosition","selectBlock","newAttributes","getMultiSelectedBlockClientIds","select","multiSelectedBlockClientIds","clientIds","onInsertBlocks","blocks","index","rootClientId","getBlockIndex","forward","getPreviousBlockClientId","getNextBlockClientId","getBlock","getBlockAttributes","getBlockName","getBlockOrder","getBlockRootClientId","canInsertBlockType","switchToDefaultOrRemove","defaultBlockName","replacement","nextBlockClientId","batch","moveFirstItemUp","_clientId","changeSelection","targetRootClientId","blockOrder","firstClientId","firstBlock","isFirstBlockContentUnmodified","canTransformToDefaultBlock","every","canLiftAndTransformToDefaultBlock","nextRootClientId","rootAttributes","previousRootAttributes","key","previousBlockClientId","previousRootClientId","indexToSelect","initialPosition","replacementBlocks","Array","isArray","selectionEnabled","BlockListBlockProvider","selectedProps","isBlockSelected","getBlockMode","getTemplateLock","getBlockWithoutAttributes","canRemoveBlock","canMoveBlock","getSettings","getTemporarilyEditingAsBlocks","getBlockEditingMode","isFirstMultiSelectedBlock","hasSelectedInnerBlock","getBlocksByName","isBlockMultiSelected","isBlockSubtreeDisabled","isBlockHighlighted","__unstableIsFullySelected","__unstableSelectionHasUnmergeableBlock","isBlockBeingDragged","isDragging","hasBlockMovingClientId","__unstableHasActiveBlockOverlayActive","__unstableGetEditorMode","getSelectedBlocksInitialCaretPosition","blockWithoutAttributes","_hasBlockSupport","getActiveBlockVariation","blockName","supportsLayout","__unstableIsPreviewMode","hasLightBlockWrapper","previewContext","isReusable","defaultClassName","blockTitle","title","_isSelected","canMove","match","isMultiSelected","checkDeep","isAncestorOfSelectedBlock","movingClientId","multiple","blocksWithSameName","isInvalid","editorMode","templateLock","isTemporarilyEditingAsBlocks","id","blockApiVersion","isSubtreeDisabled","hasOverlay","isHighlighted","isPartiallySelected","hasChildSelected","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","originalBlockClientId","privateContext"],"sources":["@wordpress/block-editor/src/components/block-list/block.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tmemo,\n\tuseCallback,\n\tRawHTML,\n\tuseContext,\n\tuseMemo,\n} from '@wordpress/element';\nimport {\n\tgetBlockType,\n\tgetSaveContent,\n\tisUnmodifiedDefaultBlock,\n\tserializeRawBlock,\n\tswitchToBlockType,\n\tgetDefaultBlockName,\n\tisUnmodifiedBlock,\n\tisReusableBlock,\n\tgetBlockDefaultClassName,\n\thasBlockSupport,\n\tstore as blocksStore,\n\tprivateApis as blocksPrivateApis,\n} from '@wordpress/blocks';\nimport { withFilters } from '@wordpress/components';\nimport { withDispatch, useDispatch, useSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { safeHTML } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport BlockEdit from '../block-edit';\nimport BlockInvalidWarning from './block-invalid-warning';\nimport BlockCrashWarning from './block-crash-warning';\nimport BlockCrashBoundary from './block-crash-boundary';\nimport BlockHtml from './block-html';\nimport { useBlockProps } from './use-block-props';\nimport { store as blockEditorStore } from '../../store';\nimport { useLayout } from './layout';\nimport { PrivateBlockContext } from './private-block-context';\n\nimport { unlock } from '../../lock-unlock';\n\nconst { isUnmodifiedBlockContent } = unlock( blocksPrivateApis );\n\n/**\n * Merges wrapper props with special handling for classNames and styles.\n *\n * @param {Object} propsA\n * @param {Object} propsB\n *\n * @return {Object} Merged props.\n */\nfunction mergeWrapperProps( propsA, propsB ) {\n\tconst newProps = {\n\t\t...propsA,\n\t\t...propsB,\n\t};\n\n\t// May be set to undefined, so check if the property is set!\n\tif (\n\t\tpropsA?.hasOwnProperty( 'className' ) &&\n\t\tpropsB?.hasOwnProperty( 'className' )\n\t) {\n\t\tnewProps.className = clsx( propsA.className, propsB.className );\n\t}\n\n\tif (\n\t\tpropsA?.hasOwnProperty( 'style' ) &&\n\t\tpropsB?.hasOwnProperty( 'style' )\n\t) {\n\t\tnewProps.style = { ...propsA.style, ...propsB.style };\n\t}\n\n\treturn newProps;\n}\n\nfunction Block( { children, isHtml, ...props } ) {\n\treturn (\n\t\t<div { ...useBlockProps( props, { __unstableIsHtml: isHtml } ) }>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nfunction BlockListBlock( {\n\tblock: { __unstableBlockSource },\n\tmode,\n\tisLocked,\n\tcanRemove,\n\tclientId,\n\tisSelected,\n\tisSelectionEnabled,\n\tclassName,\n\t__unstableLayoutClassNames: layoutClassNames,\n\tname,\n\tisValid,\n\tattributes,\n\twrapperProps,\n\tsetAttributes,\n\tonReplace,\n\tonInsertBlocksAfter,\n\tonMerge,\n\ttoggleSelection,\n} ) {\n\tconst {\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\tthemeSupportsLayout,\n\t\t...context\n\t} = useContext( PrivateBlockContext );\n\tconst { removeBlock } = useDispatch( blockEditorStore );\n\tconst onRemove = useCallback(\n\t\t() => removeBlock( clientId ),\n\t\t[ clientId, removeBlock ]\n\t);\n\n\tconst parentLayout = useLayout() || {};\n\n\t// We wrap the BlockEdit component in a div that hides it when editing in\n\t// HTML mode. This allows us to render all of the ancillary pieces\n\t// (InspectorControls, etc.) which are inside `BlockEdit` but not\n\t// `BlockHTML`, even in HTML mode.\n\tlet blockEdit = (\n\t\t<BlockEdit\n\t\t\tname={ name }\n\t\t\tisSelected={ isSelected }\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tinsertBlocksAfter={ isLocked ? undefined : onInsertBlocksAfter }\n\t\t\tonReplace={ canRemove ? onReplace : undefined }\n\t\t\tonRemove={ canRemove ? onRemove : undefined }\n\t\t\tmergeBlocks={ canRemove ? onMerge : undefined }\n\t\t\tclientId={ clientId }\n\t\t\tisSelectionEnabled={ isSelectionEnabled }\n\t\t\ttoggleSelection={ toggleSelection }\n\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t\t__unstableParentLayout={\n\t\t\t\tObject.keys( parentLayout ).length ? parentLayout : undefined\n\t\t\t}\n\t\t\tmayDisplayControls={ mayDisplayControls }\n\t\t\tmayDisplayParentControls={ mayDisplayParentControls }\n\t\t\tblockEditingMode={ context.blockEditingMode }\n\t\t\tisPreviewMode={ context.isPreviewMode }\n\t\t/>\n\t);\n\n\tconst blockType = getBlockType( name );\n\n\t// Determine whether the block has props to apply to the wrapper.\n\tif ( blockType?.getEditWrapperProps ) {\n\t\twrapperProps = mergeWrapperProps(\n\t\t\twrapperProps,\n\t\t\tblockType.getEditWrapperProps( attributes )\n\t\t);\n\t}\n\n\tconst isAligned =\n\t\twrapperProps &&\n\t\t!! wrapperProps[ 'data-align' ] &&\n\t\t! themeSupportsLayout;\n\n\t// Support for sticky position in classic themes with alignment wrappers.\n\n\tconst isSticky = className?.includes( 'is-position-sticky' );\n\n\t// For aligned blocks, provide a wrapper element so the block can be\n\t// positioned relative to the block column.\n\t// This is only kept for classic themes that don't support layout\n\t// Historically we used to rely on extra divs and data-align to\n\t// provide the alignments styles in the editor.\n\t// Due to the differences between frontend and backend, we migrated\n\t// to the layout feature, and we're now aligning the markup of frontend\n\t// and backend.\n\tif ( isAligned ) {\n\t\tblockEdit = (\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'wp-block', isSticky && className ) }\n\t\t\t\tdata-align={ wrapperProps[ 'data-align' ] }\n\t\t\t>\n\t\t\t\t{ blockEdit }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet block;\n\n\tif ( ! isValid ) {\n\t\tconst saveContent = __unstableBlockSource\n\t\t\t? serializeRawBlock( __unstableBlockSource )\n\t\t\t: getSaveContent( blockType, attributes );\n\n\t\tblock = (\n\t\t\t<Block className=\"has-warning\">\n\t\t\t\t<BlockInvalidWarning clientId={ clientId } />\n\t\t\t\t<RawHTML>{ safeHTML( saveContent ) }</RawHTML>\n\t\t\t</Block>\n\t\t);\n\t} else if ( mode === 'html' ) {\n\t\t// Render blockEdit so the inspector controls don't disappear.\n\t\t// See #8969.\n\t\tblock = (\n\t\t\t<>\n\t\t\t\t<div style={ { display: 'none' } }>{ blockEdit }</div>\n\t\t\t\t<Block isHtml>\n\t\t\t\t\t<BlockHtml clientId={ clientId } />\n\t\t\t\t</Block>\n\t\t\t</>\n\t\t);\n\t} else if ( blockType?.apiVersion > 1 ) {\n\t\tblock = blockEdit;\n\t} else {\n\t\tblock = <Block>{ blockEdit }</Block>;\n\t}\n\n\tconst { 'data-align': dataAlign, ...restWrapperProps } = wrapperProps ?? {};\n\tconst updatedWrapperProps = {\n\t\t...restWrapperProps,\n\t\tclassName: clsx(\n\t\t\trestWrapperProps.className,\n\t\t\tdataAlign && themeSupportsLayout && `align${ dataAlign }`,\n\t\t\t! ( dataAlign && isSticky ) && className\n\t\t),\n\t};\n\n\t// We set a new context with the adjusted and filtered wrapperProps (through\n\t// `editor.BlockListBlock`), which the `BlockListBlockProvider` did not have\n\t// access to.\n\t// Note that the context value doesn't have to be memoized in this case\n\t// because when it changes, this component will be re-rendered anyway, and\n\t// none of the consumers (BlockListBlock and useBlockProps) are memoized or\n\t// \"pure\". This is different from the public BlockEditContext, where\n\t// consumers might be memoized or \"pure\".\n\treturn (\n\t\t<PrivateBlockContext.Provider\n\t\t\tvalue={ {\n\t\t\t\twrapperProps: updatedWrapperProps,\n\t\t\t\tisAligned,\n\t\t\t\t...context,\n\t\t\t} }\n\t\t>\n\t\t\t<BlockCrashBoundary\n\t\t\t\tfallback={\n\t\t\t\t\t<Block className=\"has-warning\">\n\t\t\t\t\t\t<BlockCrashWarning />\n\t\t\t\t\t</Block>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ block }\n\t\t\t</BlockCrashBoundary>\n\t\t</PrivateBlockContext.Provider>\n\t);\n}\n\nconst applyWithDispatch = withDispatch( ( dispatch, ownProps, registry ) => {\n\tconst {\n\t\tupdateBlockAttributes,\n\t\tinsertBlocks,\n\t\tmergeBlocks,\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkLastChangeAsPersistent,\n\t\tmoveBlocksToPosition,\n\t\tremoveBlock,\n\t\tselectBlock,\n\t} = dispatch( blockEditorStore );\n\n\t// Do not add new properties here, use `useDispatch` instead to avoid\n\t// leaking new props to the public API (editor.BlockListBlock filter).\n\treturn {\n\t\tsetAttributes( newAttributes ) {\n\t\t\tconst { getMultiSelectedBlockClientIds } =\n\t\t\t\tregistry.select( blockEditorStore );\n\t\t\tconst multiSelectedBlockClientIds =\n\t\t\t\tgetMultiSelectedBlockClientIds();\n\t\t\tconst { clientId } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\tupdateBlockAttributes( clientIds, newAttributes );\n\t\t},\n\t\tonInsertBlocks( blocks, index ) {\n\t\t\tconst { rootClientId } = ownProps;\n\t\t\tinsertBlocks( blocks, index, rootClientId );\n\t\t},\n\t\tonInsertBlocksAfter( blocks ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst { getBlockIndex } = registry.select( blockEditorStore );\n\t\t\tconst index = getBlockIndex( clientId );\n\t\t\tinsertBlocks( blocks, index + 1, rootClientId );\n\t\t},\n\t\tonMerge( forward ) {\n\t\t\tconst { clientId, rootClientId } = ownProps;\n\t\t\tconst {\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetNextBlockClientId,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockOrder,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t} = registry.select( blockEditorStore );\n\n\t\t\tfunction switchToDefaultOrRemove() {\n\t\t\t\tconst block = getBlock( clientId );\n\t\t\t\tconst defaultBlockName = getDefaultBlockName();\n\t\t\t\tif ( getBlockName( clientId ) !== defaultBlockName ) {\n\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\tblock,\n\t\t\t\t\t\tdefaultBlockName\n\t\t\t\t\t);\n\t\t\t\t\tif ( replacement && replacement.length ) {\n\t\t\t\t\t\treplaceBlocks( clientId, replacement );\n\t\t\t\t\t}\n\t\t\t\t} else if ( isUnmodifiedDefaultBlock( block ) ) {\n\t\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\t\t\t\t\tif ( nextBlockClientId ) {\n\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t\t\t\tselectBlock( nextBlockClientId );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Moves the block with clientId up one level. If the block type\n\t\t\t * cannot be inserted at the new location, it will be attempted to\n\t\t\t * convert to the default block type.\n\t\t\t *\n\t\t\t * @param {string} _clientId The block to move.\n\t\t\t * @param {boolean} changeSelection Whether to change the selection\n\t\t\t * to the moved block.\n\t\t\t */\n\t\t\tfunction moveFirstItemUp( _clientId, changeSelection = true ) {\n\t\t\t\tconst targetRootClientId = getBlockRootClientId( _clientId );\n\t\t\t\tconst blockOrder = getBlockOrder( _clientId );\n\t\t\t\tconst [ firstClientId ] = blockOrder;\n\n\t\t\t\tif (\n\t\t\t\t\tblockOrder.length === 1 &&\n\t\t\t\t\tisUnmodifiedBlock( getBlock( firstClientId ) )\n\t\t\t\t) {\n\t\t\t\t\tremoveBlock( _clientId );\n\t\t\t\t} else {\n\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\tconst firstBlock = getBlock( firstClientId );\n\t\t\t\t\t\tconst isFirstBlockContentUnmodified =\n\t\t\t\t\t\t\tisUnmodifiedBlockContent( firstBlock );\n\t\t\t\t\t\tconst defaultBlockName = getDefaultBlockName();\n\t\t\t\t\t\tconst replacement = switchToBlockType(\n\t\t\t\t\t\t\tfirstBlock,\n\t\t\t\t\t\t\tdefaultBlockName\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst canTransformToDefaultBlock =\n\t\t\t\t\t\t\t!! replacement?.length &&\n\t\t\t\t\t\t\treplacement.every( ( block ) =>\n\t\t\t\t\t\t\t\tcanInsertBlockType( block.name, _clientId )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tisFirstBlockContentUnmodified &&\n\t\t\t\t\t\t\tcanTransformToDefaultBlock\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Step 1: If the block is empty and can be transformed to the default block type.\n\t\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\t\tfirstClientId,\n\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tisFirstBlockContentUnmodified &&\n\t\t\t\t\t\t\tfirstBlock.name === defaultBlockName\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Step 2: If the block is empty and is already the default block type.\n\t\t\t\t\t\t\tremoveBlock( firstClientId );\n\t\t\t\t\t\t\tconst nextBlockClientId =\n\t\t\t\t\t\t\t\tgetNextBlockClientId( clientId );\n\t\t\t\t\t\t\tif ( nextBlockClientId ) {\n\t\t\t\t\t\t\t\tselectBlock( nextBlockClientId );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tfirstBlock.name,\n\t\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Step 3: If the block can be moved up.\n\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t[ firstClientId ],\n\t\t\t\t\t\t\t\t_clientId,\n\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\tgetBlockIndex( _clientId )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst canLiftAndTransformToDefaultBlock =\n\t\t\t\t\t\t\t\t!! replacement?.length &&\n\t\t\t\t\t\t\t\treplacement.every( ( block ) =>\n\t\t\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( canLiftAndTransformToDefaultBlock ) {\n\t\t\t\t\t\t\t\t// Step 4: If the block can be transformed to the default block type and moved up.\n\t\t\t\t\t\t\t\tinsertBlocks(\n\t\t\t\t\t\t\t\t\treplacement,\n\t\t\t\t\t\t\t\t\tgetBlockIndex( _clientId ),\n\t\t\t\t\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t\t\t\t\tchangeSelection\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( firstClientId, false );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Step 5: Continue the default behavior.\n\t\t\t\t\t\t\t\tswitchToDefaultOrRemove();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t! getBlockOrder( _clientId ).length &&\n\t\t\t\t\t\t\tisUnmodifiedBlock( getBlock( _clientId ) )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tremoveBlock( _clientId, false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For `Delete` or forward merge, we should do the exact same thing\n\t\t\t// as `Backspace`, but from the other block.\n\t\t\tif ( forward ) {\n\t\t\t\tif ( rootClientId ) {\n\t\t\t\t\tconst nextRootClientId =\n\t\t\t\t\t\tgetNextBlockClientId( rootClientId );\n\n\t\t\t\t\tif ( nextRootClientId ) {\n\t\t\t\t\t\t// If there is a block that follows with the same parent\n\t\t\t\t\t\t// block name and the same attributes, merge the inner\n\t\t\t\t\t\t// blocks.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( nextRootClientId )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\t\tgetBlockAttributes( nextRootClientId );\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t\tgetBlockOrder( nextRootClientId ),\n\t\t\t\t\t\t\t\t\t\tnextRootClientId,\n\t\t\t\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tremoveBlock( nextRootClientId, false );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tmergeBlocks( rootClientId, nextRootClientId );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst nextBlockClientId = getNextBlockClientId( clientId );\n\n\t\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( getBlockOrder( nextBlockClientId ).length ) {\n\t\t\t\t\tmoveFirstItemUp( nextBlockClientId, false );\n\t\t\t\t} else {\n\t\t\t\t\tmergeBlocks( clientId, nextBlockClientId );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst previousBlockClientId =\n\t\t\t\t\tgetPreviousBlockClientId( clientId );\n\n\t\t\t\tif ( previousBlockClientId ) {\n\t\t\t\t\tmergeBlocks( previousBlockClientId, clientId );\n\t\t\t\t} else if ( rootClientId ) {\n\t\t\t\t\tconst previousRootClientId =\n\t\t\t\t\t\tgetPreviousBlockClientId( rootClientId );\n\n\t\t\t\t\t// If there is a preceding block with the same parent block\n\t\t\t\t\t// name and the same attributes, merge the inner blocks.\n\t\t\t\t\tif (\n\t\t\t\t\t\tpreviousRootClientId &&\n\t\t\t\t\t\tgetBlockName( rootClientId ) ===\n\t\t\t\t\t\t\tgetBlockName( previousRootClientId )\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst rootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( rootClientId );\n\t\t\t\t\t\tconst previousRootAttributes =\n\t\t\t\t\t\t\tgetBlockAttributes( previousRootClientId );\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tObject.keys( rootAttributes ).every(\n\t\t\t\t\t\t\t\t( key ) =>\n\t\t\t\t\t\t\t\t\trootAttributes[ key ] ===\n\t\t\t\t\t\t\t\t\tpreviousRootAttributes[ key ]\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\tgetBlockOrder( rootClientId ),\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tpreviousRootClientId\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tremoveBlock( rootClientId, false );\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tmoveFirstItemUp( rootClientId );\n\t\t\t\t} else {\n\t\t\t\t\tswitchToDefaultOrRemove();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonReplace( blocks, indexToSelect, initialPosition ) {\n\t\t\tif (\n\t\t\t\tblocks.length &&\n\t\t\t\t! isUnmodifiedDefaultBlock( blocks[ blocks.length - 1 ] )\n\t\t\t) {\n\t\t\t\t__unstableMarkLastChangeAsPersistent();\n\t\t\t}\n\t\t\t//Unsynced patterns are nested in an array so we need to flatten them.\n\t\t\tconst replacementBlocks =\n\t\t\t\tblocks?.length === 1 && Array.isArray( blocks[ 0 ] )\n\t\t\t\t\t? blocks[ 0 ]\n\t\t\t\t\t: blocks;\n\t\t\treplaceBlocks(\n\t\t\t\t[ ownProps.clientId ],\n\t\t\t\treplacementBlocks,\n\t\t\t\tindexToSelect,\n\t\t\t\tinitialPosition\n\t\t\t);\n\t\t},\n\t\ttoggleSelection( selectionEnabled ) {\n\t\t\ttoggleSelection( selectionEnabled );\n\t\t},\n\t};\n} );\n\n// This component is used by the BlockListBlockProvider component below. It will\n// add the props necessary for the `editor.BlockListBlock` filters.\nBlockListBlock = compose(\n\tapplyWithDispatch,\n\twithFilters( 'editor.BlockListBlock' )\n)( BlockListBlock );\n\n// This component provides all the information we need through a single store\n// subscription (useSelect mapping). Only the necessary props are passed down\n// to the BlockListBlock component, which is a filtered component, so these\n// props are public API. To avoid adding to the public API, we use a private\n// context to pass the rest of the information to the filtered BlockListBlock\n// component, and useBlockProps.\nfunction BlockListBlockProvider( props ) {\n\tconst { clientId, rootClientId } = props;\n\tconst selectedProps = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockSelected,\n\t\t\t\tgetBlockMode,\n\t\t\t\tisSelectionEnabled,\n\t\t\t\tgetTemplateLock,\n\t\t\t\tgetBlockWithoutAttributes,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tcanRemoveBlock,\n\t\t\t\tcanMoveBlock,\n\n\t\t\t\tgetSettings,\n\t\t\t\tgetTemporarilyEditingAsBlocks,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockName,\n\t\t\t\tisFirstMultiSelectedBlock,\n\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlocksByName,\n\n\t\t\t\tgetBlockIndex,\n\t\t\t\tisBlockMultiSelected,\n\t\t\t\tisBlockSubtreeDisabled,\n\t\t\t\tisBlockHighlighted,\n\t\t\t\t__unstableIsFullySelected,\n\t\t\t\t__unstableSelectionHasUnmergeableBlock,\n\t\t\t\tisBlockBeingDragged,\n\t\t\t\tisDragging,\n\t\t\t\thasBlockMovingClientId,\n\t\t\t\tcanInsertBlockType,\n\t\t\t\t__unstableHasActiveBlockOverlayActive,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t\tgetSelectedBlocksInitialCaretPosition,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst blockWithoutAttributes =\n\t\t\t\tgetBlockWithoutAttributes( clientId );\n\n\t\t\t// This is a temporary fix.\n\t\t\t// This function should never be called when a block is not\n\t\t\t// present in the state. It happens now because the order in\n\t\t\t// withSelect rendering is not correct.\n\t\t\tif ( ! blockWithoutAttributes ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\thasBlockSupport: _hasBlockSupport,\n\t\t\t\tgetActiveBlockVariation,\n\t\t\t} = select( blocksStore );\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\tconst { name: blockName, isValid } = blockWithoutAttributes;\n\t\t\tconst blockType = getBlockType( blockName );\n\t\t\tconst { supportsLayout, __unstableIsPreviewMode: isPreviewMode } =\n\t\t\t\tgetSettings();\n\t\t\tconst hasLightBlockWrapper = blockType?.apiVersion > 1;\n\t\t\tconst previewContext = {\n\t\t\t\tisPreviewMode,\n\t\t\t\tblockWithoutAttributes,\n\t\t\t\tname: blockName,\n\t\t\t\tattributes,\n\t\t\t\tisValid,\n\t\t\t\tthemeSupportsLayout: supportsLayout,\n\t\t\t\tindex: getBlockIndex( clientId ),\n\t\t\t\tisReusable: isReusableBlock( blockType ),\n\t\t\t\tclassName: hasLightBlockWrapper\n\t\t\t\t\t? attributes.className\n\t\t\t\t\t: undefined,\n\t\t\t\tdefaultClassName: hasLightBlockWrapper\n\t\t\t\t\t? getBlockDefaultClassName( blockName )\n\t\t\t\t\t: undefined,\n\t\t\t\tblockTitle: blockType?.title,\n\t\t\t};\n\n\t\t\t// When in preview mode, we can avoid a lot of selection and\n\t\t\t// editing related selectors.\n\t\t\tif ( isPreviewMode ) {\n\t\t\t\treturn previewContext;\n\t\t\t}\n\n\t\t\tconst _isSelected = isBlockSelected( clientId );\n\t\t\tconst canRemove = canRemoveBlock( clientId );\n\t\t\tconst canMove = canMoveBlock( clientId );\n\t\t\tconst match = getActiveBlockVariation( blockName, attributes );\n\t\t\tconst isMultiSelected = isBlockMultiSelected( clientId );\n\t\t\tconst checkDeep = true;\n\t\t\tconst isAncestorOfSelectedBlock = hasSelectedInnerBlock(\n\t\t\t\tclientId,\n\t\t\t\tcheckDeep\n\t\t\t);\n\t\t\tconst movingClientId = hasBlockMovingClientId();\n\t\t\tconst blockEditingMode = getBlockEditingMode( clientId );\n\n\t\t\tconst multiple = hasBlockSupport( blockName, 'multiple', true );\n\n\t\t\t// For block types with `multiple` support, there is no \"original\n\t\t\t// block\" to be found in the content, as the block itself is valid.\n\t\t\tconst blocksWithSameName = multiple\n\t\t\t\t? []\n\t\t\t\t: getBlocksByName( blockName );\n\t\t\tconst isInvalid =\n\t\t\t\tblocksWithSameName.length &&\n\t\t\t\tblocksWithSameName[ 0 ] !== clientId;\n\n\t\t\tconst editorMode = __unstableGetEditorMode();\n\n\t\t\treturn {\n\t\t\t\t...previewContext,\n\t\t\t\tmode: getBlockMode( clientId ),\n\t\t\t\tisSelectionEnabled: isSelectionEnabled(),\n\t\t\t\tisLocked: !! getTemplateLock( rootClientId ),\n\t\t\t\ttemplateLock: getTemplateLock( clientId ),\n\t\t\t\tcanRemove,\n\t\t\t\tcanMove,\n\t\t\t\tisSelected: _isSelected,\n\t\t\t\tisTemporarilyEditingAsBlocks:\n\t\t\t\t\tgetTemporarilyEditingAsBlocks() === clientId,\n\t\t\t\tblockEditingMode,\n\t\t\t\tmayDisplayControls:\n\t\t\t\t\t_isSelected ||\n\t\t\t\t\t( isFirstMultiSelectedBlock( clientId ) &&\n\t\t\t\t\t\tgetMultiSelectedBlockClientIds().every(\n\t\t\t\t\t\t\t( id ) => getBlockName( id ) === blockName\n\t\t\t\t\t\t) ),\n\t\t\t\tmayDisplayParentControls:\n\t\t\t\t\t_hasBlockSupport(\n\t\t\t\t\t\tgetBlockName( clientId ),\n\t\t\t\t\t\t'__experimentalExposeControlsToChildren',\n\t\t\t\t\t\tfalse\n\t\t\t\t\t) && hasSelectedInnerBlock( clientId ),\n\t\t\t\tblockApiVersion: blockType?.apiVersion || 1,\n\t\t\t\tblockTitle: match?.title || blockType?.title,\n\t\t\t\tisSubtreeDisabled:\n\t\t\t\t\tblockEditingMode === 'disabled' &&\n\t\t\t\t\tisBlockSubtreeDisabled( clientId ),\n\t\t\t\thasOverlay:\n\t\t\t\t\t__unstableHasActiveBlockOverlayActive( clientId ) &&\n\t\t\t\t\t! isDragging(),\n\t\t\t\tinitialPosition:\n\t\t\t\t\t_isSelected &&\n\t\t\t\t\t( editorMode === 'edit' || editorMode === 'zoom-out' ) // Don't recalculate the initialPosition when toggling in/out of zoom-out mode\n\t\t\t\t\t\t? getSelectedBlocksInitialCaretPosition()\n\t\t\t\t\t\t: undefined,\n\t\t\t\tisHighlighted: isBlockHighlighted( clientId ),\n\t\t\t\tisMultiSelected,\n\t\t\t\tisPartiallySelected:\n\t\t\t\t\tisMultiSelected &&\n\t\t\t\t\t! __unstableIsFullySelected() &&\n\t\t\t\t\t! __unstableSelectionHasUnmergeableBlock(),\n\t\t\t\tisDragging: isBlockBeingDragged( clientId ),\n\t\t\t\thasChildSelected: isAncestorOfSelectedBlock,\n\t\t\t\tisBlockMovingMode: !! movingClientId,\n\t\t\t\tcanInsertMovingBlock:\n\t\t\t\t\tmovingClientId &&\n\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\tgetBlockName( movingClientId ),\n\t\t\t\t\t\trootClientId\n\t\t\t\t\t),\n\t\t\t\tisEditingDisabled: blockEditingMode === 'disabled',\n\t\t\t\thasEditableOutline:\n\t\t\t\t\tblockEditingMode !== 'disabled' &&\n\t\t\t\t\tgetBlockEditingMode( rootClientId ) === 'disabled',\n\t\t\t\toriginalBlockClientId: isInvalid\n\t\t\t\t\t? blocksWithSameName[ 0 ]\n\t\t\t\t\t: false,\n\t\t\t};\n\t\t},\n\t\t[ clientId, rootClientId ]\n\t);\n\n\tconst {\n\t\tisPreviewMode,\n\t\t// Fill values that end up as a public API and may not be defined in\n\t\t// preview mode.\n\t\tmode = 'visual',\n\t\tisSelectionEnabled = false,\n\t\tisLocked = false,\n\t\tcanRemove = false,\n\t\tcanMove = false,\n\t\tblockWithoutAttributes,\n\t\tname,\n\t\tattributes,\n\t\tisValid,\n\t\tisSelected = false,\n\t\tthemeSupportsLayout,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tblockEditingMode,\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\tindex,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\ttemplateLock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tclassName,\n\t\tdefaultClassName,\n\t\toriginalBlockClientId,\n\t} = selectedProps;\n\n\t// Users of the editor.BlockListBlock filter used to be able to\n\t// access the block prop.\n\t// Ideally these blocks would rely on the clientId prop only.\n\t// This is kept for backward compatibility reasons.\n\tconst block = useMemo(\n\t\t() => ( { ...blockWithoutAttributes, attributes } ),\n\t\t[ blockWithoutAttributes, attributes ]\n\t);\n\n\t// Block is sometimes not mounted at the right time, causing it be\n\t// undefined see issue for more info\n\t// https://github.com/WordPress/gutenberg/issues/17013\n\tif ( ! selectedProps ) {\n\t\treturn null;\n\t}\n\n\tconst privateContext = {\n\t\tisPreviewMode,\n\t\tclientId,\n\t\tclassName,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\ttemplateLock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\toriginalBlockClientId,\n\t\tthemeSupportsLayout,\n\t};\n\n\t// Here we separate between the props passed to BlockListBlock and any other\n\t// information we selected for internal use. BlockListBlock is a filtered\n\t// component and thus ALL the props are PUBLIC API.\n\n\t// Note that the context value doesn't have to be memoized in this case\n\t// because when it changes, this component will be re-rendered anyway, and\n\t// none of the consumers (BlockListBlock and useBlockProps) are memoized or\n\t// \"pure\". This is different from the public BlockEditContext, where\n\t// consumers might be memoized or \"pure\".\n\treturn (\n\t\t<PrivateBlockContext.Provider value={ privateContext }>\n\t\t\t<BlockListBlock\n\t\t\t\t{ ...props }\n\t\t\t\t// WARNING: all the following props are public API (through the\n\t\t\t\t// editor.BlockListBlock filter) and normally nothing new should\n\t\t\t\t// be added to it.\n\t\t\t\t{ ...{\n\t\t\t\t\tmode,\n\t\t\t\t\tisSelectionEnabled,\n\t\t\t\t\tisLocked,\n\t\t\t\t\tcanRemove,\n\t\t\t\t\tcanMove,\n\t\t\t\t\t// Users of the editor.BlockListBlock filter used to be able\n\t\t\t\t\t// to access the block prop. Ideally these blocks would rely\n\t\t\t\t\t// on the clientId prop only. This is kept for backward\n\t\t\t\t\t// compatibility reasons.\n\t\t\t\t\tblock,\n\t\t\t\t\tname,\n\t\t\t\t\tattributes,\n\t\t\t\t\tisValid,\n\t\t\t\t\tisSelected,\n\t\t\t\t} }\n\t\t\t/>\n\t\t</PrivateBlockContext.Provider>\n\t);\n}\n\nexport default memo( BlockListBlockProvider );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA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;EACD,CAAC;;EAED;EACA;EACA;;EAEA;EACA;EACA;EACA;EACA;EACA,oBACCzC,IAAA,CAACH,mBAAmB,CAACsE,QAAQ;IAACC,KAAK,EAAGyH,cAAgB;IAAA/K,QAAA,eACrDd,IAAA,CAACkB,cAAc;MAAA,GACTF,KAAK;MAKTK,IAAI;MACJK,kBAAkB;MAClBJ,QAAQ;MACRC,SAAS;MACT8I,OAAO;MACP;MACA;MACA;MACA;MACAlJ,KAAK;MACLU,IAAI;MACJE,UAAU;MACVD,OAAO;MACPL;IAAU,CAEX;EAAC,CAC2B,CAAC;AAEjC;AAEA,eAAe7D,IAAI,CAAEmK,sBAAuB,CAAC","ignoreList":[]}
|
|
@@ -85,7 +85,6 @@ export function useBlockProps(props = {}, {
|
|
|
85
85
|
name,
|
|
86
86
|
blockApiVersion,
|
|
87
87
|
blockTitle,
|
|
88
|
-
editorMode,
|
|
89
88
|
isSelected,
|
|
90
89
|
isSubtreeDisabled,
|
|
91
90
|
hasOverlay,
|
|
@@ -115,9 +114,7 @@ export function useBlockProps(props = {}, {
|
|
|
115
114
|
}), useBlockRefProvider(clientId), useFocusHandler(clientId), useEventHandlers({
|
|
116
115
|
clientId,
|
|
117
116
|
isSelected
|
|
118
|
-
}), useNavModeExit(clientId), useZoomOutModeExit({
|
|
119
|
-
editorMode
|
|
120
|
-
}), useIsHovered({
|
|
117
|
+
}), useNavModeExit(clientId), useZoomOutModeExit(), useIsHovered({
|
|
121
118
|
clientId
|
|
122
119
|
}), useIntersectionObserver(), useMovingAnimation({
|
|
123
120
|
triggerAnimationOnChange: index,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useContext","__","sprintf","__unstableGetBlockProps","getBlockProps","useMergeRefs","useDisabled","warning","useMovingAnimation","PrivateBlockContext","useFocusFirstElement","useIsHovered","blockBindingsKey","useBlockEditContext","useFocusHandler","useEventHandlers","useNavModeExit","useZoomOutModeExit","useBlockRefProvider","useIntersectionObserver","useScrollIntoView","useFlashEditableBlocks","canBindBlock","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","editorMode","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","templateLock","blockLabel","htmlSuffix","mergedRefs","ref","triggerAnimationOnChange","isDisabled","isEnabled","blockEditContext","hasBlockBindings","bindingsStyle","globalThis","SCRIPT_DEBUG","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","id","role","inert","undefined","save"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../hooks/use-bindings-attributes';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\teditorMode,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\ttemplateLock,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseZoomOutModeExit( { editorMode } ),\n\t\tuseIsHovered( { clientId } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: name === 'core/block' || templateLock === 'contentOnly',\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,uBAAuB,IAAIC,aAAa,QAAQ,mBAAmB;AAC5E,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;AAC9D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AAe;MACpC,uBAAuB,EAAEC,mBAAmB;MAC5C,aAAa,EAAEC,UAAU;MACzB,aAAa,EAAEC,UAAU;MACzB,oBAAoB,EAAEC,gBAAgB;MACtC,sBAAsB,EAAEC,iBAAiB;MACzC,yBAAyB,EAAEC,oBAAoB;MAC/C,qBAAqB,EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,qBAAqB,EAAEgB,iBAAiB;MACxC,iDAAiD,EAChDf;IACF,CAAC,EACDxB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtByB,gBACD,CAAC;IACDe,KAAK,EAAE;MAAE,GAAGvC,YAAY,CAACuC,KAAK;MAAE,GAAG3C,KAAK,CAAC2C,KAAK;MAAE,GAAGJ;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACAxC,aAAa,CAACuD,IAAI,GAAG1E,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","useContext","__","sprintf","__unstableGetBlockProps","getBlockProps","useMergeRefs","useDisabled","warning","useMovingAnimation","PrivateBlockContext","useFocusFirstElement","useIsHovered","blockBindingsKey","useBlockEditContext","useFocusHandler","useEventHandlers","useNavModeExit","useZoomOutModeExit","useBlockRefProvider","useIntersectionObserver","useScrollIntoView","useFlashEditableBlocks","canBindBlock","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isBlockMovingMode","canInsertMovingBlock","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","templateLock","blockLabel","htmlSuffix","mergedRefs","ref","triggerAnimationOnChange","isDisabled","isEnabled","blockEditContext","hasBlockBindings","bindingsStyle","globalThis","SCRIPT_DEBUG","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","id","role","inert","undefined","save"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useNavModeExit } from './use-nav-mode-exit';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../hooks/use-bindings-attributes';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisBlockMovingMode,\n\t\tcanInsertMovingBlock,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\ttemplateLock,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseNavModeExit( clientId ),\n\t\tuseZoomOutModeExit(),\n\t\tuseIsHovered( { clientId } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: name === 'core/block' || templateLock === 'contentOnly',\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-block-moving-mode': isBlockMovingMode,\n\t\t\t\t'can-insert-moving-block': canInsertMovingBlock,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,uBAAuB,IAAIC,aAAa,QAAQ,mBAAmB;AAC5E,SAASC,YAAY,EAAEC,WAAW,QAAQ,oBAAoB;AAC9D,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,gBAAgB,EAChBC,mBAAmB,QACb,0BAA0B;AACjC,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,qCAAqC;AACtE,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,mBAAmB,QAAQ,kBAAkB;AACtD,SAASC,uBAAuB,QAAQ,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AAGJ;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACAvC,aAAa,CAACsD,IAAI,GAAGzE,aAAa","ignoreList":[]}
|
package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js
CHANGED
|
@@ -10,6 +10,7 @@ import { useRefEffect } from '@wordpress/compose';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { store as blockEditorStore } from '../../../store';
|
|
13
|
+
import { unlock } from '../../../lock-unlock';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Adds block behaviour:
|
|
@@ -25,12 +26,16 @@ export function useEventHandlers({
|
|
|
25
26
|
}) {
|
|
26
27
|
const {
|
|
27
28
|
getBlockRootClientId,
|
|
28
|
-
getBlockIndex
|
|
29
|
-
|
|
29
|
+
getBlockIndex,
|
|
30
|
+
isZoomOut,
|
|
31
|
+
__unstableGetEditorMode
|
|
32
|
+
} = unlock(useSelect(blockEditorStore));
|
|
30
33
|
const {
|
|
31
34
|
insertAfterBlock,
|
|
32
|
-
removeBlock
|
|
33
|
-
|
|
35
|
+
removeBlock,
|
|
36
|
+
__unstableSetEditorMode,
|
|
37
|
+
resetZoomLevel
|
|
38
|
+
} = unlock(useDispatch(blockEditorStore));
|
|
34
39
|
return useRefEffect(node => {
|
|
35
40
|
if (!isSelected) {
|
|
36
41
|
return;
|
|
@@ -57,7 +62,10 @@ export function useEventHandlers({
|
|
|
57
62
|
return;
|
|
58
63
|
}
|
|
59
64
|
event.preventDefault();
|
|
60
|
-
if (keyCode === ENTER) {
|
|
65
|
+
if (keyCode === ENTER && __unstableGetEditorMode() === 'zoom-out' && isZoomOut()) {
|
|
66
|
+
__unstableSetEditorMode('edit');
|
|
67
|
+
resetZoomLevel();
|
|
68
|
+
} else if (keyCode === ENTER) {
|
|
61
69
|
insertAfterBlock(clientId);
|
|
62
70
|
} else {
|
|
63
71
|
removeBlock(clientId);
|
|
@@ -79,6 +87,6 @@ export function useEventHandlers({
|
|
|
79
87
|
node.removeEventListener('keydown', onKeyDown);
|
|
80
88
|
node.removeEventListener('dragstart', onDragStart);
|
|
81
89
|
};
|
|
82
|
-
}, [clientId, isSelected, getBlockRootClientId, getBlockIndex, insertAfterBlock, removeBlock]);
|
|
90
|
+
}, [clientId, isSelected, getBlockRootClientId, getBlockIndex, insertAfterBlock, removeBlock, __unstableGetEditorMode, __unstableSetEditorMode, isZoomOut, resetZoomLevel]);
|
|
83
91
|
}
|
|
84
92
|
//# sourceMappingURL=use-selected-block-event-handlers.js.map
|
package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isTextField","ENTER","BACKSPACE","DELETE","useSelect","useDispatch","useRefEffect","store","blockEditorStore","useEventHandlers","clientId","isSelected","getBlockRootClientId","getBlockIndex","insertAfterBlock","removeBlock","node","onKeyDown","event","keyCode","target","preventDefault","onDragStart","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isTextField } from '@wordpress/dom';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\n\n/**\n * Adds block behaviour:\n * - Removes the block on BACKSPACE.\n * - Inserts a default block on ENTER.\n * - Disables dragging of block contents.\n *\n * @param {string} clientId Block client ID.\n */\nexport function useEventHandlers( { clientId, isSelected } ) {\n\tconst {
|
|
1
|
+
{"version":3,"names":["isTextField","ENTER","BACKSPACE","DELETE","useSelect","useDispatch","useRefEffect","store","blockEditorStore","unlock","useEventHandlers","clientId","isSelected","getBlockRootClientId","getBlockIndex","isZoomOut","__unstableGetEditorMode","insertAfterBlock","removeBlock","__unstableSetEditorMode","resetZoomLevel","node","onKeyDown","event","keyCode","target","preventDefault","onDragStart","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isTextField } from '@wordpress/dom';\nimport { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\n/**\n * Adds block behaviour:\n * - Removes the block on BACKSPACE.\n * - Inserts a default block on ENTER.\n * - Disables dragging of block contents.\n *\n * @param {string} clientId Block client ID.\n */\nexport function useEventHandlers( { clientId, isSelected } ) {\n\tconst {\n\t\tgetBlockRootClientId,\n\t\tgetBlockIndex,\n\t\tisZoomOut,\n\t\t__unstableGetEditorMode,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst {\n\t\tinsertAfterBlock,\n\t\tremoveBlock,\n\t\t__unstableSetEditorMode,\n\t\tresetZoomLevel,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! isSelected ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Interprets keydown event intent to remove or insert after block if\n\t\t\t * key event occurs on wrapper node. This can occur when the block has\n\t\t\t * no text fields of its own, particularly after initial insertion, to\n\t\t\t * allow for easy deletion and continuous writing flow to add additional\n\t\t\t * content.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keydown event.\n\t\t\t */\n\t\t\tfunction onKeyDown( event ) {\n\t\t\t\tconst { keyCode, target } = event;\n\n\t\t\t\tif (\n\t\t\t\t\tkeyCode !== ENTER &&\n\t\t\t\t\tkeyCode !== BACKSPACE &&\n\t\t\t\t\tkeyCode !== DELETE\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( target !== node || isTextField( target ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tif (\n\t\t\t\t\tkeyCode === ENTER &&\n\t\t\t\t\t__unstableGetEditorMode() === 'zoom-out' &&\n\t\t\t\t\tisZoomOut()\n\t\t\t\t) {\n\t\t\t\t\t__unstableSetEditorMode( 'edit' );\n\t\t\t\t\tresetZoomLevel();\n\t\t\t\t} else if ( keyCode === ENTER ) {\n\t\t\t\t\tinsertAfterBlock( clientId );\n\t\t\t\t} else {\n\t\t\t\t\tremoveBlock( clientId );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Prevents default dragging behavior within a block. To do: we must\n\t\t\t * handle this in the future and clean up the drag target.\n\t\t\t *\n\t\t\t * @param {DragEvent} event Drag event.\n\t\t\t */\n\t\t\tfunction onDragStart( event ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'keydown', onKeyDown );\n\t\t\tnode.addEventListener( 'dragstart', onDragStart );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'keydown', onKeyDown );\n\t\t\t\tnode.removeEventListener( 'dragstart', onDragStart );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tclientId,\n\t\t\tisSelected,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockIndex,\n\t\t\tinsertAfterBlock,\n\t\t\tremoveBlock,\n\t\t\t__unstableGetEditorMode,\n\t\t\t__unstableSetEditorMode,\n\t\t\tisZoomOut,\n\t\t\tresetZoomLevel,\n\t\t]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,KAAK,EAAEC,SAAS,EAAEC,MAAM,QAAQ,qBAAqB;AAC9D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,SAASC,KAAK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G,SAASgB,WAAWA,CAAEJ,KAAK,EAAG;MAC7BA,KAAK,CAACG,cAAc,CAAC,CAAC;IACvB;IAEAL,IAAI,CAACO,gBAAgB,CAAE,SAAS,EAAEN,SAAU,CAAC;IAC7CD,IAAI,CAACO,gBAAgB,CAAE,WAAW,EAAED,WAAY,CAAC;IAEjD,OAAO,MAAM;MACZN,IAAI,CAACQ,mBAAmB,CAAE,SAAS,EAAEP,SAAU,CAAC;MAChDD,IAAI,CAACQ,mBAAmB,CAAE,WAAW,EAAEF,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CACChB,QAAQ,EACRC,UAAU,EACVC,oBAAoB,EACpBC,aAAa,EACbG,gBAAgB,EAChBC,WAAW,EACXF,uBAAuB,EACvBG,uBAAuB,EACvBJ,SAAS,EACTK,cAAc,CAEhB,CAAC;AACF","ignoreList":[]}
|
|
@@ -12,27 +12,24 @@ import { unlock } from '../../../lock-unlock';
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Allows Zoom Out mode to be exited by double clicking in the selected block.
|
|
15
|
-
*
|
|
16
|
-
* @param {string} clientId Block client ID.
|
|
17
15
|
*/
|
|
18
|
-
export function useZoomOutModeExit({
|
|
19
|
-
editorMode
|
|
20
|
-
}) {
|
|
16
|
+
export function useZoomOutModeExit() {
|
|
21
17
|
const {
|
|
22
18
|
getSettings,
|
|
23
|
-
isZoomOut
|
|
19
|
+
isZoomOut,
|
|
20
|
+
__unstableGetEditorMode
|
|
24
21
|
} = unlock(useSelect(blockEditorStore));
|
|
25
22
|
const {
|
|
26
23
|
__unstableSetEditorMode,
|
|
27
24
|
resetZoomLevel
|
|
28
25
|
} = unlock(useDispatch(blockEditorStore));
|
|
29
26
|
return useRefEffect(node => {
|
|
30
|
-
// In "compose" mode.
|
|
31
|
-
const composeMode = editorMode === 'zoom-out' && isZoomOut();
|
|
32
|
-
if (!composeMode) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
27
|
function onDoubleClick(event) {
|
|
28
|
+
// In "compose" mode.
|
|
29
|
+
const composeMode = __unstableGetEditorMode() === 'zoom-out' && isZoomOut();
|
|
30
|
+
if (!composeMode) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
36
33
|
if (!event.defaultPrevented) {
|
|
37
34
|
event.preventDefault();
|
|
38
35
|
const {
|
|
@@ -49,6 +46,6 @@ export function useZoomOutModeExit({
|
|
|
49
46
|
return () => {
|
|
50
47
|
node.removeEventListener('dblclick', onDoubleClick);
|
|
51
48
|
};
|
|
52
|
-
}, [
|
|
49
|
+
}, [getSettings, __unstableSetEditorMode, __unstableGetEditorMode, isZoomOut, resetZoomLevel]);
|
|
53
50
|
}
|
|
54
51
|
//# sourceMappingURL=use-zoom-out-mode-exit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","useRefEffect","store","blockEditorStore","unlock","useZoomOutModeExit","
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","useRefEffect","store","blockEditorStore","unlock","useZoomOutModeExit","getSettings","isZoomOut","__unstableGetEditorMode","__unstableSetEditorMode","resetZoomLevel","node","onDoubleClick","event","composeMode","defaultPrevented","preventDefault","__experimentalSetIsInserterOpened","addEventListener","removeEventListener"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\n/**\n * Allows Zoom Out mode to be exited by double clicking in the selected block.\n */\nexport function useZoomOutModeExit() {\n\tconst { getSettings, isZoomOut, __unstableGetEditorMode } = unlock(\n\t\tuseSelect( blockEditorStore )\n\t);\n\n\tconst { __unstableSetEditorMode, resetZoomLevel } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onDoubleClick( event ) {\n\t\t\t\t// In \"compose\" mode.\n\t\t\t\tconst composeMode =\n\t\t\t\t\t__unstableGetEditorMode() === 'zoom-out' && isZoomOut();\n\n\t\t\t\tif ( ! composeMode ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! event.defaultPrevented ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\tconst { __experimentalSetIsInserterOpened } = getSettings();\n\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof __experimentalSetIsInserterOpened === 'function'\n\t\t\t\t\t) {\n\t\t\t\t\t\t__experimentalSetIsInserterOpened( false );\n\t\t\t\t\t}\n\t\t\t\t\t__unstableSetEditorMode( 'edit' );\n\t\t\t\t\tresetZoomLevel();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'dblclick', onDoubleClick );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'dblclick', onDoubleClick );\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tgetSettings,\n\t\t\t__unstableSetEditorMode,\n\t\t\t__unstableGetEditorMode,\n\t\t\tisZoomOut,\n\t\t\tresetZoomLevel,\n\t\t]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,QAAQ,oBAAoB;;AAEjD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,gBAAgB;AAC1D,SAASC,MAAM,QAAQ,sBAAsB;;AAE7C;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACpC,MAAM;IAAEC,WAAW;IAAEC,SAAS;IAAEC;EAAwB,CAAC,GAAGJ,MAAM,CACjEL,SAAS,CAAEI,gBAAiB,CAC7B,CAAC;EAED,MAAM;IAAEM,uBAAuB;IAAEC;EAAe,CAAC,GAAGN,MAAM,CACzDJ,WAAW,CAAEG,gBAAi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