@wordpress/block-editor 15.11.1-next.v.0 → 15.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-breadcrumb/index.cjs +10 -2
- package/build/components/block-breadcrumb/index.cjs.map +2 -2
- package/build/components/block-inspector/index.cjs +2 -2
- package/build/components/block-inspector/index.cjs.map +2 -2
- package/build/components/block-list/block.cjs +6 -3
- package/build/components/block-list/block.cjs.map +3 -3
- package/build/components/block-list/index.cjs +26 -18
- package/build/components/block-list/index.cjs.map +2 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs +2 -6
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs.map +2 -2
- package/build/components/block-list/use-in-between-inserter.cjs +4 -4
- package/build/components/block-list/use-in-between-inserter.cjs.map +2 -2
- package/build/components/block-settings-menu/block-settings-dropdown.cjs +10 -7
- package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +2 -2
- package/build/components/block-settings-menu-controls/edit-section-menu-item.cjs +1 -1
- package/build/components/block-settings-menu-controls/edit-section-menu-item.cjs.map +2 -2
- package/build/components/block-settings-menu-controls/index.cjs +10 -15
- package/build/components/block-settings-menu-controls/index.cjs.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.cjs +6 -4
- package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
- package/build/components/block-toolbar/index.cjs +1 -1
- package/build/components/block-toolbar/index.cjs.map +2 -2
- package/build/components/block-variation-transforms/index.cjs +1 -2
- package/build/components/block-variation-transforms/index.cjs.map +2 -2
- package/build/components/block-visibility/modal.cjs +5 -92
- package/build/components/block-visibility/modal.cjs.map +2 -2
- package/build/components/inserter/index.cjs +1 -0
- package/build/components/inserter/index.cjs.map +2 -2
- package/build/components/inspector-controls-tabs/index.cjs +2 -2
- package/build/components/inspector-controls-tabs/index.cjs.map +3 -3
- package/build/components/inspector-controls-tabs/styles-tab.cjs +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
- package/build/components/media-replace-flow/index.cjs +2 -2
- package/build/components/media-replace-flow/index.cjs.map +2 -2
- package/build/components/rich-text/index.cjs +1 -1
- package/build/components/rich-text/index.cjs.map +2 -2
- package/build/components/use-block-display-information/index.cjs +1 -1
- package/build/components/use-block-display-information/index.cjs.map +2 -2
- package/build/components/writing-flow/index.cjs +2 -0
- package/build/components/writing-flow/index.cjs.map +2 -2
- package/build/components/writing-flow/use-arrow-nav.cjs +3 -0
- package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
- package/build/components/writing-flow/use-drag-selection.cjs +2 -1
- package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
- package/build/components/writing-flow/use-preview-mode-nav.cjs +92 -0
- package/build/components/writing-flow/use-preview-mode-nav.cjs.map +7 -0
- package/build/hooks/block-renaming.cjs +1 -1
- package/build/hooks/block-renaming.cjs.map +2 -2
- package/build/hooks/custom-css.cjs +1 -1
- package/build/hooks/custom-css.cjs.map +2 -2
- package/build/hooks/index.cjs +0 -2
- package/build/hooks/index.cjs.map +3 -3
- package/build/store/actions.cjs +5 -0
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +1 -1
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +5 -7
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +15 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/fit-text-utils.cjs +17 -7
- package/build/utils/fit-text-utils.cjs.map +2 -2
- package/build-module/components/block-breadcrumb/index.mjs +10 -2
- package/build-module/components/block-breadcrumb/index.mjs.map +2 -2
- package/build-module/components/block-inspector/index.mjs +2 -2
- package/build-module/components/block-inspector/index.mjs.map +2 -2
- package/build-module/components/block-list/block.mjs +6 -3
- package/build-module/components/block-list/block.mjs.map +3 -3
- package/build-module/components/block-list/index.mjs +26 -18
- package/build-module/components/block-list/index.mjs.map +2 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs +2 -6
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs.map +2 -2
- package/build-module/components/block-list/use-in-between-inserter.mjs +4 -4
- package/build-module/components/block-list/use-in-between-inserter.mjs.map +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +10 -7
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
- package/build-module/components/block-settings-menu-controls/edit-section-menu-item.mjs +1 -1
- package/build-module/components/block-settings-menu-controls/edit-section-menu-item.mjs.map +2 -2
- package/build-module/components/block-settings-menu-controls/index.mjs +10 -15
- package/build-module/components/block-settings-menu-controls/index.mjs.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs +6 -4
- package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
- package/build-module/components/block-toolbar/index.mjs +1 -1
- package/build-module/components/block-toolbar/index.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +1 -2
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs +5 -92
- package/build-module/components/block-visibility/modal.mjs.map +2 -2
- package/build-module/components/inserter/index.mjs +1 -0
- package/build-module/components/inserter/index.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/index.mjs +2 -2
- package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
- package/build-module/components/media-replace-flow/index.mjs +2 -2
- package/build-module/components/media-replace-flow/index.mjs.map +2 -2
- package/build-module/components/rich-text/index.mjs +1 -1
- package/build-module/components/rich-text/index.mjs.map +2 -2
- package/build-module/components/use-block-display-information/index.mjs +1 -1
- package/build-module/components/use-block-display-information/index.mjs.map +2 -2
- package/build-module/components/writing-flow/index.mjs +2 -0
- package/build-module/components/writing-flow/index.mjs.map +2 -2
- package/build-module/components/writing-flow/use-arrow-nav.mjs +3 -0
- package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
- package/build-module/components/writing-flow/use-drag-selection.mjs +2 -1
- package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
- package/build-module/components/writing-flow/use-preview-mode-nav.mjs +67 -0
- package/build-module/components/writing-flow/use-preview-mode-nav.mjs.map +7 -0
- package/build-module/hooks/block-renaming.mjs +1 -1
- package/build-module/hooks/block-renaming.mjs.map +2 -2
- package/build-module/hooks/custom-css.mjs +1 -1
- package/build-module/hooks/custom-css.mjs.map +2 -2
- package/build-module/hooks/index.mjs +0 -2
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/store/actions.mjs +5 -0
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +1 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +5 -7
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +15 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/fit-text-utils.mjs +17 -7
- package/build-module/utils/fit-text-utils.mjs.map +2 -2
- package/build-style/content-rtl.css +10 -0
- package/build-style/content.css +10 -0
- package/package.json +39 -39
- package/src/components/block-breadcrumb/index.js +6 -1
- package/src/components/block-inspector/index.js +1 -4
- package/src/components/block-list/block.js +5 -2
- package/src/components/block-list/content.scss +11 -0
- package/src/components/block-list/index.js +25 -17
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +2 -7
- package/src/components/block-list/use-in-between-inserter.js +8 -6
- package/src/components/block-settings-menu/block-settings-dropdown.js +11 -6
- package/src/components/block-settings-menu-controls/edit-section-menu-item.js +1 -7
- package/src/components/block-settings-menu-controls/index.js +14 -16
- package/src/components/block-toolbar/block-toolbar-icon.js +6 -10
- package/src/components/block-toolbar/index.js +1 -7
- package/src/components/block-variation-transforms/index.js +1 -4
- package/src/components/inserter/index.js +1 -0
- package/src/components/inserter/stories/index.story.jsx +31 -24
- package/src/components/inspector-controls-tabs/index.js +1 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +7 -8
- package/src/components/media-replace-flow/index.js +3 -3
- package/src/components/rich-text/index.js +1 -1
- package/src/components/use-block-display-information/index.js +1 -5
- package/src/components/writing-flow/index.js +2 -0
- package/src/components/writing-flow/use-arrow-nav.js +5 -0
- package/src/components/writing-flow/use-drag-selection.js +7 -1
- package/src/components/writing-flow/use-preview-mode-nav.js +102 -0
- package/src/hooks/block-renaming.js +5 -2
- package/src/hooks/custom-css.js +1 -1
- package/src/hooks/index.js +0 -2
- package/src/store/actions.js +7 -0
- package/src/store/private-selectors.js +0 -1
- package/src/store/reducer.js +11 -18
- package/src/store/selectors.js +25 -0
- package/src/store/test/reducer.js +258 -266
- package/src/utils/fit-text-utils.js +24 -8
- package/build/components/content-lock/index.cjs +0 -31
- package/build/components/content-lock/index.cjs.map +0 -7
- package/build/components/content-lock/modify-content-lock-menu-item.cjs +0 -70
- package/build/components/content-lock/modify-content-lock-menu-item.cjs.map +0 -7
- package/build/hooks/content-lock-ui.cjs +0 -68
- package/build/hooks/content-lock-ui.cjs.map +0 -7
- package/build-module/components/content-lock/index.mjs +0 -6
- package/build-module/components/content-lock/index.mjs.map +0 -7
- package/build-module/components/content-lock/modify-content-lock-menu-item.mjs +0 -45
- package/build-module/components/content-lock/modify-content-lock-menu-item.mjs.map +0 -7
- package/build-module/hooks/content-lock-ui.mjs +0 -47
- package/build-module/hooks/content-lock-ui.mjs.map +0 -7
- package/src/components/content-lock/index.js +0 -1
- package/src/components/content-lock/modify-content-lock-menu-item.js +0 -67
- package/src/hooks/content-lock-ui.js +0 -76
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// packages/block-editor/src/components/writing-flow/use-preview-mode-nav.js
|
|
2
|
+
import { useRefEffect } from "@wordpress/compose";
|
|
3
|
+
import { useSelect } from "@wordpress/data";
|
|
4
|
+
import { TAB, UP, DOWN, LEFT, RIGHT } from "@wordpress/keycodes";
|
|
5
|
+
import { store as blockEditorStore } from "../../store/index.mjs";
|
|
6
|
+
function usePreviewModeNav() {
|
|
7
|
+
const isPreviewMode = useSelect(
|
|
8
|
+
(select) => select(blockEditorStore).getSettings().isPreviewMode,
|
|
9
|
+
[]
|
|
10
|
+
);
|
|
11
|
+
return useRefEffect(
|
|
12
|
+
(node) => {
|
|
13
|
+
if (!isPreviewMode) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
function onKeyDown(event) {
|
|
17
|
+
const { keyCode, shiftKey, target } = event;
|
|
18
|
+
const isTab = keyCode === TAB;
|
|
19
|
+
const isUp = keyCode === UP;
|
|
20
|
+
const isDown = keyCode === DOWN;
|
|
21
|
+
const isLeft = keyCode === LEFT;
|
|
22
|
+
const isRight = keyCode === RIGHT;
|
|
23
|
+
const isArrow = isUp || isDown || isLeft || isRight;
|
|
24
|
+
if (!isTab && !isArrow) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const isReverse = isTab ? shiftKey : isUp || isLeft;
|
|
28
|
+
const blocks = Array.from(
|
|
29
|
+
node.querySelectorAll("[data-block]")
|
|
30
|
+
);
|
|
31
|
+
if (!blocks.length) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const currentBlock = target.closest("[data-block]");
|
|
35
|
+
const currentIndex = currentBlock ? blocks.indexOf(currentBlock) : -1;
|
|
36
|
+
if (currentIndex === -1) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (isTab) {
|
|
40
|
+
if (isReverse && currentIndex === 0) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (!isReverse && currentIndex === blocks.length - 1) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
let nextIndex;
|
|
48
|
+
if (isReverse) {
|
|
49
|
+
nextIndex = currentIndex <= 0 ? blocks.length - 1 : currentIndex - 1;
|
|
50
|
+
} else {
|
|
51
|
+
nextIndex = currentIndex === -1 || currentIndex >= blocks.length - 1 ? 0 : currentIndex + 1;
|
|
52
|
+
}
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
blocks[nextIndex].focus();
|
|
55
|
+
}
|
|
56
|
+
node.addEventListener("keydown", onKeyDown);
|
|
57
|
+
return () => {
|
|
58
|
+
node.removeEventListener("keydown", onKeyDown);
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
[isPreviewMode]
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
usePreviewModeNav
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=use-preview-mode-nav.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/writing-flow/use-preview-mode-nav.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { TAB, UP, DOWN, LEFT, RIGHT } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * In preview mode, handles Tab and arrow key navigation to move only between\n * block elements, skipping all other focusable content.\n *\n * @return {Function} Ref callback.\n */\nexport function usePreviewModeNav() {\n\tconst isPreviewMode = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().isPreviewMode,\n\t\t[]\n\t);\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfunction onKeyDown( event ) {\n\t\t\t\tconst { keyCode, shiftKey, target } = event;\n\n\t\t\t\tconst isTab = keyCode === TAB;\n\t\t\t\tconst isUp = keyCode === UP;\n\t\t\t\tconst isDown = keyCode === DOWN;\n\t\t\t\tconst isLeft = keyCode === LEFT;\n\t\t\t\tconst isRight = keyCode === RIGHT;\n\t\t\t\tconst isArrow = isUp || isDown || isLeft || isRight;\n\n\t\t\t\tif ( ! isTab && ! isArrow ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst isReverse = isTab ? shiftKey : isUp || isLeft;\n\n\t\t\t\tconst blocks = Array.from(\n\t\t\t\t\tnode.querySelectorAll( '[data-block]' )\n\t\t\t\t);\n\n\t\t\t\tif ( ! blocks.length ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst currentBlock = target.closest( '[data-block]' );\n\t\t\t\tconst currentIndex = currentBlock\n\t\t\t\t\t? blocks.indexOf( currentBlock )\n\t\t\t\t\t: -1;\n\n\t\t\t\t// If focus is not on a block, don't intercept navigation.\n\t\t\t\tif ( currentIndex === -1 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// For Tab navigation, allow escaping the block list at boundaries.\n\t\t\t\t// For arrow keys, wrap around.\n\t\t\t\tif ( isTab ) {\n\t\t\t\t\tif ( isReverse && currentIndex === 0 ) {\n\t\t\t\t\t\t// At first block, Shift+Tab should exit the block list.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif ( ! isReverse && currentIndex === blocks.length - 1 ) {\n\t\t\t\t\t\t// At last block, Tab should exit the block list.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet nextIndex;\n\t\t\t\tif ( isReverse ) {\n\t\t\t\t\tnextIndex =\n\t\t\t\t\t\tcurrentIndex <= 0\n\t\t\t\t\t\t\t? blocks.length - 1\n\t\t\t\t\t\t\t: currentIndex - 1;\n\t\t\t\t} else {\n\t\t\t\t\tnextIndex =\n\t\t\t\t\t\tcurrentIndex === -1 || currentIndex >= blocks.length - 1\n\t\t\t\t\t\t\t? 0\n\t\t\t\t\t\t\t: currentIndex + 1;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\t\t\t\tblocks[ nextIndex ].focus();\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'keydown', onKeyDown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SAAS,IAChB,eAAe;AAAA,QACpB,OAAO;AACN,sBACC,iBAAiB,MAAM,gBAAgB,OAAO,SAAS,IACpD,IACA,eAAe;AAAA,QACpB;AAEA,cAAM,eAAe;AACrB,eAAQ,SAAU,EAAE,MAAM;AAAA,MAC3B;AAEA,WAAK,iBAAkB,WAAW,SAAU;AAC5C,aAAO,MAAM;AACZ,aAAK,oBAAqB,WAAW,SAAU;AAAA,MAChD;AAAA,IACD;AAAA,IACA,CAAE,aAAc;AAAA,EACjB;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -14,7 +14,7 @@ function addLabelCallback(settings) {
|
|
|
14
14
|
if (supportsBlockNaming) {
|
|
15
15
|
settings.__experimentalLabel = (attributes, { context }) => {
|
|
16
16
|
const { metadata } = attributes;
|
|
17
|
-
if (context === "list-view" && metadata?.name) {
|
|
17
|
+
if ((context === "list-view" || context === "breadcrumb") && metadata?.name) {
|
|
18
18
|
return metadata.name;
|
|
19
19
|
}
|
|
20
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/block-renaming.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Filters registered block settings, adding an `__experimentalLabel` callback if one does not already exist.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addLabelCallback( settings ) {\n\t// If blocks provide their own label callback, do not override it.\n\tif ( settings.__experimentalLabel ) {\n\t\treturn settings;\n\t}\n\n\tconst supportsBlockNaming = hasBlockSupport(\n\t\tsettings,\n\t\t'renaming',\n\t\ttrue // default value\n\t);\n\n\t// Check whether block metadata is supported before using it.\n\tif ( supportsBlockNaming ) {\n\t\tsettings.__experimentalLabel = ( attributes, { context } ) => {\n\t\t\tconst { metadata } = attributes;\n\n\t\t\t// In the list view, use the block's name attribute as the label.\n\t\t\tif ( context === 'list-view'
|
|
5
|
-
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AASzB,SAAS,iBAAkB,UAAW;AAE5C,MAAK,SAAS,qBAAsB;AACnC,WAAO;AAAA,EACR;AAEA,QAAM,sBAAsB;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA;AAAA,EACD;AAGA,MAAK,qBAAsB;AAC1B,aAAS,sBAAsB,CAAE,YAAY,EAAE,QAAQ,MAAO;AAC7D,YAAM,EAAE,SAAS,IAAI;AAGrB,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { hasBlockSupport } from '@wordpress/blocks';\n\n/**\n * Filters registered block settings, adding an `__experimentalLabel` callback if one does not already exist.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addLabelCallback( settings ) {\n\t// If blocks provide their own label callback, do not override it.\n\tif ( settings.__experimentalLabel ) {\n\t\treturn settings;\n\t}\n\n\tconst supportsBlockNaming = hasBlockSupport(\n\t\tsettings,\n\t\t'renaming',\n\t\ttrue // default value\n\t);\n\n\t// Check whether block metadata is supported before using it.\n\tif ( supportsBlockNaming ) {\n\t\tsettings.__experimentalLabel = ( attributes, { context } ) => {\n\t\t\tconst { metadata } = attributes;\n\n\t\t\t// In the list view and breadcrumb, use the block's name attribute as the label.\n\t\t\tif (\n\t\t\t\t( context === 'list-view' || context === 'breadcrumb' ) &&\n\t\t\t\tmetadata?.name\n\t\t\t) {\n\t\t\t\treturn metadata.name;\n\t\t\t}\n\t\t};\n\t}\n\n\treturn settings;\n}\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/metadata/addLabelCallback',\n\taddLabelCallback\n);\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AASzB,SAAS,iBAAkB,UAAW;AAE5C,MAAK,SAAS,qBAAsB;AACnC,WAAO;AAAA,EACR;AAEA,QAAM,sBAAsB;AAAA,IAC3B;AAAA,IACA;AAAA,IACA;AAAA;AAAA,EACD;AAGA,MAAK,qBAAsB;AAC1B,aAAS,sBAAsB,CAAE,YAAY,EAAE,QAAQ,MAAO;AAC7D,YAAM,EAAE,SAAS,IAAI;AAGrB,WACG,YAAY,eAAe,YAAY,iBACzC,UAAU,MACT;AACD,eAAO,SAAS;AAAA,MACjB;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AACR;AAEA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/custom-css.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { processCSSNesting } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport AdvancedPanel, {\n\tvalidateCSS,\n} from '../components/global-styles/advanced-panel';\nimport { cleanEmptyObject, useStyleOverride } from './utils';\nimport { store as blockEditorStore } from '../store';\n\n// Stable reference for useInstanceId.\nconst CUSTOM_CSS_INSTANCE_REFERENCE = {};\n\n// Stable empty object reference for useSelect.\nconst EMPTY_STYLE = {};\n\n/**\n * Inspector control for custom CSS.\n *\n * @param {Object} props Component props.\n * @param {string} props.blockName Block name.\n * @param {Function} props.setAttributes Function to set block attributes.\n * @param {Object} props.style Block style attribute.\n */\nfunction CustomCSSControl( { blockName, setAttributes, style } ) {\n\tconst blockType = getBlockType( blockName );\n\n\tfunction onChange( newStyle ) {\n\t\t// Normalize whitespace-only CSS to undefined so it gets cleaned up.\n\t\tconst css = newStyle?.css?.trim() ? newStyle.css : undefined;\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( { ...newStyle, css } ),\n\t\t} );\n\t}\n\n\tconst cssHelpText = sprintf(\n\t\t// translators: %s: is the name of a block e.g., 'Image' or 'Quote'.\n\t\t__(\n\t\t\t'Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value, e.g. color: red;.'\n\t\t),\n\t\tblockType?.title\n\t);\n\n\treturn (\n\t\t<InspectorControls group=\"advanced\">\n\t\t\t<AdvancedPanel\n\t\t\t\tvalue={ style }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tinheritedValue={ style }\n\t\t\t\thelp={ cssHelpText }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nfunction CustomCSSEdit( { clientId, name, setAttributes } ) {\n\tconst { style, canEditCSS } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes, getSettings } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tstyle: getBlockAttributes( clientId )?.style || EMPTY_STYLE,\n\t\t\t\tcanEditCSS: getSettings().canEditCSS,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Don't render the panel if user lacks edit_css capability.\n\tif ( ! canEditCSS ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<CustomCSSControl\n\t\t\tblockName={ name }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tstyle={ style }\n\t\t/>\n\t);\n}\n\n/**\n * Hook to handle custom CSS for a block in the editor.\n * Generates a unique class and applies scoped CSS via style override.\n *\n * @param {Object} props Block props.\n * @param {Object} props.style Block style attribute.\n * @return {Object} Block props including className for custom CSS scoping.\n */\nfunction useBlockProps( { style } ) {\n\tconst customCSS = style?.css;\n\n\t// Validate CSS is non-empty and passes validation checks.\n\tconst isValidCSS =\n\t\ttypeof customCSS === 'string' &&\n\t\tcustomCSS.trim().length > 0 &&\n\t\tvalidateCSS( customCSS );\n\n\tconst customCSSIdentifier = useInstanceId(\n\t\tCUSTOM_CSS_INSTANCE_REFERENCE,\n\t\t'wp-custom-css'\n\t);\n\n\tconst customCSSSelector = `.${ customCSSIdentifier }`;\n\n\t// Transform the custom CSS using the same logic as global styles.\n\t// Only process if CSS is valid (doesn't contain HTML markup).\n\tconst transformedCSS = useMemo( () => {\n\t\tif ( ! isValidCSS ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn processCSSNesting( customCSS, customCSSSelector );\n\t}, [ customCSS, customCSSSelector, isValidCSS ] );\n\n\t// Inject the CSS via style override.\n\tuseStyleOverride( { css: transformedCSS } );\n\n\t// Only add the class if there's valid custom CSS.\n\tif ( ! isValidCSS ) {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\tclassName: customCSSIdentifier
|
|
5
|
-
"mappings": ";AAGA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,cAAc,uBAAuB;AAC9C,SAAS,IAAI,eAAe;AAC5B,SAAS,yBAAyB;AAKlC,OAAO,uBAAuB;AAC9B,OAAO;AAAA,EACN;AAAA,OACM;AACP,SAAS,kBAAkB,wBAAwB;AACnD,SAAS,SAAS,wBAAwB;AAqCvC;AAlCH,IAAM,gCAAgC,CAAC;AAGvC,IAAM,cAAc,CAAC;AAUrB,SAAS,iBAAkB,EAAE,WAAW,eAAe,MAAM,GAAI;AAChE,QAAM,YAAY,aAAc,SAAU;AAE1C,WAAS,SAAU,UAAW;AAE7B,UAAM,MAAM,UAAU,KAAK,KAAK,IAAI,SAAS,MAAM;AACnD,kBAAe;AAAA,MACd,OAAO,iBAAkB,EAAE,GAAG,UAAU,IAAI,CAAE;AAAA,IAC/C,CAAE;AAAA,EACH;AAEA,QAAM,cAAc;AAAA;AAAA,IAEnB;AAAA,MACC;AAAA,IACD;AAAA,IACA,WAAW;AAAA,EACZ;AAEA,SACC,oBAAC,qBAAkB,OAAM,YACxB;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ;AAAA,MACR;AAAA,MACA,gBAAiB;AAAA,MACjB,MAAO;AAAA;AAAA,EACR,GACD;AAEF;AAEA,SAAS,cAAe,EAAE,UAAU,MAAM,cAAc,GAAI;AAC3D,QAAM,EAAE,OAAO,WAAW,IAAI;AAAA,IAC7B,CAAE,WAAY;AACb,YAAM,EAAE,oBAAoB,YAAY,IACvC,OAAQ,gBAAiB;AAC1B,aAAO;AAAA,QACN,OAAO,mBAAoB,QAAS,GAAG,SAAS;AAAA,QAChD,YAAY,YAAY,EAAE;AAAA,MAC3B;AAAA,IACD;AAAA,IACA,CAAE,QAAS;AAAA,EACZ;AAGA,MAAK,CAAE,YAAa;AACnB,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAY;AAAA,MACZ;AAAA,MACA;AAAA;AAAA,EACD;AAEF;AAUA,SAAS,cAAe,EAAE,MAAM,GAAI;AACnC,QAAM,YAAY,OAAO;AAGzB,QAAM,aACL,OAAO,cAAc,YACrB,UAAU,KAAK,EAAE,SAAS,KAC1B,YAAa,SAAU;AAExB,QAAM,sBAAsB;AAAA,IAC3B;AAAA,IACA;AAAA,EACD;AAEA,QAAM,oBAAoB,IAAK,mBAAoB;AAInD,QAAM,iBAAiB,QAAS,MAAM;AACrC,QAAK,CAAE,YAAa;AACnB,aAAO;AAAA,IACR;AACA,WAAO,kBAAmB,WAAW,iBAAkB;AAAA,EACxD,GAAG,CAAE,WAAW,mBAAmB,UAAW,CAAE;AAGhD,mBAAkB,EAAE,KAAK,eAAe,CAAE;AAG1C,MAAK,CAAE,YAAa;AACnB,WAAO,CAAC;AAAA,EACT;AAEA,SAAO;AAAA,IACN,WAAW;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { getBlockType, hasBlockSupport } from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { processCSSNesting } from '@wordpress/global-styles-engine';\n\n/**\n * Internal dependencies\n */\nimport InspectorControls from '../components/inspector-controls';\nimport AdvancedPanel, {\n\tvalidateCSS,\n} from '../components/global-styles/advanced-panel';\nimport { cleanEmptyObject, useStyleOverride } from './utils';\nimport { store as blockEditorStore } from '../store';\n\n// Stable reference for useInstanceId.\nconst CUSTOM_CSS_INSTANCE_REFERENCE = {};\n\n// Stable empty object reference for useSelect.\nconst EMPTY_STYLE = {};\n\n/**\n * Inspector control for custom CSS.\n *\n * @param {Object} props Component props.\n * @param {string} props.blockName Block name.\n * @param {Function} props.setAttributes Function to set block attributes.\n * @param {Object} props.style Block style attribute.\n */\nfunction CustomCSSControl( { blockName, setAttributes, style } ) {\n\tconst blockType = getBlockType( blockName );\n\n\tfunction onChange( newStyle ) {\n\t\t// Normalize whitespace-only CSS to undefined so it gets cleaned up.\n\t\tconst css = newStyle?.css?.trim() ? newStyle.css : undefined;\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( { ...newStyle, css } ),\n\t\t} );\n\t}\n\n\tconst cssHelpText = sprintf(\n\t\t// translators: %s: is the name of a block e.g., 'Image' or 'Quote'.\n\t\t__(\n\t\t\t'Add your own CSS to customize the appearance of the %s block. You do not need to include a CSS selector, just add the property and value, e.g. color: red;.'\n\t\t),\n\t\tblockType?.title\n\t);\n\n\treturn (\n\t\t<InspectorControls group=\"advanced\">\n\t\t\t<AdvancedPanel\n\t\t\t\tvalue={ style }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tinheritedValue={ style }\n\t\t\t\thelp={ cssHelpText }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nfunction CustomCSSEdit( { clientId, name, setAttributes } ) {\n\tconst { style, canEditCSS } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes, getSettings } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tstyle: getBlockAttributes( clientId )?.style || EMPTY_STYLE,\n\t\t\t\tcanEditCSS: getSettings().canEditCSS,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Don't render the panel if user lacks edit_css capability.\n\tif ( ! canEditCSS ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<CustomCSSControl\n\t\t\tblockName={ name }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tstyle={ style }\n\t\t/>\n\t);\n}\n\n/**\n * Hook to handle custom CSS for a block in the editor.\n * Generates a unique class and applies scoped CSS via style override.\n *\n * @param {Object} props Block props.\n * @param {Object} props.style Block style attribute.\n * @return {Object} Block props including className for custom CSS scoping.\n */\nfunction useBlockProps( { style } ) {\n\tconst customCSS = style?.css;\n\n\t// Validate CSS is non-empty and passes validation checks.\n\tconst isValidCSS =\n\t\ttypeof customCSS === 'string' &&\n\t\tcustomCSS.trim().length > 0 &&\n\t\tvalidateCSS( customCSS );\n\n\tconst customCSSIdentifier = useInstanceId(\n\t\tCUSTOM_CSS_INSTANCE_REFERENCE,\n\t\t'wp-custom-css'\n\t);\n\n\tconst customCSSSelector = `.${ customCSSIdentifier }`;\n\n\t// Transform the custom CSS using the same logic as global styles.\n\t// Only process if CSS is valid (doesn't contain HTML markup).\n\tconst transformedCSS = useMemo( () => {\n\t\tif ( ! isValidCSS ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn processCSSNesting( customCSS, customCSSSelector );\n\t}, [ customCSS, customCSSSelector, isValidCSS ] );\n\n\t// Inject the CSS via style override.\n\tuseStyleOverride( { css: transformedCSS } );\n\n\t// Only add the class if there's valid custom CSS.\n\tif ( ! isValidCSS ) {\n\t\treturn {};\n\t}\n\n\treturn {\n\t\tclassName: `has-custom-css ${ customCSSIdentifier }`,\n\t};\n}\n\n/**\n * Adds a marker class to blocks with custom CSS for server-side rendering.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type definition.\n * @param {Object} attributes Block's attributes.\n * @return {Object} Filtered props applied to save element.\n */\nfunction addSaveProps( props, blockType, attributes ) {\n\tif ( ! hasBlockSupport( blockType, 'customCSS', true ) ) {\n\t\treturn props;\n\t}\n\n\tif ( ! attributes?.style?.css?.trim() ) {\n\t\treturn props;\n\t}\n\n\t// Add a class to indicate this block has custom CSS.\n\t// The actual CSS is rendered server-side using the render_block filter.\n\tconst className = props.className\n\t\t? `${ props.className } has-custom-css`\n\t\t: 'has-custom-css';\n\n\treturn {\n\t\t...props,\n\t\tclassName,\n\t};\n}\n\nexport default {\n\tedit: CustomCSSEdit,\n\tuseBlockProps,\n\taddSaveProps,\n\tattributeKeys: [ 'style' ],\n\thasSupport( name ) {\n\t\treturn hasBlockSupport( name, 'customCSS', true );\n\t},\n};\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,cAAc,uBAAuB;AAC9C,SAAS,IAAI,eAAe;AAC5B,SAAS,yBAAyB;AAKlC,OAAO,uBAAuB;AAC9B,OAAO;AAAA,EACN;AAAA,OACM;AACP,SAAS,kBAAkB,wBAAwB;AACnD,SAAS,SAAS,wBAAwB;AAqCvC;AAlCH,IAAM,gCAAgC,CAAC;AAGvC,IAAM,cAAc,CAAC;AAUrB,SAAS,iBAAkB,EAAE,WAAW,eAAe,MAAM,GAAI;AAChE,QAAM,YAAY,aAAc,SAAU;AAE1C,WAAS,SAAU,UAAW;AAE7B,UAAM,MAAM,UAAU,KAAK,KAAK,IAAI,SAAS,MAAM;AACnD,kBAAe;AAAA,MACd,OAAO,iBAAkB,EAAE,GAAG,UAAU,IAAI,CAAE;AAAA,IAC/C,CAAE;AAAA,EACH;AAEA,QAAM,cAAc;AAAA;AAAA,IAEnB;AAAA,MACC;AAAA,IACD;AAAA,IACA,WAAW;AAAA,EACZ;AAEA,SACC,oBAAC,qBAAkB,OAAM,YACxB;AAAA,IAAC;AAAA;AAAA,MACA,OAAQ;AAAA,MACR;AAAA,MACA,gBAA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,QAAM,YAAY,MAAM,YACrB,GAAI,MAAM,SAAU,oBACpB;AAEH,SAAO;AAAA,IACN,GAAG;AAAA,IACH;AAAA,EACD;AACD;AAEA,IAAO,qBAAQ;AAAA,EACd,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA,eAAe,CAAE,OAAQ;AAAA,EACzB,WAAY,MAAO;AAClB,WAAO,gBAAiB,MAAM,aAAa,IAAK;AAAA,EACjD;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -30,7 +30,6 @@ import position from "./position.mjs";
|
|
|
30
30
|
import blockStyleVariation from "./block-style-variation.mjs";
|
|
31
31
|
import layout from "./layout.mjs";
|
|
32
32
|
import childLayout from "./layout-child.mjs";
|
|
33
|
-
import contentLockUI from "./content-lock-ui.mjs";
|
|
34
33
|
import "./metadata.mjs";
|
|
35
34
|
import blockHooks from "./block-hooks.mjs";
|
|
36
35
|
import blockBindingsPanel from "./block-bindings.mjs";
|
|
@@ -63,7 +62,6 @@ createBlockEditFilter(
|
|
|
63
62
|
fitText,
|
|
64
63
|
position,
|
|
65
64
|
layout,
|
|
66
|
-
contentLockUI,
|
|
67
65
|
blockHooks,
|
|
68
66
|
blockBindingsPanel,
|
|
69
67
|
childLayout,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport './cross-origin-isolation';\nimport align from './align';\nimport background from './background';\nimport './lock';\nimport allowedBlocks from './allowed-blocks';\nimport anchor from './anchor';\nimport ariaLabel from './aria-label';\nimport blockFields from './block-fields';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport './settings';\nimport color from './color';\nimport dimensions from './dimensions';\nimport duotone from './duotone';\nimport fontFamily from './font-family';\nimport fontSize from './font-size';\nimport textAlign from './text-align';\nimport fitText from './fit-text';\nimport border from './border';\nimport customCSS from './custom-css';\nimport position from './position';\nimport blockStyleVariation from './block-style-variation';\nimport layout from './layout';\nimport childLayout from './layout-child';\nimport
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO;AACP,OAAO;AACP,OAAO,WAAW;AAClB,OAAO,gBAAgB;AACvB,OAAO;AACP,OAAO,mBAAmB;AAC1B,OAAO,YAAY;AACnB,OAAO,eAAe;AACtB,OAAO,iBAAiB;AACxB,OAAO,qBAAqB;AAC5B,OAAO;AACP,OAAO,WAAW;AAClB,OAAO;AACP,OAAO,WAAW;AAClB,OAAO,gBAAgB;AACvB,OAAO,aAAa;AACpB,OAAO,gBAAgB;AACvB,OAAO,cAAc;AACrB,OAAO,eAAe;AACtB,OAAO,aAAa;AACpB,OAAO,YAAY;AACnB,OAAO,eAAe;AACtB,OAAO,cAAc;AACrB,OAAO,yBAAyB;AAChC,OAAO,YAAY;AACnB,OAAO,iBAAiB;AACxB,OAAO
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport {\n\tcreateBlockEditFilter,\n\tcreateBlockListBlockFilter,\n\tcreateBlockSaveFilter,\n} from './utils';\nimport './compat';\nimport './cross-origin-isolation';\nimport align from './align';\nimport background from './background';\nimport './lock';\nimport allowedBlocks from './allowed-blocks';\nimport anchor from './anchor';\nimport ariaLabel from './aria-label';\nimport blockFields from './block-fields';\nimport customClassName from './custom-class-name';\nimport './generated-class-name';\nimport style from './style';\nimport './settings';\nimport color from './color';\nimport dimensions from './dimensions';\nimport duotone from './duotone';\nimport fontFamily from './font-family';\nimport fontSize from './font-size';\nimport textAlign from './text-align';\nimport fitText from './fit-text';\nimport border from './border';\nimport customCSS from './custom-css';\nimport position from './position';\nimport blockStyleVariation from './block-style-variation';\nimport layout from './layout';\nimport childLayout from './layout-child';\nimport './metadata';\nimport blockHooks from './block-hooks';\nimport blockBindingsPanel from './block-bindings';\nimport listView from './list-view';\nimport './block-renaming';\nimport './grid-visualizer';\nimport autoInspectorControls from './auto-inspector-controls';\n\ncreateBlockEditFilter(\n\t[\n\t\talign,\n\t\ttextAlign,\n\t\tanchor,\n\t\tcustomClassName,\n\t\tstyle,\n\t\tcustomCSS,\n\t\tduotone,\n\t\tfitText,\n\t\tposition,\n\t\tlayout,\n\t\tblockHooks,\n\t\tblockBindingsPanel,\n\t\tchildLayout,\n\t\tallowedBlocks,\n\t\tblockFields,\n\t\tlistView,\n\t\tautoInspectorControls,\n\t].filter( Boolean )\n);\ncreateBlockListBlockFilter( [\n\talign,\n\ttextAlign,\n\tbackground,\n\tstyle,\n\tcolor,\n\tdimensions,\n\tduotone,\n\tfontFamily,\n\tfontSize,\n\tfitText,\n\tborder,\n\tcustomCSS,\n\tposition,\n\tblockStyleVariation,\n\tchildLayout,\n] );\ncreateBlockSaveFilter( [\n\talign,\n\ttextAlign,\n\tanchor,\n\tariaLabel,\n\tcustomClassName,\n\tborder,\n\tcustomCSS,\n\tfitText,\n\tcolor,\n\tstyle,\n\tfontFamily,\n\tfontSize,\n] );\n\nexport { useCustomSides } from './dimensions';\nexport { useLayoutClasses, useLayoutStyles } from './layout';\nexport { getBorderClassesAndStyles, useBorderProps } from './use-border-props';\nexport { getShadowClassesAndStyles } from './use-shadow-props';\nexport { getColorClassesAndStyles, useColorProps } from './use-color-props';\nexport { getSpacingClassesAndStyles } from './use-spacing-props';\nexport { getTypographyClassesAndStyles } from './use-typography-props';\nexport { getGapCSSValue } from './gap';\nexport { useCachedTruthy } from './use-cached-truthy';\nexport { setBackgroundStyleDefaults } from './background';\nexport { useZoomOut } from './use-zoom-out';\nexport { __unstableBlockStyleVariationOverridesWithConfig } from './block-style-variation';\nexport { useStyleOverride } from './utils';\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAA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EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAE;AACF,sBAAuB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAE;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -104,6 +104,11 @@ var selectPreviousBlock = (clientId, fallbackToParent = false) => ({ select, dis
|
|
|
104
104
|
const firstParentClientId = select.getBlockRootClientId(clientId);
|
|
105
105
|
if (firstParentClientId) {
|
|
106
106
|
dispatch.selectBlock(firstParentClientId, -1);
|
|
107
|
+
} else {
|
|
108
|
+
const nextBlockClientId = select.getNextBlockClientId(clientId);
|
|
109
|
+
if (nextBlockClientId) {
|
|
110
|
+
dispatch.selectBlock(nextBlockClientId, 0);
|
|
111
|
+
}
|
|
107
112
|
}
|
|
108
113
|
}
|
|
109
114
|
};
|