@wordpress/block-editor 15.11.1-next.v.0 → 15.12.1-next.v.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +11 -11
- package/build/components/block-inspector/index.cjs.map +3 -3
- 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/last-item.cjs +41 -0
- package/build/components/inspector-controls/last-item.cjs.map +7 -0
- 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 +4 -4
- 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/anchor.cjs +1 -1
- package/build/hooks/anchor.cjs.map +1 -1
- 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/grid-visualizer.cjs +42 -5
- package/build/hooks/grid-visualizer.cjs.map +3 -3
- package/build/hooks/index.cjs +0 -2
- package/build/hooks/index.cjs.map +3 -3
- package/build/hooks/layout-child.cjs +41 -5
- package/build/hooks/layout-child.cjs.map +3 -3
- package/build/private-apis.cjs +2 -0
- package/build/private-apis.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 +12 -11
- 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/last-item.mjs +23 -0
- package/build-module/components/inspector-controls/last-item.mjs.map +7 -0
- 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 +4 -4
- 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/anchor.mjs +1 -1
- package/build-module/hooks/anchor.mjs.map +1 -1
- 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/grid-visualizer.mjs +20 -5
- package/build-module/hooks/grid-visualizer.mjs.map +2 -2
- package/build-module/hooks/index.mjs +0 -2
- package/build-module/hooks/index.mjs.map +2 -2
- package/build-module/hooks/layout-child.mjs +31 -5
- package/build-module/hooks/layout-child.mjs.map +2 -2
- package/build-module/private-apis.mjs +2 -0
- package/build-module/private-apis.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 +20 -21
- 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/last-item.js +29 -0
- package/src/components/inspector-controls-tabs/index.js +1 -1
- package/src/components/inspector-controls-tabs/styles-tab.js +10 -11
- 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/anchor.js +1 -1
- package/src/hooks/block-renaming.js +5 -2
- package/src/hooks/custom-css.js +1 -1
- package/src/hooks/grid-visualizer.js +23 -4
- package/src/hooks/index.js +0 -2
- package/src/hooks/layout-child.js +39 -3
- package/src/private-apis.js +2 -0
- 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
|
@@ -29,20 +29,30 @@ function findOptimalFontSize(textElement, applyFontSize) {
|
|
|
29
29
|
let maxSize = 2400;
|
|
30
30
|
let bestSize = minSize;
|
|
31
31
|
const computedStyle = window.getComputedStyle(textElement);
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
let paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
|
|
33
|
+
let paddingRight = parseFloat(computedStyle.paddingRight) || 0;
|
|
34
34
|
const range = document.createRange();
|
|
35
35
|
range.selectNodeContents(textElement);
|
|
36
|
-
let
|
|
36
|
+
let referenceElement = textElement;
|
|
37
|
+
const parentElement = textElement.parentElement;
|
|
38
|
+
if (parentElement) {
|
|
39
|
+
const parentElementComputedStyle = window.getComputedStyle(parentElement);
|
|
40
|
+
if (parentElementComputedStyle?.display === "flex") {
|
|
41
|
+
referenceElement = parentElement;
|
|
42
|
+
paddingLeft += parseFloat(parentElementComputedStyle.paddingLeft) || 0;
|
|
43
|
+
paddingRight += parseFloat(parentElementComputedStyle.paddingRight) || 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
let maxclientHeight = referenceElement.clientHeight;
|
|
37
47
|
while (minSize <= maxSize) {
|
|
38
48
|
const midSize = Math.floor((minSize + maxSize) / 2);
|
|
39
49
|
applyFontSize(midSize);
|
|
40
50
|
const rect = range.getBoundingClientRect();
|
|
41
51
|
const textWidth = rect.width;
|
|
42
|
-
const fitsWidth = textElement.scrollWidth <=
|
|
43
|
-
const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <=
|
|
44
|
-
if (
|
|
45
|
-
maxclientHeight =
|
|
52
|
+
const fitsWidth = textElement.scrollWidth <= referenceElement.clientWidth && textWidth <= referenceElement.clientWidth - paddingLeft - paddingRight;
|
|
53
|
+
const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= referenceElement.clientHeight || textElement.scrollHeight <= maxclientHeight;
|
|
54
|
+
if (referenceElement.clientHeight > maxclientHeight) {
|
|
55
|
+
maxclientHeight = referenceElement.clientHeight;
|
|
46
56
|
}
|
|
47
57
|
if (fitsWidth && fitsHeight) {
|
|
48
58
|
bestSize = midSize;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/fit-text-utils.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Shared utility functions for fit text functionality.\n * Uses callback-based approach for maximum code reuse between editor and frontend.\n */\n\n/**\n * Find optimal font size using simple binary search between 0-2400px.\n *\n * @param {HTMLElement} textElement The text element\n * @param {Function} applyFontSize Function that receives font size in pixels\n * @return {number} Optimal font size\n */\nfunction findOptimalFontSize( textElement, applyFontSize ) {\n\tconst alreadyHasScrollableHeight =\n\t\ttextElement.scrollHeight > textElement.clientHeight;\n\tlet minSize = 0;\n\tlet maxSize = 2400;\n\tlet bestSize = minSize;\n\n\tconst computedStyle = window.getComputedStyle( textElement );\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,SAAS,oBAAqB,aAAa,eAAgB;AAC1D,QAAM,6BACL,YAAY,eAAe,YAAY;AACxC,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,WAAW;AAEf,QAAM,gBAAgB,OAAO,iBAAkB,WAAY;AAC3D,
|
|
4
|
+
"sourcesContent": ["/**\n * Shared utility functions for fit text functionality.\n * Uses callback-based approach for maximum code reuse between editor and frontend.\n */\n\n/**\n * Find optimal font size using simple binary search between 0-2400px.\n *\n * @param {HTMLElement} textElement The text element\n * @param {Function} applyFontSize Function that receives font size in pixels\n * @return {number} Optimal font size\n */\nfunction findOptimalFontSize( textElement, applyFontSize ) {\n\tconst alreadyHasScrollableHeight =\n\t\ttextElement.scrollHeight > textElement.clientHeight;\n\tlet minSize = 0;\n\tlet maxSize = 2400;\n\tlet bestSize = minSize;\n\n\tconst computedStyle = window.getComputedStyle( textElement );\n\tlet paddingLeft = parseFloat( computedStyle.paddingLeft ) || 0;\n\tlet paddingRight = parseFloat( computedStyle.paddingRight ) || 0;\n\tconst range = document.createRange();\n\trange.selectNodeContents( textElement );\n\n\tlet referenceElement = textElement;\n\tconst parentElement = textElement.parentElement;\n\tif ( parentElement ) {\n\t\tconst parentElementComputedStyle =\n\t\t\twindow.getComputedStyle( parentElement );\n\t\tif ( parentElementComputedStyle?.display === 'flex' ) {\n\t\t\treferenceElement = parentElement;\n\t\t\tpaddingLeft +=\n\t\t\t\tparseFloat( parentElementComputedStyle.paddingLeft ) || 0;\n\t\t\tpaddingRight +=\n\t\t\t\tparseFloat( parentElementComputedStyle.paddingRight ) || 0;\n\t\t}\n\t}\n\tlet maxclientHeight = referenceElement.clientHeight;\n\n\twhile ( minSize <= maxSize ) {\n\t\tconst midSize = Math.floor( ( minSize + maxSize ) / 2 );\n\t\tapplyFontSize( midSize );\n\n\t\t// When there is padding if the text overflows to the\n\t\t// padding area, it should be considered overflowing.\n\t\t// Use Range API to measure actual text content dimensions.\n\t\tconst rect = range.getBoundingClientRect();\n\t\tconst textWidth = rect.width;\n\n\t\t// Check if text fits within the element's width and is not\n\t\t// overflowing into the padding area.\n\t\tconst fitsWidth =\n\t\t\ttextElement.scrollWidth <= referenceElement.clientWidth &&\n\t\t\ttextWidth <=\n\t\t\t\treferenceElement.clientWidth - paddingLeft - paddingRight;\n\t\t// Check if text fits within the element's height.\n\t\tconst fitsHeight =\n\t\t\talreadyHasScrollableHeight ||\n\t\t\ttextElement.scrollHeight <= referenceElement.clientHeight ||\n\t\t\ttextElement.scrollHeight <= maxclientHeight;\n\n\t\t// When there are calculated line heights, text may jump in height\n\t\t// the available space may decrease while the font size decreases,\n\t\t// making text not fit.\n\t\t// We store a maximum reference height: the maximum reference element height that was observed\n\t\t// during the loop to avoid issues with such jumps.\n\t\tif ( referenceElement.clientHeight > maxclientHeight ) {\n\t\t\tmaxclientHeight = referenceElement.clientHeight;\n\t\t}\n\n\t\tif ( fitsWidth && fitsHeight ) {\n\t\t\tbestSize = midSize;\n\t\t\tminSize = midSize + 1;\n\t\t} else {\n\t\t\tmaxSize = midSize - 1;\n\t\t}\n\t}\n\trange.detach();\n\n\treturn bestSize;\n}\n\n/**\n * Complete fit text optimization for a single text element.\n * Handles the full flow using callbacks for font size application.\n *\n * @param {HTMLElement} textElement The text element (paragraph, heading, etc.)\n * @param {Function} applyFontSize Function that receives font size in pixels (0 to clear, >0 to apply)\n */\nexport function optimizeFitText( textElement, applyFontSize ) {\n\tif ( ! textElement ) {\n\t\treturn;\n\t}\n\n\tapplyFontSize( 0 );\n\n\tconst optimalSize = findOptimalFontSize( textElement, applyFontSize );\n\n\tapplyFontSize( optimalSize );\n\treturn optimalSize;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,SAAS,oBAAqB,aAAa,eAAgB;AAC1D,QAAM,6BACL,YAAY,eAAe,YAAY;AACxC,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,WAAW;AAEf,QAAM,gBAAgB,OAAO,iBAAkB,WAAY;AAC3D,MAAI,cAAc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
clientId: parentClientId,
|
|
81
|
-
maximumLength: 35
|
|
81
|
+
maximumLength: 35,
|
|
82
|
+
context: "breadcrumb"
|
|
82
83
|
}
|
|
83
84
|
)
|
|
84
85
|
}
|
|
@@ -96,7 +97,14 @@ function BlockBreadcrumb({ rootLabelText }) {
|
|
|
96
97
|
{
|
|
97
98
|
className: "block-editor-block-breadcrumb__current",
|
|
98
99
|
"aria-current": "true",
|
|
99
|
-
children: /* @__PURE__ */ jsx(
|
|
100
|
+
children: /* @__PURE__ */ jsx(
|
|
101
|
+
BlockTitle,
|
|
102
|
+
{
|
|
103
|
+
clientId,
|
|
104
|
+
maximumLength: 35,
|
|
105
|
+
context: "breadcrumb"
|
|
106
|
+
}
|
|
107
|
+
)
|
|
100
108
|
}
|
|
101
109
|
)
|
|
102
110
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/block-breadcrumb/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { chevronRightSmall, Icon } from '@wordpress/icons';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockTitle from '../block-title';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useBlockElementRef } from '../block-list/use-block-props/use-block-refs';\nimport getEditorRegion from '../../utils/get-editor-region';\n\n/**\n * Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb.\n *\n * @param {Object} props Component props.\n * @param {string} props.rootLabelText Translated label for the root element of the breadcrumb trail.\n * @return {Element} Block Breadcrumb.\n */\nfunction BlockBreadcrumb( { rootLabelText } ) {\n\tconst { selectBlock, clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { clientId, parents, hasSelection } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetEnabledBlockParents,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tparents: getEnabledBlockParents( selectedBlockClientId ),\n\t\t\tclientId: selectedBlockClientId,\n\t\t\thasSelection: !! getSelectionStart().clientId,\n\t\t};\n\t}, [] );\n\n\t// translators: Default label for the Document in the Block Breadcrumb.\n\tconst rootLabel = rootLabelText || _x( 'Document', 'noun, breadcrumb' );\n\n\t// We don't care about this specific ref, but this is a way\n\t// to get a ref within the editor canvas so we can focus it later.\n\tconst blockRef = useRef();\n\tuseBlockElementRef( clientId, blockRef );\n\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\treturn (\n\t\t<ul\n\t\t\tclassName=\"block-editor-block-breadcrumb\"\n\t\t\trole=\"list\"\n\t\t\taria-label={ __( 'Block breadcrumb' ) }\n\t\t>\n\t\t\t<li\n\t\t\t\tclassName={\n\t\t\t\t\t! hasSelection\n\t\t\t\t\t\t? 'block-editor-block-breadcrumb__current'\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\taria-current={ ! hasSelection ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ hasSelection && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__button\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Find the block editor wrapper for the selected block\n\t\t\t\t\t\t\tconst blockEditor = blockRef.current?.closest(\n\t\t\t\t\t\t\t\t'.editor-styles-wrapper'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tclearSelectedBlock();\n\n\t\t\t\t\t\t\tgetEditorRegion( blockEditor )?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ rootLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\t{ ! hasSelection && <span>{ rootLabel }</span> }\n\t\t\t\t{ !! clientId && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__separator\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</li>\n\n\t\t\t{ parents.map( ( parentClientId ) => (\n\t\t\t\t<li key={ parentClientId }>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__button\"\n\t\t\t\t\t\tonClick={ () => selectBlock( parentClientId ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTitle\n\t\t\t\t\t\t\tclientId={ parentClientId }\n\t\t\t\t\t\t\tmaximumLength={ 35 }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__separator\"\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t\t{ !! clientId && (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__current\"\n\t\t\t\t\taria-current=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<BlockTitle
|
|
5
|
-
"mappings": ";AAGA,SAAS,cAAc;AACvB,SAAS,WAAW,mBAAmB;AACvC,SAAS,IAAI,UAAU;AACvB,SAAS,mBAAmB,YAAY;AACxC,SAAS,cAAc;AAKvB,OAAO,gBAAgB;AACvB,SAAS,SAAS,wBAAwB;AAC1C,SAAS,cAAc;AACvB,SAAS,0BAA0B;AACnC,OAAO,qBAAqB;AA4CzB,SASE,KATF;AAnCH,SAAS,gBAAiB,EAAE,cAAc,GAAI;AAC7C,QAAM,EAAE,aAAa,mBAAmB,IAAI,YA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AAC;AAAA;AAAA,kBACA,UAAW;AAAA,kBACX,eAAgB;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { chevronRightSmall, Icon } from '@wordpress/icons';\nimport { useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockTitle from '../block-title';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useBlockElementRef } from '../block-list/use-block-props/use-block-refs';\nimport getEditorRegion from '../../utils/get-editor-region';\n\n/**\n * Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb.\n *\n * @param {Object} props Component props.\n * @param {string} props.rootLabelText Translated label for the root element of the breadcrumb trail.\n * @return {Element} Block Breadcrumb.\n */\nfunction BlockBreadcrumb( { rootLabelText } ) {\n\tconst { selectBlock, clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { clientId, parents, hasSelection } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectionStart,\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetEnabledBlockParents,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\treturn {\n\t\t\tparents: getEnabledBlockParents( selectedBlockClientId ),\n\t\t\tclientId: selectedBlockClientId,\n\t\t\thasSelection: !! getSelectionStart().clientId,\n\t\t};\n\t}, [] );\n\n\t// translators: Default label for the Document in the Block Breadcrumb.\n\tconst rootLabel = rootLabelText || _x( 'Document', 'noun, breadcrumb' );\n\n\t// We don't care about this specific ref, but this is a way\n\t// to get a ref within the editor canvas so we can focus it later.\n\tconst blockRef = useRef();\n\tuseBlockElementRef( clientId, blockRef );\n\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\treturn (\n\t\t<ul\n\t\t\tclassName=\"block-editor-block-breadcrumb\"\n\t\t\trole=\"list\"\n\t\t\taria-label={ __( 'Block breadcrumb' ) }\n\t\t>\n\t\t\t<li\n\t\t\t\tclassName={\n\t\t\t\t\t! hasSelection\n\t\t\t\t\t\t? 'block-editor-block-breadcrumb__current'\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t\taria-current={ ! hasSelection ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t{ hasSelection && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__button\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Find the block editor wrapper for the selected block\n\t\t\t\t\t\t\tconst blockEditor = blockRef.current?.closest(\n\t\t\t\t\t\t\t\t'.editor-styles-wrapper'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tclearSelectedBlock();\n\n\t\t\t\t\t\t\tgetEditorRegion( blockEditor )?.focus();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ rootLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\t{ ! hasSelection && <span>{ rootLabel }</span> }\n\t\t\t\t{ !! clientId && (\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__separator\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</li>\n\n\t\t\t{ parents.map( ( parentClientId ) => (\n\t\t\t\t<li key={ parentClientId }>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__button\"\n\t\t\t\t\t\tonClick={ () => selectBlock( parentClientId ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockTitle\n\t\t\t\t\t\t\tclientId={ parentClientId }\n\t\t\t\t\t\t\tmaximumLength={ 35 }\n\t\t\t\t\t\t\tcontext=\"breadcrumb\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\ticon={ chevronRightSmall }\n\t\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__separator\"\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t\t{ !! clientId && (\n\t\t\t\t<li\n\t\t\t\t\tclassName=\"block-editor-block-breadcrumb__current\"\n\t\t\t\t\taria-current=\"true\"\n\t\t\t\t>\n\t\t\t\t\t<BlockTitle\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tmaximumLength={ 35 }\n\t\t\t\t\t\tcontext=\"breadcrumb\"\n\t\t\t\t\t/>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t</ul>\n\t\t/* eslint-enable jsx-a11y/no-redundant-roles */\n\t);\n}\n\nexport default BlockBreadcrumb;\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,cAAc;AACvB,SAAS,WAAW,mBAAmB;AACvC,SAAS,IAAI,UAAU;AACvB,SAAS,mBAAmB,YAAY;AACxC,SAAS,cAAc;AAKvB,OAAO,gBAAgB;AACvB,SAAS,SAAS,wBAAwB;AAC1C,SAAS,cAAc;AACvB,SAAS,0BAA0B;AACnC,OAAO,qBAAqB;AA4CzB,SASE,KATF;AAnCH,SAAS,gBAAiB,EAAE,cAAc,GAAI;AAC7C,QAAM,EAAE,aAAa,mBAAmB,IAAI,YAAa,gBAAiB;AAC1E,QAAM,EAAE,UAAU,SAAS,aAAa,IAAI,UAAW,CAAE,WAAY;AACpE,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,OAAQ,gBAAiB,CAAE;AACvC,UAAM,wBAAwB,yBAAyB;AACvD,WAAO;AAAA,MACN,SAAS,uBAAwB,qBAAsB;AAAA,MACvD,UAAU;AAAA,MACV,cAAc,CAAC,CAAE,kBA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AAA,YAEb;AAAA,cAAC;AAAA;AAAA,gBACA;AAAA,gBACA,eAAgB;AAAA,gBAChB,SAAQ;AAAA;AAAA,YACT;AAAA;AAAA,QACD;AAAA;AAAA;AAAA,EAEF;AAGF;AAEA,IAAO,2BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,6 +3,7 @@ import { __ } from "@wordpress/i18n";
|
|
|
3
3
|
import {
|
|
4
4
|
getBlockType,
|
|
5
5
|
getUnregisteredTypeHandlerName,
|
|
6
|
+
hasBlockSupport,
|
|
6
7
|
store as blocksStore
|
|
7
8
|
} from "@wordpress/blocks";
|
|
8
9
|
import { __unstableMotion as motion } from "@wordpress/components";
|
|
@@ -18,6 +19,7 @@ import BlockStyles from "../block-styles/index.mjs";
|
|
|
18
19
|
import { default as InspectorControls } from "../inspector-controls/index.mjs";
|
|
19
20
|
import { default as InspectorControlsTabs } from "../inspector-controls-tabs/index.mjs";
|
|
20
21
|
import useInspectorControlsTabs from "../inspector-controls-tabs/use-inspector-controls-tabs.mjs";
|
|
22
|
+
import InspectorControlsLastItem from "../inspector-controls/last-item.mjs";
|
|
21
23
|
import AdvancedControls from "../inspector-controls-tabs/advanced-controls-panel.mjs";
|
|
22
24
|
import PositionControls from "../inspector-controls-tabs/position-controls-panel.mjs";
|
|
23
25
|
import useBlockInspectorAnimationSettings from "./useBlockInspectorAnimationSettings.mjs";
|
|
@@ -130,20 +132,18 @@ function BlockInspector() {
|
|
|
130
132
|
const descendants = getClientIdsOfDescendants(
|
|
131
133
|
renderedBlockClientId
|
|
132
134
|
);
|
|
133
|
-
const
|
|
135
|
+
const listViewDescendants = /* @__PURE__ */ new Set();
|
|
134
136
|
descendants.forEach((clientId) => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
const blockName = getBlockName(clientId);
|
|
138
|
+
if (blockName === "core/navigation" || hasBlockSupport(blockName, "listView")) {
|
|
139
|
+
const listViewChildren = getClientIdsOfDescendants(clientId);
|
|
140
|
+
listViewChildren.forEach(
|
|
141
|
+
(childId) => listViewDescendants.add(childId)
|
|
139
142
|
);
|
|
140
143
|
}
|
|
141
144
|
});
|
|
142
145
|
return descendants.filter((current) => {
|
|
143
|
-
|
|
144
|
-
return false;
|
|
145
|
-
}
|
|
146
|
-
return getBlockName(current) !== "core/list-item" && getBlockEditingMode(current) === "contentOnly";
|
|
146
|
+
return !listViewDescendants.has(current) && getBlockEditingMode(current) === "contentOnly";
|
|
147
147
|
});
|
|
148
148
|
},
|
|
149
149
|
[isSectionBlock, renderedBlockClientId]
|
|
@@ -247,7 +247,7 @@ var BlockInspectorSingleBlock = ({
|
|
|
247
247
|
editedContentOnlySection
|
|
248
248
|
}) => {
|
|
249
249
|
const hasMultipleTabs = availableTabs?.length > 1;
|
|
250
|
-
const hasParentChildBlockCards =
|
|
250
|
+
const hasParentChildBlockCards = editedContentOnlySection && editedContentOnlySection !== renderedBlockClientId;
|
|
251
251
|
const parentBlockInformation = useBlockDisplayInformation(
|
|
252
252
|
editedContentOnlySection
|
|
253
253
|
);
|
|
@@ -275,7 +275,7 @@ var BlockInspectorSingleBlock = ({
|
|
|
275
275
|
}
|
|
276
276
|
),
|
|
277
277
|
/* @__PURE__ */ jsx(ViewportVisibilityInfo, { clientId: renderedBlockClientId }),
|
|
278
|
-
|
|
278
|
+
/* @__PURE__ */ jsx(EditContents, { clientId: renderedBlockClientId }),
|
|
279
279
|
/* @__PURE__ */ jsx(BlockVariationTransforms, { blockClientId: renderedBlockClientId }),
|
|
280
280
|
hasMultipleTabs && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
|
281
281
|
InspectorControlsTabs,
|
|
@@ -295,6 +295,7 @@ var BlockInspectorSingleBlock = ({
|
|
|
295
295
|
/* @__PURE__ */ jsx(InspectorControls.Slot, { group: "list" }),
|
|
296
296
|
!isSectionBlock && /* @__PURE__ */ jsx(StyleInspectorSlots, { blockName })
|
|
297
297
|
] }),
|
|
298
|
+
/* @__PURE__ */ jsx(InspectorControlsLastItem.Slot, {}),
|
|
298
299
|
/* @__PURE__ */ jsx(SkipToSelectedBlock, {}, "back")
|
|
299
300
|
] });
|
|
300
301
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/block-inspector/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetUnregisteredTypeHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EditContents from './edit-contents';\nimport SkipToSelectedBlock from '../skip-to-selected-block';\nimport BlockCard from '../block-card';\nimport MultiSelectionInspector from '../multi-selection-inspector';\nimport BlockVariationTransforms from '../block-variation-transforms';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\nimport BlockStyles from '../block-styles';\nimport { default as InspectorControls } from '../inspector-controls';\nimport { default as InspectorControlsTabs } from '../inspector-controls-tabs';\nimport useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';\nimport AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';\nimport PositionControls from '../inspector-controls-tabs/position-controls-panel';\nimport useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';\nimport { useBorderPanelLabel } from '../../hooks/border';\nimport ContentTab from '../inspector-controls-tabs/content-tab';\nimport ViewportVisibilityInfo from '../block-visibility/viewport-visibility-info';\nimport { unlock } from '../../lock-unlock';\n\nfunction StyleInspectorSlots( {\n\tblockName,\n\tshowAdvancedControls = true,\n\tshowPositionControls = true,\n\tshowBindingsControls = true,\n} ) {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls.Slot />\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"color\"\n\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"background\"\n\t\t\t\tlabel={ __( 'Background image' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"typography\"\n\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"border\" label={ borderPanelLabel } />\n\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t{ showPositionControls && <PositionControls /> }\n\t\t\t{ showBindingsControls && (\n\t\t\t\t<InspectorControls.Slot group=\"bindings\" />\n\t\t\t) }\n\t\t\t{ showAdvancedControls && (\n\t\t\t\t<div>\n\t\t\t\t\t<AdvancedControls />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction BlockInspector() {\n\tconst {\n\t\tselectedBlockCount,\n\t\trenderedBlockName,\n\t\trenderedBlockClientId,\n\t\tblockType,\n\t\tisSectionBlock,\n\t\tisSectionBlockInSelection,\n\t\thasBlockStyles,\n\t\teditedContentOnlySection,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetSelectedBlockCount,\n\t\t\tgetBlockName,\n\t\t\tgetParentSectionBlock,\n\t\t\tisSectionBlock: _isSectionBlock,\n\t\t\tgetEditedContentOnlySection,\n\t\t\tisWithinEditedContentOnlySection,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { getBlockStyles } = select( blocksStore );\n\t\tconst _selectedBlockClientId = getSelectedBlockClientId();\n\t\tconst isWithinEditedSection = isWithinEditedContentOnlySection(\n\t\t\t_selectedBlockClientId\n\t\t);\n\t\tconst _renderedBlockClientId = isWithinEditedSection\n\t\t\t? _selectedBlockClientId\n\t\t\t: getParentSectionBlock( _selectedBlockClientId ) ||\n\t\t\t _selectedBlockClientId;\n\t\tconst _renderedBlockName =\n\t\t\t_renderedBlockClientId && getBlockName( _renderedBlockClientId );\n\t\tconst _blockType =\n\t\t\t_renderedBlockName && getBlockType( _renderedBlockName );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst _isSectionBlockInSelection = selectedBlockClientIds.some(\n\t\t\t( id ) => _isSectionBlock( id )\n\t\t);\n\t\tconst blockStyles =\n\t\t\t_renderedBlockName && getBlockStyles( _renderedBlockName );\n\t\tconst _hasBlockStyles = blockStyles && blockStyles.length > 0;\n\n\t\treturn {\n\t\t\tselectedBlockCount: getSelectedBlockCount(),\n\t\t\trenderedBlockClientId: _renderedBlockClientId,\n\t\t\trenderedBlockName: _renderedBlockName,\n\t\t\tblockType: _blockType,\n\t\t\tisSectionBlockInSelection: _isSectionBlockInSelection,\n\t\t\tisSectionBlock: _isSectionBlock( _renderedBlockClientId ),\n\t\t\thasBlockStyles: _hasBlockStyles,\n\t\t\teditedContentOnlySection: getEditedContentOnlySection(),\n\t\t};\n\t}, [] );\n\n\t// Separate useSelect for contentClientIds with proper dependencies\n\tconst contentClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSectionBlock || ! renderedBlockClientId ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst descendants = getClientIdsOfDescendants(\n\t\t\t\trenderedBlockClientId\n\t\t\t);\n\n\t\t\t// Temporary workaround for issue #71991\n\t\t\t// Exclude Navigation block children from Content sidebar until proper\n\t\t\t// drill-down experience is implemented (see #65699)\n\t\t\t// This prevents a poor UX where all Nav block sub-items are shown\n\t\t\t// when the parent block is in contentOnly mode.\n\t\t\t// Build a Set of all navigation block descendants for efficient lookup\n\t\t\tconst navigationDescendants = new Set();\n\t\t\tdescendants.forEach( ( clientId ) => {\n\t\t\t\tif ( getBlockName( clientId ) === 'core/navigation' ) {\n\t\t\t\t\tconst navChildren = getClientIdsOfDescendants( clientId );\n\t\t\t\t\tnavChildren.forEach( ( childId ) =>\n\t\t\t\t\t\tnavigationDescendants.add( childId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn descendants.filter( ( current ) => {\n\t\t\t\t// Exclude navigation block children\n\t\t\t\tif ( navigationDescendants.has( current ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlockName( current ) !== 'core/list-item' &&\n\t\t\t\t\tgetBlockEditingMode( current ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t[ isSectionBlock, renderedBlockClientId ]\n\t);\n\n\tconst availableTabs = useInspectorControlsTabs(\n\t\tblockType?.name,\n\t\tcontentClientIds,\n\t\tisSectionBlock,\n\t\thasBlockStyles\n\t);\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\n\t// The block inspector animation settings will be completely\n\t// removed in the future to create an API which allows the block\n\t// inspector to transition between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tconst blockInspectorAnimationSettings =\n\t\tuseBlockInspectorAnimationSettings( blockType );\n\n\tconst hasSelectedBlocks = selectedBlockCount > 1;\n\n\tif ( hasSelectedBlocks && ! isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t\t{ hasMultipleTabs ? (\n\t\t\t\t\t<InspectorControlsTabs tabs={ availableTabs } />\n\t\t\t\t) : (\n\t\t\t\t\t<StyleInspectorSlots\n\t\t\t\t\t\tblockName={ renderedBlockName }\n\t\t\t\t\t\tshowAdvancedControls={ false }\n\t\t\t\t\t\tshowPositionControls={ false }\n\t\t\t\t\t\tshowBindingsControls={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( hasSelectedBlocks && isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst isRenderedBlockUnregistered =\n\t\trenderedBlockName === getUnregisteredTypeHandlerName();\n\n\t/*\n\t * If the rendered block is of an unregistered type, avoid showing it as an actual selection\n\t * because we want the user to focus on the unregistered block warning, not block settings.\n\t */\n\tconst shouldShowWarning =\n\t\t! blockType || ! renderedBlockClientId || isRenderedBlockUnregistered;\n\n\tif ( shouldShowWarning ) {\n\t\treturn (\n\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t</span>\n\t\t);\n\t}\n\n\treturn (\n\t\t<BlockInspectorSingleBlockWrapper\n\t\t\tanimate={ blockInspectorAnimationSettings }\n\t\t\twrapper={ ( children ) => (\n\t\t\t\t<AnimatedContainer\n\t\t\t\t\tblockInspectorAnimationSettings={\n\t\t\t\t\t\tblockInspectorAnimationSettings\n\t\t\t\t\t}\n\t\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</AnimatedContainer>\n\t\t\t) }\n\t\t>\n\t\t\t<BlockInspectorSingleBlock\n\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\tblockName={ blockType.name }\n\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\tavailableTabs={ availableTabs }\n\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\teditedContentOnlySection={ editedContentOnlySection }\n\t\t\t/>\n\t\t</BlockInspectorSingleBlockWrapper>\n\t);\n}\n\nconst BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {\n\treturn animate ? wrapper( children ) : children;\n};\n\nconst AnimatedContainer = ( {\n\tblockInspectorAnimationSettings,\n\trenderedBlockClientId,\n\tchildren,\n} ) => {\n\tconst animationOrigin =\n\t\tblockInspectorAnimationSettings &&\n\t\tblockInspectorAnimationSettings.enterDirection === 'leftToRight'\n\t\t\t? -50\n\t\t\t: 50;\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\tease: 'easeInOut',\n\t\t\t\t\tduration: 0.14,\n\t\t\t\t},\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tx: animationOrigin,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\tkey={ renderedBlockClientId }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n};\n\nconst BlockInspectorSingleBlock = ( {\n\t// The block that is displayed in the inspector. This is the block whose\n\t// controls and information are shown to the user.\n\trenderedBlockClientId,\n\tblockName,\n\tisSectionBlock,\n\tavailableTabs,\n\tcontentClientIds,\n\thasBlockStyles,\n\teditedContentOnlySection,\n} ) => {\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\tconst hasParentChildBlockCards =\n\t\twindow?.__experimentalContentOnlyPatternInsertion &&\n\t\teditedContentOnlySection &&\n\t\teditedContentOnlySection !== renderedBlockClientId;\n\tconst parentBlockInformation = useBlockDisplayInformation(\n\t\teditedContentOnlySection\n\t);\n\tconst blockInformation = useBlockDisplayInformation(\n\t\trenderedBlockClientId\n\t);\n\tconst isBlockSynced = blockInformation.isSynced;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t{ hasParentChildBlockCards && (\n\t\t\t\t<BlockCard\n\t\t\t\t\t{ ...parentBlockInformation }\n\t\t\t\t\tclassName={ parentBlockInformation.isSynced && 'is-synced' }\n\t\t\t\t\tparentClientId={ editedContentOnlySection }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<BlockCard\n\t\t\t\t{ ...blockInformation }\n\t\t\t\tallowParentNavigation\n\t\t\t\tclassName={ isBlockSynced && 'is-synced' }\n\t\t\t\tisChild={ hasParentChildBlockCards }\n\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t/>\n\t\t\t<ViewportVisibilityInfo clientId={ renderedBlockClientId } />\n\t\t\t{ window?.__experimentalContentOnlyPatternInsertion && (\n\t\t\t\t<EditContents clientId={ renderedBlockClientId } />\n\t\t\t) }\n\t\t\t<BlockVariationTransforms blockClientId={ renderedBlockClientId } />\n\t\t\t{ hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t<InspectorControlsTabs\n\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\ttabs={ availableTabs }\n\t\t\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ ! hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t{ hasBlockStyles && (\n\t\t\t\t\t\t<BlockStyles clientId={ renderedBlockClientId } />\n\t\t\t\t\t) }\n\t\t\t\t\t<ContentTab contentClientIds={ contentClientIds } />\n\t\t\t\t\t<InspectorControls.Slot group=\"content\" />\n\t\t\t\t\t<InspectorControls.Slot group=\"list\" />\n\t\t\t\t\t{ ! isSectionBlock && (\n\t\t\t\t\t\t<StyleInspectorSlots blockName={ blockName } />\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<SkipToSelectedBlock key=\"back\" />\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md\n */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MAChB,0BAA0B,4BAA4B;AAAA,IACvD;AAAA,EACD,GAAG,CAAC,CAAE;AAGN,QAAM,mBAAmB;AAAA,IACxB,CAAE,WAAY;AACb,UAAK,CAAE,kBAAkB,CAAE,uBAAwB;AAClD,eAAO,CAAC;AAAA,MACT;AAEA,YAAM;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,MACD,IAAI,OAAQ,OAAQ,gBAAiB,CAAE;AAEvC,YAAM,cAAc;AAAA,QACnB;AAAA,MACD;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tgetBlockType,\n\tgetUnregisteredTypeHandlerName,\n\thasBlockSupport,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport EditContents from './edit-contents';\nimport SkipToSelectedBlock from '../skip-to-selected-block';\nimport BlockCard from '../block-card';\nimport MultiSelectionInspector from '../multi-selection-inspector';\nimport BlockVariationTransforms from '../block-variation-transforms';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\nimport BlockStyles from '../block-styles';\nimport { default as InspectorControls } from '../inspector-controls';\nimport { default as InspectorControlsTabs } from '../inspector-controls-tabs';\nimport useInspectorControlsTabs from '../inspector-controls-tabs/use-inspector-controls-tabs';\nimport InspectorControlsLastItem from '../inspector-controls/last-item';\nimport AdvancedControls from '../inspector-controls-tabs/advanced-controls-panel';\nimport PositionControls from '../inspector-controls-tabs/position-controls-panel';\nimport useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';\nimport { useBorderPanelLabel } from '../../hooks/border';\nimport ContentTab from '../inspector-controls-tabs/content-tab';\nimport ViewportVisibilityInfo from '../block-visibility/viewport-visibility-info';\nimport { unlock } from '../../lock-unlock';\n\nfunction StyleInspectorSlots( {\n\tblockName,\n\tshowAdvancedControls = true,\n\tshowPositionControls = true,\n\tshowBindingsControls = true,\n} ) {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls.Slot />\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"color\"\n\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"background\"\n\t\t\t\tlabel={ __( 'Background image' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"typography\"\n\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"border\" label={ borderPanelLabel } />\n\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t{ showPositionControls && <PositionControls /> }\n\t\t\t{ showBindingsControls && (\n\t\t\t\t<InspectorControls.Slot group=\"bindings\" />\n\t\t\t) }\n\t\t\t{ showAdvancedControls && (\n\t\t\t\t<div>\n\t\t\t\t\t<AdvancedControls />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction BlockInspector() {\n\tconst {\n\t\tselectedBlockCount,\n\t\trenderedBlockName,\n\t\trenderedBlockClientId,\n\t\tblockType,\n\t\tisSectionBlock,\n\t\tisSectionBlockInSelection,\n\t\thasBlockStyles,\n\t\teditedContentOnlySection,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tgetSelectedBlockCount,\n\t\t\tgetBlockName,\n\t\t\tgetParentSectionBlock,\n\t\t\tisSectionBlock: _isSectionBlock,\n\t\t\tgetEditedContentOnlySection,\n\t\t\tisWithinEditedContentOnlySection,\n\t\t} = unlock( select( blockEditorStore ) );\n\t\tconst { getBlockStyles } = select( blocksStore );\n\t\tconst _selectedBlockClientId = getSelectedBlockClientId();\n\t\tconst isWithinEditedSection = isWithinEditedContentOnlySection(\n\t\t\t_selectedBlockClientId\n\t\t);\n\t\tconst _renderedBlockClientId = isWithinEditedSection\n\t\t\t? _selectedBlockClientId\n\t\t\t: getParentSectionBlock( _selectedBlockClientId ) ||\n\t\t\t _selectedBlockClientId;\n\t\tconst _renderedBlockName =\n\t\t\t_renderedBlockClientId && getBlockName( _renderedBlockClientId );\n\t\tconst _blockType =\n\t\t\t_renderedBlockName && getBlockType( _renderedBlockName );\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst _isSectionBlockInSelection = selectedBlockClientIds.some(\n\t\t\t( id ) => _isSectionBlock( id )\n\t\t);\n\t\tconst blockStyles =\n\t\t\t_renderedBlockName && getBlockStyles( _renderedBlockName );\n\t\tconst _hasBlockStyles = blockStyles && blockStyles.length > 0;\n\n\t\treturn {\n\t\t\tselectedBlockCount: getSelectedBlockCount(),\n\t\t\trenderedBlockClientId: _renderedBlockClientId,\n\t\t\trenderedBlockName: _renderedBlockName,\n\t\t\tblockType: _blockType,\n\t\t\tisSectionBlockInSelection: _isSectionBlockInSelection,\n\t\t\tisSectionBlock: _isSectionBlock( _renderedBlockClientId ),\n\t\t\thasBlockStyles: _hasBlockStyles,\n\t\t\teditedContentOnlySection: getEditedContentOnlySection(),\n\t\t};\n\t}, [] );\n\n\t// Separate useSelect for contentClientIds with proper dependencies\n\tconst contentClientIds = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSectionBlock || ! renderedBlockClientId ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst descendants = getClientIdsOfDescendants(\n\t\t\t\trenderedBlockClientId\n\t\t\t);\n\n\t\t\t// Exclude items from the content tab that are already present in the\n\t\t\t// List View tab.\n\t\t\tconst listViewDescendants = new Set();\n\t\t\tdescendants.forEach( ( clientId ) => {\n\t\t\t\tconst blockName = getBlockName( clientId );\n\t\t\t\t// Navigation block doesn't have List View block support, but\n\t\t\t\t// it does have a custom implementation that is shown within\n\t\t\t\t// patterns, so it's included in this condition.\n\t\t\t\tif (\n\t\t\t\t\tblockName === 'core/navigation' ||\n\t\t\t\t\thasBlockSupport( blockName, 'listView' )\n\t\t\t\t) {\n\t\t\t\t\tconst listViewChildren =\n\t\t\t\t\t\tgetClientIdsOfDescendants( clientId );\n\t\t\t\t\tlistViewChildren.forEach( ( childId ) =>\n\t\t\t\t\t\tlistViewDescendants.add( childId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn descendants.filter( ( current ) => {\n\t\t\t\treturn (\n\t\t\t\t\t! listViewDescendants.has( current ) &&\n\t\t\t\t\tgetBlockEditingMode( current ) === 'contentOnly'\n\t\t\t\t);\n\t\t\t} );\n\t\t},\n\t\t[ isSectionBlock, renderedBlockClientId ]\n\t);\n\n\tconst availableTabs = useInspectorControlsTabs(\n\t\tblockType?.name,\n\t\tcontentClientIds,\n\t\tisSectionBlock,\n\t\thasBlockStyles\n\t);\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\n\t// The block inspector animation settings will be completely\n\t// removed in the future to create an API which allows the block\n\t// inspector to transition between what it\n\t// displays based on the relationship between the selected block\n\t// and its parent, and only enable it if the parent is controlling\n\t// its children blocks.\n\tconst blockInspectorAnimationSettings =\n\t\tuseBlockInspectorAnimationSettings( blockType );\n\n\tconst hasSelectedBlocks = selectedBlockCount > 1;\n\n\tif ( hasSelectedBlocks && ! isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t\t{ hasMultipleTabs ? (\n\t\t\t\t\t<InspectorControlsTabs tabs={ availableTabs } />\n\t\t\t\t) : (\n\t\t\t\t\t<StyleInspectorSlots\n\t\t\t\t\t\tblockName={ renderedBlockName }\n\t\t\t\t\t\tshowAdvancedControls={ false }\n\t\t\t\t\t\tshowPositionControls={ false }\n\t\t\t\t\t\tshowBindingsControls={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( hasSelectedBlocks && isSectionBlockInSelection ) {\n\t\treturn (\n\t\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t\t<MultiSelectionInspector />\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst isRenderedBlockUnregistered =\n\t\trenderedBlockName === getUnregisteredTypeHandlerName();\n\n\t/*\n\t * If the rendered block is of an unregistered type, avoid showing it as an actual selection\n\t * because we want the user to focus on the unregistered block warning, not block settings.\n\t */\n\tconst shouldShowWarning =\n\t\t! blockType || ! renderedBlockClientId || isRenderedBlockUnregistered;\n\n\tif ( shouldShowWarning ) {\n\t\treturn (\n\t\t\t<span className=\"block-editor-block-inspector__no-blocks\">\n\t\t\t\t{ __( 'No block selected.' ) }\n\t\t\t</span>\n\t\t);\n\t}\n\n\treturn (\n\t\t<BlockInspectorSingleBlockWrapper\n\t\t\tanimate={ blockInspectorAnimationSettings }\n\t\t\twrapper={ ( children ) => (\n\t\t\t\t<AnimatedContainer\n\t\t\t\t\tblockInspectorAnimationSettings={\n\t\t\t\t\t\tblockInspectorAnimationSettings\n\t\t\t\t\t}\n\t\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</AnimatedContainer>\n\t\t\t) }\n\t\t>\n\t\t\t<BlockInspectorSingleBlock\n\t\t\t\trenderedBlockClientId={ renderedBlockClientId }\n\t\t\t\tblockName={ blockType.name }\n\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\tavailableTabs={ availableTabs }\n\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\teditedContentOnlySection={ editedContentOnlySection }\n\t\t\t/>\n\t\t</BlockInspectorSingleBlockWrapper>\n\t);\n}\n\nconst BlockInspectorSingleBlockWrapper = ( { animate, wrapper, children } ) => {\n\treturn animate ? wrapper( children ) : children;\n};\n\nconst AnimatedContainer = ( {\n\tblockInspectorAnimationSettings,\n\trenderedBlockClientId,\n\tchildren,\n} ) => {\n\tconst animationOrigin =\n\t\tblockInspectorAnimationSettings &&\n\t\tblockInspectorAnimationSettings.enterDirection === 'leftToRight'\n\t\t\t? -50\n\t\t\t: 50;\n\n\treturn (\n\t\t<motion.div\n\t\t\tanimate={ {\n\t\t\t\tx: 0,\n\t\t\t\topacity: 1,\n\t\t\t\ttransition: {\n\t\t\t\t\tease: 'easeInOut',\n\t\t\t\t\tduration: 0.14,\n\t\t\t\t},\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tx: animationOrigin,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\tkey={ renderedBlockClientId }\n\t\t>\n\t\t\t{ children }\n\t\t</motion.div>\n\t);\n};\n\nconst BlockInspectorSingleBlock = ( {\n\t// The block that is displayed in the inspector. This is the block whose\n\t// controls and information are shown to the user.\n\trenderedBlockClientId,\n\tblockName,\n\tisSectionBlock,\n\tavailableTabs,\n\tcontentClientIds,\n\thasBlockStyles,\n\teditedContentOnlySection,\n} ) => {\n\tconst hasMultipleTabs = availableTabs?.length > 1;\n\tconst hasParentChildBlockCards =\n\t\teditedContentOnlySection &&\n\t\teditedContentOnlySection !== renderedBlockClientId;\n\tconst parentBlockInformation = useBlockDisplayInformation(\n\t\teditedContentOnlySection\n\t);\n\tconst blockInformation = useBlockDisplayInformation(\n\t\trenderedBlockClientId\n\t);\n\tconst isBlockSynced = blockInformation.isSynced;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector\">\n\t\t\t{ hasParentChildBlockCards && (\n\t\t\t\t<BlockCard\n\t\t\t\t\t{ ...parentBlockInformation }\n\t\t\t\t\tclassName={ parentBlockInformation.isSynced && 'is-synced' }\n\t\t\t\t\tparentClientId={ editedContentOnlySection }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<BlockCard\n\t\t\t\t{ ...blockInformation }\n\t\t\t\tallowParentNavigation\n\t\t\t\tclassName={ isBlockSynced && 'is-synced' }\n\t\t\t\tisChild={ hasParentChildBlockCards }\n\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t/>\n\t\t\t<ViewportVisibilityInfo clientId={ renderedBlockClientId } />\n\t\t\t<EditContents clientId={ renderedBlockClientId } />\n\t\t\t<BlockVariationTransforms blockClientId={ renderedBlockClientId } />\n\t\t\t{ hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t<InspectorControlsTabs\n\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t\tclientId={ renderedBlockClientId }\n\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\ttabs={ availableTabs }\n\t\t\t\t\t\tisSectionBlock={ isSectionBlock }\n\t\t\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ ! hasMultipleTabs && (\n\t\t\t\t<>\n\t\t\t\t\t{ hasBlockStyles && (\n\t\t\t\t\t\t<BlockStyles clientId={ renderedBlockClientId } />\n\t\t\t\t\t) }\n\t\t\t\t\t<ContentTab contentClientIds={ contentClientIds } />\n\t\t\t\t\t<InspectorControls.Slot group=\"content\" />\n\t\t\t\t\t<InspectorControls.Slot group=\"list\" />\n\t\t\t\t\t{ ! isSectionBlock && (\n\t\t\t\t\t\t<StyleInspectorSlots blockName={ blockName } />\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t<InspectorControlsLastItem.Slot />\n\t\t\t<SkipToSelectedBlock key=\"back\" />\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/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
433
|
const blockVisibility2 = attributes2?.metadata?.blockVisibility;
|
|
434
434
|
const deviceType2 = settings?.[deviceTypeKey]?.toLowerCase() || "desktop";
|
|
435
435
|
const hasLightBlockWrapper = blockType2?.apiVersion > 1;
|
|
436
|
+
const isMultiSelected2 = isBlockMultiSelected(clientId);
|
|
437
|
+
const blockEditingMode2 = getBlockEditingMode(clientId);
|
|
436
438
|
const previewContext = {
|
|
437
439
|
isPreviewMode: isPreviewMode2,
|
|
438
440
|
blockWithoutAttributes: blockWithoutAttributes2,
|
|
@@ -447,7 +449,10 @@ function BlockListBlockProvider(props) {
|
|
|
447
449
|
blockTitle: blockType2?.title,
|
|
448
450
|
bindableAttributes: bindableAttributes2,
|
|
449
451
|
blockVisibility: blockVisibility2,
|
|
450
|
-
deviceType: deviceType2
|
|
452
|
+
deviceType: deviceType2,
|
|
453
|
+
isMultiSelected: isMultiSelected2,
|
|
454
|
+
blockEditingMode: blockEditingMode2,
|
|
455
|
+
isEditingDisabled: blockEditingMode2 === "disabled"
|
|
451
456
|
};
|
|
452
457
|
if (isPreviewMode2) {
|
|
453
458
|
return previewContext;
|
|
@@ -456,13 +461,11 @@ function BlockListBlockProvider(props) {
|
|
|
456
461
|
const canRemove2 = canRemoveBlock(clientId);
|
|
457
462
|
const canMove2 = canMoveBlock(clientId);
|
|
458
463
|
const match = getActiveBlockVariation(blockName, attributes2);
|
|
459
|
-
const isMultiSelected2 = isBlockMultiSelected(clientId);
|
|
460
464
|
const checkDeep = true;
|
|
461
465
|
const isAncestorOfSelectedBlock = hasSelectedInnerBlock(
|
|
462
466
|
clientId,
|
|
463
467
|
checkDeep
|
|
464
468
|
);
|
|
465
|
-
const blockEditingMode2 = getBlockEditingMode(clientId);
|
|
466
469
|
const sectionBlockClientId = _isSectionBlock(clientId) ? clientId : getParentSectionBlock(clientId);
|
|
467
470
|
const multiple = hasBlockSupport(blockName, "multiple", true);
|
|
468
471
|
const blocksWithSameName = multiple ? [] : getBlocksByName(blockName);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/block-list/block.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { memo, RawHTML, useContext, useMemo } 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\tcreateBlock,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { withFilters } from '@wordpress/components';\nimport { withDispatch, 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';\nimport { useBlockVisibility } from '../block-visibility/';\nimport { unlock } from '../../lock-unlock';\nimport { deviceTypeKey } from '../../store/private-keys';\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\tonRemove,\n\tonInsertBlocksAfter,\n\tonMerge,\n\ttoggleSelection,\n} ) {\n\tconst {\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\tisSelectionWithinCurrentSection,\n\t\tthemeSupportsLayout,\n\t\t...context\n\t} = useContext( PrivateBlockContext );\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\tmayDisplayPatternEditingControls={ isSelectionWithinCurrentSection }\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\tisSelectionWithinCurrentSection,\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( nextAttributes ) {\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, attributes } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\t\t\tconst newAttributes =\n\t\t\t\ttypeof nextAttributes === 'function'\n\t\t\t\t\t? nextAttributes( attributes )\n\t\t\t\t\t: nextAttributes;\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\tconst defaultBlockType = getBlockType( defaultBlockName );\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} else if ( defaultBlockType.merge ) {\n\t\t\t\t\tconst attributes = defaultBlockType.merge(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\tblock.attributes\n\t\t\t\t\t);\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t[ clientId ],\n\t\t\t\t\t\t[ createBlock( defaultBlockName, attributes ) ]\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 wrapperBlockName = getBlockName( _clientId );\n\t\t\t\tconst wrapperBlockType = getBlockType( wrapperBlockName );\n\t\t\t\tconst isTextualWrapper = wrapperBlockType.category === 'text';\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 if ( isTextualWrapper ) {\n\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tgetBlockName( firstClientId ),\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\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 replacement = switchToBlockType(\n\t\t\t\t\t\t\t\tgetBlock( firstClientId ),\n\t\t\t\t\t\t\t\tgetDefaultBlockName()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\treplacement &&\n\t\t\t\t\t\t\t\treplacement.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\t\t\t\t\t\t\t) {\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\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} else {\n\t\t\t\t\tswitchToDefaultOrRemove();\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\tonRemove() {\n\t\t\tremoveBlock( ownProps.clientId );\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\tisSectionBlock: _isSectionBlock,\n\t\t\t\tgetParentSectionBlock,\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\tgetEditedContentOnlySection,\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\t__unstableHasActiveBlockOverlayActive,\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 settings = getSettings();\n\t\t\tconst {\n\t\t\t\tsupportsLayout,\n\t\t\t\tisPreviewMode,\n\t\t\t\t__experimentalBlockBindingsSupportedAttributes,\n\t\t\t} = settings;\n\t\t\tconst bindableAttributes =\n\t\t\t\t__experimentalBlockBindingsSupportedAttributes?.[ blockName ];\n\t\t\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\t\t\tconst deviceType =\n\t\t\t\tsettings?.[ deviceTypeKey ]?.toLowerCase() || 'desktop';\n\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\tbindableAttributes,\n\t\t\t\tblockVisibility,\n\t\t\t\tdeviceType,\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\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 blockEditingMode = getBlockEditingMode( clientId );\n\t\t\tconst sectionBlockClientId = _isSectionBlock( clientId )\n\t\t\t\t? clientId\n\t\t\t\t: getParentSectionBlock( 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\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\tisSectionBlock: _isSectionBlock( clientId ),\n\t\t\t\tisWithinSectionBlock: !! sectionBlockClientId,\n\t\t\t\tisSelectionWithinCurrentSection:\n\t\t\t\t\tisBlockSelected( sectionBlockClientId ) ||\n\t\t\t\t\thasSelectedInnerBlock( sectionBlockClientId, checkDeep ),\n\t\t\t\tblockType,\n\t\t\t\tcanRemove,\n\t\t\t\tcanMove,\n\t\t\t\tisSelected: _isSelected,\n\t\t\t\tisEditingContentOnlySection:\n\t\t\t\t\tgetEditedContentOnlySection() === 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: _isSelected\n\t\t\t\t\t? getSelectedBlocksInitialCaretPosition()\n\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\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\tblockVisibility,\n\t\t\t\tdeviceType,\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\tisEditingContentOnlySection,\n\t\tblockEditingMode,\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\tindex,\n\t\tblockApiVersion,\n\t\tblockType,\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\tisSectionBlock,\n\t\tisWithinSectionBlock,\n\t\tisSelectionWithinCurrentSection,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tclassName,\n\t\tdefaultClassName,\n\t\toriginalBlockClientId,\n\t\tbindableAttributes,\n\t\tblockVisibility,\n\t\tdeviceType,\n\t} = selectedProps;\n\n\t// Use block visibility hook with data from existing useSelect to avoid extra subscription\n\tconst { isBlockCurrentlyHidden } = useBlockVisibility( {\n\t\tblockVisibility,\n\t\tdeviceType,\n\t} );\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\tblockType,\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\tisSectionBlock,\n\t\tisWithinSectionBlock,\n\t\tisSelectionWithinCurrentSection,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisEditingContentOnlySection,\n\t\tdefaultClassName,\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\toriginalBlockClientId,\n\t\tthemeSupportsLayout,\n\t\tcanMove,\n\t\tisBlockCurrentlyHidden,\n\t\tbindableAttributes,\n\t\tblockVisibility,\n\t\tdeviceType,\n\t};\n\n\tif (\n\t\tisBlockCurrentlyHidden &&\n\t\t! isSelected &&\n\t\t! isMultiSelected &&\n\t\t! hasChildSelected\n\t) {\n\t\treturn null;\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"],
|
|
5
|
-
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,MAAM,SAAS,YAAY,eAAe;AACnD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,mBAAmB;AAC5B,SAAS,cAAc,iBAAiB;AACxC,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAKzB,OAAO,eAAe;AACtB,OAAO,yBAAyB;AAChC,OAAO,uBAAuB;AAC9B,OAAO,wBAAwB;AAC/B,OAAO,eAAe;AACtB,SAAS,qBAAqB;AAC9B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,iBAAiB;AAC1B,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAoC5B,SAyHC,UAzHD,KAgHC,YAhHD;AA1BF,SAAS,kBAAmB,QAAQ,QAAS;AAC5C,QAAM,WAAW;AAAA,IAChB,GAAG;AAAA,IACH,GAAG;AAAA,EACJ;AAGA,MACC,QAAQ,eAAgB,WAAY,KACpC,QAAQ,eAAgB,WAAY,GACnC;AACD,aAAS,YAAY,KAAM,OAAO,WAAW,OAAO,SAAU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wB,WAAW;AAAA,IAChD,CAAE,wBAAwB,UAAW;AAAA,EACtC;AAKA,MAAK,CAAE,eAAgB;AACtB,WAAO;AAAA,EACR;AAEA,QAAM,iBAAiB;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,MACC,0BACA,CAAE,cACF,CAAE,mBACF,CAAE,kBACD;AACD,WAAO;AAAA,EACR;AAWA,SACC,oBAAC,oBAAoB,UAApB,EAA6B,OAAQ,gBACrC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MAIH,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA;AAAA,EACD,GACD;AAEF;AAEA,IAAO,gBAAQ,KAAM,sBAAuB;",
|
|
6
|
-
"names": ["isSelectionEnabled", "isDragging", "blockWithoutAttributes", "attributes", "isValid", "blockType", "isPreviewMode", "bindableAttributes", "blockVisibility", "deviceType", "
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { memo, RawHTML, useContext, useMemo } 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\tcreateBlock,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { withFilters } from '@wordpress/components';\nimport { withDispatch, 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';\nimport { useBlockVisibility } from '../block-visibility/';\nimport { unlock } from '../../lock-unlock';\nimport { deviceTypeKey } from '../../store/private-keys';\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\tonRemove,\n\tonInsertBlocksAfter,\n\tonMerge,\n\ttoggleSelection,\n} ) {\n\tconst {\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\tisSelectionWithinCurrentSection,\n\t\tthemeSupportsLayout,\n\t\t...context\n\t} = useContext( PrivateBlockContext );\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\tmayDisplayPatternEditingControls={ isSelectionWithinCurrentSection }\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\tisSelectionWithinCurrentSection,\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( nextAttributes ) {\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, attributes } = ownProps;\n\t\t\tconst clientIds = multiSelectedBlockClientIds.length\n\t\t\t\t? multiSelectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\t\t\tconst newAttributes =\n\t\t\t\ttypeof nextAttributes === 'function'\n\t\t\t\t\t? nextAttributes( attributes )\n\t\t\t\t\t: nextAttributes;\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\tconst defaultBlockType = getBlockType( defaultBlockName );\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} else if ( defaultBlockType.merge ) {\n\t\t\t\t\tconst attributes = defaultBlockType.merge(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\tblock.attributes\n\t\t\t\t\t);\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t[ clientId ],\n\t\t\t\t\t\t[ createBlock( defaultBlockName, attributes ) ]\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 wrapperBlockName = getBlockName( _clientId );\n\t\t\t\tconst wrapperBlockType = getBlockType( wrapperBlockName );\n\t\t\t\tconst isTextualWrapper = wrapperBlockType.category === 'text';\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 if ( isTextualWrapper ) {\n\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\t\tgetBlockName( firstClientId ),\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\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 replacement = switchToBlockType(\n\t\t\t\t\t\t\t\tgetBlock( firstClientId ),\n\t\t\t\t\t\t\t\tgetDefaultBlockName()\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\treplacement &&\n\t\t\t\t\t\t\t\treplacement.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\t\t\t\t\t\t\t) {\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\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} else {\n\t\t\t\t\tswitchToDefaultOrRemove();\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\tonRemove() {\n\t\t\tremoveBlock( ownProps.clientId );\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\tisSectionBlock: _isSectionBlock,\n\t\t\t\tgetParentSectionBlock,\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\tgetEditedContentOnlySection,\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\t__unstableHasActiveBlockOverlayActive,\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 settings = getSettings();\n\t\t\tconst {\n\t\t\t\tsupportsLayout,\n\t\t\t\tisPreviewMode,\n\t\t\t\t__experimentalBlockBindingsSupportedAttributes,\n\t\t\t} = settings;\n\t\t\tconst bindableAttributes =\n\t\t\t\t__experimentalBlockBindingsSupportedAttributes?.[ blockName ];\n\t\t\tconst blockVisibility = attributes?.metadata?.blockVisibility;\n\t\t\tconst deviceType =\n\t\t\t\tsettings?.[ deviceTypeKey ]?.toLowerCase() || 'desktop';\n\n\t\t\tconst hasLightBlockWrapper = blockType?.apiVersion > 1;\n\t\t\tconst isMultiSelected = isBlockMultiSelected( clientId );\n\t\t\tconst blockEditingMode = getBlockEditingMode( clientId );\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\tbindableAttributes,\n\t\t\t\tblockVisibility,\n\t\t\t\tdeviceType,\n\t\t\t\tisMultiSelected,\n\t\t\t\tblockEditingMode,\n\t\t\t\tisEditingDisabled: blockEditingMode === 'disabled',\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\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 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 sectionBlockClientId = _isSectionBlock( clientId )\n\t\t\t\t? clientId\n\t\t\t\t: getParentSectionBlock( 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\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\tisSectionBlock: _isSectionBlock( clientId ),\n\t\t\t\tisWithinSectionBlock: !! sectionBlockClientId,\n\t\t\t\tisSelectionWithinCurrentSection:\n\t\t\t\t\tisBlockSelected( sectionBlockClientId ) ||\n\t\t\t\t\thasSelectedInnerBlock( sectionBlockClientId, checkDeep ),\n\t\t\t\tblockType,\n\t\t\t\tcanRemove,\n\t\t\t\tcanMove,\n\t\t\t\tisSelected: _isSelected,\n\t\t\t\tisEditingContentOnlySection:\n\t\t\t\t\tgetEditedContentOnlySection() === 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: _isSelected\n\t\t\t\t\t? getSelectedBlocksInitialCaretPosition()\n\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\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\tblockVisibility,\n\t\t\t\tdeviceType,\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\tisEditingContentOnlySection,\n\t\tblockEditingMode,\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\tindex,\n\t\tblockApiVersion,\n\t\tblockType,\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\tisSectionBlock,\n\t\tisWithinSectionBlock,\n\t\tisSelectionWithinCurrentSection,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tclassName,\n\t\tdefaultClassName,\n\t\toriginalBlockClientId,\n\t\tbindableAttributes,\n\t\tblockVisibility,\n\t\tdeviceType,\n\t} = selectedProps;\n\n\t// Use block visibility hook with data from existing useSelect to avoid extra subscription\n\tconst { isBlockCurrentlyHidden } = useBlockVisibility( {\n\t\tblockVisibility,\n\t\tdeviceType,\n\t} );\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\tblockType,\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\tisSectionBlock,\n\t\tisWithinSectionBlock,\n\t\tisSelectionWithinCurrentSection,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisEditingContentOnlySection,\n\t\tdefaultClassName,\n\t\tmayDisplayControls,\n\t\tmayDisplayParentControls,\n\t\toriginalBlockClientId,\n\t\tthemeSupportsLayout,\n\t\tcanMove,\n\t\tisBlockCurrentlyHidden,\n\t\tbindableAttributes,\n\t\tblockVisibility,\n\t\tdeviceType,\n\t};\n\n\tif (\n\t\tisBlockCurrentlyHidden &&\n\t\t! isSelected &&\n\t\t! isMultiSelected &&\n\t\t! hasChildSelected\n\t) {\n\t\treturn null;\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"],
|
|
5
|
+
"mappings": ";AAGA,OAAO,UAAU;AAKjB,SAAS,MAAM,SAAS,YAAY,eAAe;AACnD;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,mBAAmB;AAC5B,SAAS,cAAc,iBAAiB;AACxC,SAAS,eAAe;AACxB,SAAS,gBAAgB;AAKzB,OAAO,eAAe;AACtB,OAAO,yBAAyB;AAChC,OAAO,uBAAuB;AAC9B,OAAO,wBAAwB;AAC/B,OAAO,eAAe;AACtB,SAAS,qBAAqB;AAC9B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,iBAAiB;AAC1B,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAoC5B,SAyHC,UAzHD,KAgHC,YAhHD;AA1BF,SAAS,kBAAmB,QAAQ,QAAS;AAC5C,QAAM,WAAW;AAAA,IAChB,GAAG;AAAA,IACH,GAAG;AAAA,EACJ;AAGA,MACC,QAAQ,eAAgB,WAAY,KACpC,QAAQ,eAAgB,WAAY,GACnC;AACD,aAAS,YAAY,KAAM,OAAO,WAAW,OAAO,SAAU;AAAA,EAC/D;AAEA,MACC,QAAQ,eAAgB,OAAQ,KAChC,QAAQ,eAAgB,OAAQ,GAC/B;AACD,aAAS,QAAQ,EAAE,GAAG,OAAO,OAAO,GAAG,OAAO,MAAM;AAAA,EACrD;AAEA,SAAO;AACR;AAEA,SAAS,MAAO,EAAE,UAAU,QAAQ,GAAG,MAA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IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,MACC,0BACA,CAAE,cACF,CAAE,mBACF,CAAE,kBACD;AACD,WAAO;AAAA,EACR;AAWA,SACC,oBAAC,oBAAoB,UAApB,EAA6B,OAAQ,gBACrC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MAIH,GAAG;AAAA,QACJ;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA;AAAA;AAAA;AAAA,QAKA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA;AAAA,EACD,GACD;AAEF;AAEA,IAAO,gBAAQ,KAAM,sBAAuB;",
|
|
6
|
+
"names": ["isSelectionEnabled", "isDragging", "blockWithoutAttributes", "attributes", "isValid", "blockType", "isPreviewMode", "bindableAttributes", "blockVisibility", "deviceType", "isMultiSelected", "blockEditingMode", "canRemove", "canMove"]
|
|
7
7
|
}
|
|
@@ -36,23 +36,30 @@ var delayedBlockVisibilityDebounceOptions = {
|
|
|
36
36
|
trailing: true
|
|
37
37
|
};
|
|
38
38
|
function Root({ className, ...settings }) {
|
|
39
|
-
const {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
const {
|
|
40
|
+
isOutlineMode,
|
|
41
|
+
isFocusMode,
|
|
42
|
+
isPreviewMode,
|
|
43
|
+
editedContentOnlySection
|
|
44
|
+
} = useSelect((select) => {
|
|
45
|
+
const {
|
|
46
|
+
getSettings,
|
|
47
|
+
isTyping,
|
|
48
|
+
hasBlockSpotlight,
|
|
49
|
+
getEditedContentOnlySection
|
|
50
|
+
} = unlock(select(blockEditorStore));
|
|
51
|
+
const {
|
|
52
|
+
outlineMode,
|
|
53
|
+
focusMode,
|
|
54
|
+
isPreviewMode: _isPreviewMode
|
|
55
|
+
} = getSettings();
|
|
56
|
+
return {
|
|
57
|
+
isOutlineMode: outlineMode && !isTyping(),
|
|
58
|
+
isFocusMode: focusMode || hasBlockSpotlight(),
|
|
59
|
+
isPreviewMode: _isPreviewMode,
|
|
60
|
+
editedContentOnlySection: getEditedContentOnlySection()
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
56
63
|
const registry = useRegistry();
|
|
57
64
|
const { setBlockVisibility } = useDispatch(blockEditorStore);
|
|
58
65
|
const delayedBlockVisibilityUpdates = useDebounce(
|
|
@@ -91,7 +98,8 @@ function Root({ className, ...settings }) {
|
|
|
91
98
|
]),
|
|
92
99
|
className: clsx("is-root-container", className, {
|
|
93
100
|
"is-outline-mode": isOutlineMode,
|
|
94
|
-
"is-focus-mode": isFocusMode
|
|
101
|
+
"is-focus-mode": isFocusMode,
|
|
102
|
+
"is-preview-mode": isPreviewMode
|
|
95
103
|
})
|
|
96
104
|
},
|
|
97
105
|
settings
|