@wordpress/block-editor 15.8.1-next.16d95556a.0 → 15.9.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-inspector/edit-contents.js +19 -23
- package/build/components/block-inspector/edit-contents.js.map +3 -3
- package/build/components/block-inspector/index.js +7 -1
- package/build/components/block-inspector/index.js.map +2 -2
- package/build/components/block-list/block.js +4 -0
- package/build/components/block-list/block.js.map +2 -2
- package/build/components/block-list/index.js +2 -1
- package/build/components/block-list/index.js.map +2 -2
- package/build/components/block-list/use-block-props/index.js +3 -1
- package/build/components/block-list/use-block-props/index.js.map +2 -2
- package/build/components/block-list/use-block-props/use-is-hovered.js +16 -10
- package/build/components/block-list/use-block-props/use-is-hovered.js.map +2 -2
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
- package/build/components/block-lock/modal.js +5 -5
- package/build/components/block-lock/modal.js.map +2 -2
- package/build/components/block-lock/use-block-lock.js +10 -13
- package/build/components/block-lock/use-block-lock.js.map +2 -2
- package/build/components/block-settings-menu-controls/edit-section-menu-item.js +64 -0
- package/build/components/block-settings-menu-controls/edit-section-menu-item.js.map +7 -0
- package/build/components/block-settings-menu-controls/index.js +9 -1
- package/build/components/block-settings-menu-controls/index.js.map +2 -2
- package/build/components/block-toolbar/block-toolbar-icon.js +9 -9
- package/build/components/block-toolbar/block-toolbar-icon.js.map +2 -2
- package/build/components/block-tools/index.js +56 -45
- package/build/components/block-tools/index.js.map +3 -3
- package/build/components/block-variation-transforms/index.js +32 -5
- package/build/components/block-variation-transforms/index.js.map +2 -2
- package/build/components/block-visibility/toolbar.js +1 -1
- package/build/components/block-visibility/toolbar.js.map +1 -1
- package/build/components/border-radius-control/single-input-control.js +1 -0
- package/build/components/border-radius-control/single-input-control.js.map +2 -2
- package/build/components/content-only-controls/fields-dropdown-menu.js +66 -0
- package/build/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
- package/build/components/content-only-controls/index.js +444 -0
- package/build/components/content-only-controls/index.js.map +7 -0
- package/build/components/content-only-controls/link/index.js +193 -0
- package/build/components/content-only-controls/link/index.js.map +7 -0
- package/build/components/content-only-controls/media/index.js +264 -0
- package/build/components/content-only-controls/media/index.js.map +7 -0
- package/build/components/content-only-controls/rich-text/index.js +188 -0
- package/build/components/content-only-controls/rich-text/index.js.map +7 -0
- package/build/components/content-only-controls/use-inspector-popover-placement.js +41 -0
- package/build/components/content-only-controls/use-inspector-popover-placement.js.map +7 -0
- package/build/components/font-family/index.js +1 -15
- package/build/components/font-family/index.js.map +2 -2
- package/build/components/global-styles/dimensions-panel.js +35 -2
- package/build/components/global-styles/dimensions-panel.js.map +2 -2
- package/build/components/global-styles/hooks.js +1 -1
- package/build/components/global-styles/hooks.js.map +2 -2
- package/build/components/global-styles/typography-panel.js +1 -2
- package/build/components/global-styles/typography-panel.js.map +2 -2
- package/build/components/inserter/media-tab/media-tab.js +1 -33
- package/build/components/inserter/media-tab/media-tab.js.map +3 -3
- package/build/components/inspector-controls-tabs/content-tab.js +6 -2
- package/build/components/inspector-controls-tabs/content-tab.js.map +3 -3
- package/build/components/inspector-controls-tabs/index.js +7 -1
- package/build/components/inspector-controls-tabs/index.js.map +2 -2
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
- package/build/components/link-control/index.js +15 -7
- package/build/components/link-control/index.js.map +2 -2
- package/build/components/list-view/block-select-button.js +7 -8
- package/build/components/list-view/block-select-button.js.map +2 -2
- package/build/components/list-view/block.js +9 -7
- package/build/components/list-view/block.js.map +2 -2
- package/build/components/media-placeholder/index.js +18 -35
- package/build/components/media-placeholder/index.js.map +3 -3
- package/build/components/media-placeholder/utils.js +60 -0
- package/build/components/media-placeholder/utils.js.map +7 -0
- package/build/components/media-replace-flow/index.js +24 -33
- package/build/components/media-replace-flow/index.js.map +3 -3
- package/build/components/use-block-commands/index.js +1 -1
- package/build/components/use-block-commands/index.js.map +2 -2
- package/build/components/use-block-display-information/index.js +21 -1
- package/build/components/use-block-display-information/index.js.map +3 -3
- package/build/components/use-block-drop-zone/index.js +1 -5
- package/build/components/use-block-drop-zone/index.js.map +2 -2
- package/build/hooks/block-bindings.js +52 -61
- package/build/hooks/block-bindings.js.map +3 -3
- package/build/hooks/dimensions.js +3 -3
- package/build/hooks/dimensions.js.map +2 -2
- package/build/hooks/metadata.js +1 -1
- package/build/hooks/metadata.js.map +2 -2
- package/build/hooks/use-content-only-section-edit.js +67 -0
- package/build/hooks/use-content-only-section-edit.js.map +7 -0
- package/build/hooks/utils.js +5 -1
- package/build/hooks/utils.js.map +2 -2
- package/build/layouts/constrained.js +2 -2
- package/build/layouts/constrained.js.map +2 -2
- package/build/private-apis.js +2 -3
- package/build/private-apis.js.map +3 -3
- package/build/store/private-keys.js +3 -0
- package/build/store/private-keys.js.map +2 -2
- package/build/store/private-selectors.js +41 -2
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/selectors.js +6 -4
- package/build/store/selectors.js.map +2 -2
- package/build/utils/fit-text-utils.js +9 -1
- package/build/utils/fit-text-utils.js.map +2 -2
- package/build-module/components/block-inspector/edit-contents.js +9 -23
- package/build-module/components/block-inspector/edit-contents.js.map +2 -2
- package/build-module/components/block-inspector/index.js +7 -1
- package/build-module/components/block-inspector/index.js.map +2 -2
- package/build-module/components/block-list/block.js +4 -0
- package/build-module/components/block-list/block.js.map +2 -2
- package/build-module/components/block-list/index.js +2 -1
- package/build-module/components/block-list/index.js.map +2 -2
- package/build-module/components/block-list/use-block-props/index.js +3 -1
- package/build-module/components/block-list/use-block-props/index.js.map +2 -2
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +16 -10
- package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +2 -2
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
- package/build-module/components/block-lock/modal.js +5 -5
- package/build-module/components/block-lock/modal.js.map +2 -2
- package/build-module/components/block-lock/use-block-lock.js +10 -13
- package/build-module/components/block-lock/use-block-lock.js.map +2 -2
- package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js +29 -0
- package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js.map +7 -0
- package/build-module/components/block-settings-menu-controls/index.js +9 -1
- package/build-module/components/block-settings-menu-controls/index.js.map +2 -2
- package/build-module/components/block-toolbar/block-toolbar-icon.js +10 -10
- package/build-module/components/block-toolbar/block-toolbar-icon.js.map +2 -2
- package/build-module/components/block-tools/index.js +56 -45
- package/build-module/components/block-tools/index.js.map +2 -2
- package/build-module/components/block-variation-transforms/index.js +32 -5
- package/build-module/components/block-variation-transforms/index.js.map +2 -2
- package/build-module/components/block-visibility/toolbar.js +1 -1
- package/build-module/components/block-visibility/toolbar.js.map +1 -1
- package/build-module/components/border-radius-control/single-input-control.js +1 -0
- package/build-module/components/border-radius-control/single-input-control.js.map +2 -2
- package/build-module/components/content-only-controls/fields-dropdown-menu.js +45 -0
- package/build-module/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
- package/build-module/components/content-only-controls/index.js +420 -0
- package/build-module/components/content-only-controls/index.js.map +7 -0
- package/build-module/components/content-only-controls/link/index.js +160 -0
- package/build-module/components/content-only-controls/link/index.js.map +7 -0
- package/build-module/components/content-only-controls/media/index.js +242 -0
- package/build-module/components/content-only-controls/media/index.js.map +7 -0
- package/build-module/components/content-only-controls/rich-text/index.js +160 -0
- package/build-module/components/content-only-controls/rich-text/index.js.map +7 -0
- package/build-module/components/content-only-controls/use-inspector-popover-placement.js +16 -0
- package/build-module/components/content-only-controls/use-inspector-popover-placement.js.map +7 -0
- package/build-module/components/font-family/index.js +1 -15
- package/build-module/components/font-family/index.js.map +2 -2
- package/build-module/components/global-styles/dimensions-panel.js +35 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +2 -2
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +2 -2
- package/build-module/components/global-styles/typography-panel.js +1 -2
- package/build-module/components/global-styles/typography-panel.js.map +2 -2
- package/build-module/components/inserter/media-tab/media-tab.js +2 -34
- package/build-module/components/inserter/media-tab/media-tab.js.map +2 -2
- package/build-module/components/inspector-controls-tabs/content-tab.js +7 -3
- package/build-module/components/inspector-controls-tabs/content-tab.js.map +2 -2
- package/build-module/components/inspector-controls-tabs/index.js +7 -1
- package/build-module/components/inspector-controls-tabs/index.js.map +2 -2
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
- package/build-module/components/link-control/index.js +16 -8
- package/build-module/components/link-control/index.js.map +2 -2
- package/build-module/components/list-view/block-select-button.js +14 -9
- package/build-module/components/list-view/block-select-button.js.map +2 -2
- package/build-module/components/list-view/block.js +9 -7
- package/build-module/components/list-view/block.js.map +2 -2
- package/build-module/components/media-placeholder/index.js +19 -36
- package/build-module/components/media-placeholder/index.js.map +2 -2
- package/build-module/components/media-placeholder/utils.js +35 -0
- package/build-module/components/media-placeholder/utils.js.map +7 -0
- package/build-module/components/media-replace-flow/index.js +24 -33
- package/build-module/components/media-replace-flow/index.js.map +2 -2
- package/build-module/components/use-block-commands/index.js +1 -1
- package/build-module/components/use-block-commands/index.js.map +2 -2
- package/build-module/components/use-block-display-information/index.js +21 -1
- package/build-module/components/use-block-display-information/index.js.map +3 -3
- package/build-module/components/use-block-drop-zone/index.js +1 -5
- package/build-module/components/use-block-drop-zone/index.js.map +2 -2
- package/build-module/hooks/block-bindings.js +57 -62
- package/build-module/hooks/block-bindings.js.map +2 -2
- package/build-module/hooks/dimensions.js +3 -3
- package/build-module/hooks/dimensions.js.map +2 -2
- package/build-module/hooks/metadata.js +1 -1
- package/build-module/hooks/metadata.js.map +2 -2
- package/build-module/hooks/use-content-only-section-edit.js +46 -0
- package/build-module/hooks/use-content-only-section-edit.js.map +7 -0
- package/build-module/hooks/utils.js +5 -1
- package/build-module/hooks/utils.js.map +2 -2
- package/build-module/layouts/constrained.js +2 -2
- package/build-module/layouts/constrained.js.map +2 -2
- package/build-module/private-apis.js +3 -3
- package/build-module/private-apis.js.map +2 -2
- package/build-module/store/private-keys.js +2 -0
- package/build-module/store/private-keys.js.map +2 -2
- package/build-module/store/private-selectors.js +37 -2
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/selectors.js +6 -4
- package/build-module/store/selectors.js.map +2 -2
- package/build-module/utils/fit-text-utils.js +9 -1
- package/build-module/utils/fit-text-utils.js.map +2 -2
- package/build-style/content-rtl.css +3 -0
- package/build-style/content.css +3 -0
- package/build-style/style-rtl.css +145 -4
- package/build-style/style.css +145 -4
- package/package.json +38 -37
- package/src/components/block-inspector/edit-contents.js +10 -29
- package/src/components/block-inspector/index.js +4 -2
- package/src/components/block-list/block.js +6 -0
- package/src/components/block-list/content.scss +5 -0
- package/src/components/block-list/index.js +3 -1
- package/src/components/block-list/use-block-props/index.js +3 -1
- package/src/components/block-list/use-block-props/use-is-hovered.js +24 -12
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +34 -3
- package/src/components/block-lock/modal.js +6 -5
- package/src/components/block-lock/use-block-lock.js +10 -14
- package/src/components/block-patterns-list/stories/{index.story.js → index.story.jsx} +3 -1
- package/src/components/block-settings-menu-controls/edit-section-menu-item.js +39 -0
- package/src/components/block-settings-menu-controls/index.js +8 -1
- package/src/components/block-toolbar/block-toolbar-icon.js +14 -10
- package/src/components/block-tools/index.js +15 -2
- package/src/components/block-tools/style.scss +4 -0
- package/src/components/block-variation-transforms/index.js +96 -35
- package/src/components/block-visibility/toolbar.js +1 -1
- package/src/components/border-radius-control/single-input-control.js +1 -0
- package/src/components/content-only-controls/fields-dropdown-menu.js +53 -0
- package/src/components/content-only-controls/index.js +560 -0
- package/src/components/content-only-controls/link/index.js +200 -0
- package/src/components/content-only-controls/link/styles.scss +23 -0
- package/src/components/content-only-controls/media/index.js +306 -0
- package/src/components/content-only-controls/media/styles.scss +47 -0
- package/src/components/content-only-controls/rich-text/index.js +179 -0
- package/src/components/content-only-controls/rich-text/styles.scss +24 -0
- package/src/components/content-only-controls/styles.scss +44 -0
- package/src/components/content-only-controls/use-inspector-popover-placement.js +19 -0
- package/src/components/font-family/README.md +0 -9
- package/src/components/font-family/index.js +1 -16
- package/src/components/font-family/stories/{index.story.js → index.story.jsx} +0 -1
- package/src/components/global-styles/dimensions-panel.js +36 -0
- package/src/components/global-styles/hooks.js +1 -1
- package/src/components/global-styles/typography-panel.js +0 -1
- package/src/components/inserter/media-tab/media-tab.js +2 -44
- package/src/components/inspector-controls-tabs/content-tab.js +12 -4
- package/src/components/inspector-controls-tabs/index.js +4 -1
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -5
- package/src/components/link-control/index.js +36 -12
- package/src/components/list-view/block-select-button.js +15 -10
- package/src/components/list-view/block.js +9 -7
- package/src/components/media-placeholder/index.js +21 -46
- package/src/components/media-placeholder/test/get-computed-accept-attribute.js +164 -0
- package/src/components/media-placeholder/utils.js +65 -0
- package/src/components/media-replace-flow/index.js +25 -42
- package/src/components/use-block-commands/index.js +1 -1
- package/src/components/use-block-display-information/index.js +30 -2
- package/src/components/use-block-drop-zone/index.js +1 -5
- package/src/hooks/block-bindings.js +71 -82
- package/src/hooks/dimensions.js +8 -3
- package/src/hooks/metadata.js +1 -1
- package/src/hooks/test/metadata.js +1 -1
- package/src/hooks/use-content-only-section-edit.js +63 -0
- package/src/hooks/utils.js +4 -0
- package/src/layouts/constrained.js +8 -2
- package/src/private-apis.js +2 -2
- package/src/store/private-keys.js +1 -0
- package/src/store/private-selectors.js +121 -5
- package/src/store/selectors.js +6 -4
- package/src/store/test/private-selectors.js +242 -0
- package/src/style.scss +1 -1
- package/src/utils/fit-text-utils.js +19 -1
- package/tsconfig.json +1 -0
- package/build/components/media-upload-modal/index.js +0 -29
- package/build/components/media-upload-modal/index.js.map +0 -7
- package/build-module/components/media-upload-modal/index.js +0 -8
- package/build-module/components/media-upload-modal/index.js.map +0 -7
- package/src/components/font-family/style.scss +0 -7
- package/src/components/media-upload-modal/index.js +0 -18
- /package/src/components/alignment-control/stories/{aliginment-toolbar.story.js → aliginment-toolbar.story.jsx} +0 -0
- /package/src/components/alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-alignment-matrix-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-draggable/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-heading-level-dropdown/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-mover/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/block-title/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/border-radius-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/date-format-picker/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{aspect-ratio-tool.story.js → aspect-ratio-tool.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{scale-tool.story.js → scale-tool.story.jsx} +0 -0
- /package/src/components/dimensions-tool/stories/{width-height-tool.story.js → width-height-tool.story.jsx} +0 -0
- /package/src/components/height-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/inserter/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/line-height-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/plain-text/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/resolution-tool/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/tabbed-sidebar/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/text-alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/text-decoration-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/text-transform-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/unit-control/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/url-popover/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/warning/stories/{index.story.js → index.story.jsx} +0 -0
- /package/src/components/writing-mode-control/stories/{index.story.js → index.story.jsx} +0 -0
|
@@ -4,10 +4,17 @@ function findOptimalFontSize(textElement, applyFontSize) {
|
|
|
4
4
|
let minSize = 5;
|
|
5
5
|
let maxSize = 2400;
|
|
6
6
|
let bestSize = minSize;
|
|
7
|
+
const computedStyle = window.getComputedStyle(textElement);
|
|
8
|
+
const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
|
|
9
|
+
const paddingRight = parseFloat(computedStyle.paddingRight) || 0;
|
|
10
|
+
const range = document.createRange();
|
|
11
|
+
range.selectNodeContents(textElement);
|
|
7
12
|
while (minSize <= maxSize) {
|
|
8
13
|
const midSize = Math.floor((minSize + maxSize) / 2);
|
|
9
14
|
applyFontSize(midSize);
|
|
10
|
-
const
|
|
15
|
+
const rect = range.getBoundingClientRect();
|
|
16
|
+
const textWidth = rect.width;
|
|
17
|
+
const fitsWidth = textElement.scrollWidth <= textElement.clientWidth && textWidth <= textElement.clientWidth - paddingLeft - paddingRight;
|
|
11
18
|
const fitsHeight = alreadyHasScrollableHeight || textElement.scrollHeight <= textElement.clientHeight;
|
|
12
19
|
if (fitsWidth && fitsHeight) {
|
|
13
20
|
bestSize = midSize;
|
|
@@ -16,6 +23,7 @@ function findOptimalFontSize(textElement, applyFontSize) {
|
|
|
16
23
|
maxSize = midSize - 1;
|
|
17
24
|
}
|
|
18
25
|
}
|
|
26
|
+
range.detach();
|
|
19
27
|
return bestSize;
|
|
20
28
|
}
|
|
21
29
|
function optimizeFitText(textElement, applyFontSize) {
|
|
@@ -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 5-600px.\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 = 5;\n\tlet maxSize = 2400;\n\tlet bestSize = minSize;\n\n\twhile ( minSize <= maxSize ) {\n\t\tconst midSize = Math.floor( ( minSize + maxSize ) / 2 );\n\t\tapplyFontSize( midSize );\n\n\t\tconst
|
|
5
|
-
"mappings": ";AAYA,SAAS,oBAAqB,aAAa,eAAgB;AAC1D,QAAM,6BACL,YAAY,eAAe,YAAY;AACxC,MAAI,UAAU;AACd,MAAI,UAAU;AACd,MAAI,WAAW;AAEf,SAAQ,WAAW,SAAU;AAC5B,UAAM,UAAU,KAAK,OAAS,UAAU,WAAY,CAAE;AACtD,kBAAe,OAAQ;
|
|
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 5-600px.\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 = 5;\n\tlet maxSize = 2400;\n\tlet bestSize = minSize;\n\n\tconst computedStyle = window.getComputedStyle( textElement );\n\tconst paddingLeft = parseFloat( computedStyle.paddingLeft ) || 0;\n\tconst paddingRight = parseFloat( computedStyle.paddingRight ) || 0;\n\tconst range = document.createRange();\n\trange.selectNodeContents( textElement );\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 <= textElement.clientWidth &&\n\t\t\ttextWidth <= textElement.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 <= textElement.clientHeight;\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": ";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,QAAM,cAAc,WAAY,cAAc,WAAY,KAAK;AAC/D,QAAM,eAAe,WAAY,cAAc,YAAa,KAAK;AACjE,QAAM,QAAQ,SAAS,YAAY;AACnC,QAAM,mBAAoB,WAAY;AAEtC,SAAQ,WAAW,SAAU;AAC5B,UAAM,UAAU,KAAK,OAAS,UAAU,WAAY,CAAE;AACtD,kBAAe,OAAQ;AAKvB,UAAM,OAAO,MAAM,sBAAsB;AACzC,UAAM,YAAY,KAAK;AAIvB,UAAM,YACL,YAAY,eAAe,YAAY,eACvC,aAAa,YAAY,cAAc,cAAc;AAEtD,UAAM,aACL,8BACA,YAAY,gBAAgB,YAAY;AAEzC,QAAK,aAAa,YAAa;AAC9B,iBAAW;AACX,gBAAU,UAAU;AAAA,IACrB,OAAO;AACN,gBAAU,UAAU;AAAA,IACrB;AAAA,EACD;AACA,QAAM,OAAO;AAEb,SAAO;AACR;AASO,SAAS,gBAAiB,aAAa,eAAgB;AAC7D,MAAK,CAAE,aAAc;AACpB;AAAA,EACD;AAEA,gBAAe,CAAE;AAEjB,QAAM,cAAc,oBAAqB,aAAa,aAAc;AAEpE,gBAAe,WAAY;AAC3B,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -279,6 +279,9 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
279
279
|
.block-editor-block-list__layout .block-editor-block-list__block[draggable=true], .block-editor-block-list__layout .block-editor-block-list__block[data-draggable=true] {
|
|
280
280
|
cursor: grab;
|
|
281
281
|
}
|
|
282
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected {
|
|
283
|
+
cursor: default;
|
|
284
|
+
}
|
|
282
285
|
.block-editor-block-list__layout .block-editor-block-list__block[contenteditable],
|
|
283
286
|
.block-editor-block-list__layout .block-editor-block-list__block [contenteditable] {
|
|
284
287
|
cursor: text;
|
package/build-style/content.css
CHANGED
|
@@ -279,6 +279,9 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
279
279
|
.block-editor-block-list__layout .block-editor-block-list__block[draggable=true], .block-editor-block-list__layout .block-editor-block-list__block[data-draggable=true] {
|
|
280
280
|
cursor: grab;
|
|
281
281
|
}
|
|
282
|
+
.block-editor-block-list__layout .block-editor-block-list__block.is-multi-selected {
|
|
283
|
+
cursor: default;
|
|
284
|
+
}
|
|
282
285
|
.block-editor-block-list__layout .block-editor-block-list__block[contenteditable],
|
|
283
286
|
.block-editor-block-list__layout .block-editor-block-list__block [contenteditable] {
|
|
284
287
|
cursor: text;
|
|
@@ -531,6 +531,10 @@ iframe[name=editor-canvas] {
|
|
|
531
531
|
right: 50%;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
+
.block-editor-block-tools--is-dragging > .popover-slot {
|
|
535
|
+
display: none;
|
|
536
|
+
}
|
|
537
|
+
|
|
534
538
|
.block-editor-block-lock-modal {
|
|
535
539
|
z-index: 1000001;
|
|
536
540
|
}
|
|
@@ -1623,6 +1627,147 @@ iframe[name=editor-canvas] {
|
|
|
1623
1627
|
}
|
|
1624
1628
|
}
|
|
1625
1629
|
|
|
1630
|
+
.block-editor-content-only-controls__link {
|
|
1631
|
+
width: 100%;
|
|
1632
|
+
box-shadow: inset 0 0 0 1px #ccc;
|
|
1633
|
+
}
|
|
1634
|
+
.block-editor-content-only-controls__link:focus:not(:disabled) {
|
|
1635
|
+
box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
.block-editor-content-only-controls__link-row {
|
|
1639
|
+
align-items: center;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
.block-editor-content-only-controls__link-title {
|
|
1643
|
+
width: 100%;
|
|
1644
|
+
white-space: nowrap;
|
|
1645
|
+
text-overflow: ellipsis;
|
|
1646
|
+
overflow: hidden;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.block-editor-content-only-controls__media {
|
|
1650
|
+
width: 100%;
|
|
1651
|
+
box-shadow: inset 0 0 0 1px #ccc;
|
|
1652
|
+
}
|
|
1653
|
+
.block-editor-content-only-controls__media:focus:not(:disabled) {
|
|
1654
|
+
box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
.block-editor-content-only-controls__media-replace-flow {
|
|
1658
|
+
display: block;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
.block-editor-content-only-controls__media-row {
|
|
1662
|
+
align-items: center;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
.block-editor-content-only-controls__media-placeholder {
|
|
1666
|
+
width: 24px;
|
|
1667
|
+
height: 24px;
|
|
1668
|
+
border-radius: 2px;
|
|
1669
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
|
|
1670
|
+
display: inline-block;
|
|
1671
|
+
padding: 0;
|
|
1672
|
+
background: #fff linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
.block-editor-content-only-controls__media-title {
|
|
1676
|
+
width: 100%;
|
|
1677
|
+
white-space: nowrap;
|
|
1678
|
+
text-overflow: ellipsis;
|
|
1679
|
+
overflow: hidden;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
block-editor-content-only-controls__media-thumbnail {
|
|
1683
|
+
width: 100%;
|
|
1684
|
+
height: 100%;
|
|
1685
|
+
border-radius: 2px;
|
|
1686
|
+
align-self: center;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.block-editor-content-only-controls__rich-text {
|
|
1690
|
+
width: 100%;
|
|
1691
|
+
margin: 0;
|
|
1692
|
+
background: #fff;
|
|
1693
|
+
color: #1e1e1e;
|
|
1694
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
1695
|
+
padding: 6px 8px;
|
|
1696
|
+
/* Fonts smaller than 16px causes mobile safari to zoom. */
|
|
1697
|
+
font-size: 16px;
|
|
1698
|
+
/* Override core line-height. To be reviewed. */
|
|
1699
|
+
line-height: normal;
|
|
1700
|
+
box-shadow: 0 0 0 transparent;
|
|
1701
|
+
border-radius: 2px;
|
|
1702
|
+
border: 1px solid #949494;
|
|
1703
|
+
}
|
|
1704
|
+
@media not (prefers-reduced-motion) {
|
|
1705
|
+
.block-editor-content-only-controls__rich-text {
|
|
1706
|
+
transition: box-shadow 0.1s linear;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
@media (min-width: 600px) {
|
|
1710
|
+
.block-editor-content-only-controls__rich-text {
|
|
1711
|
+
font-size: 13px;
|
|
1712
|
+
/* Override core line-height. To be reviewed. */
|
|
1713
|
+
line-height: normal;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
.block-editor-content-only-controls__rich-text:focus {
|
|
1717
|
+
border-color: var(--wp-admin-theme-color, #3858e9);
|
|
1718
|
+
box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color, #3858e9);
|
|
1719
|
+
outline: 2px solid transparent;
|
|
1720
|
+
}
|
|
1721
|
+
.block-editor-content-only-controls__rich-text::-webkit-input-placeholder {
|
|
1722
|
+
color: rgba(30, 30, 30, 0.62);
|
|
1723
|
+
}
|
|
1724
|
+
.block-editor-content-only-controls__rich-text::-moz-placeholder {
|
|
1725
|
+
color: rgba(30, 30, 30, 0.62);
|
|
1726
|
+
}
|
|
1727
|
+
.block-editor-content-only-controls__rich-text:-ms-input-placeholder {
|
|
1728
|
+
color: rgba(30, 30, 30, 0.62);
|
|
1729
|
+
}
|
|
1730
|
+
.block-editor-content-only-controls__rich-text {
|
|
1731
|
+
border-color: #949494;
|
|
1732
|
+
}
|
|
1733
|
+
.block-editor-content-only-controls__rich-text::placeholder {
|
|
1734
|
+
color: color-mix(in srgb, #1e1e1e, transparent 38%);
|
|
1735
|
+
}
|
|
1736
|
+
.block-editor-content-only-controls__rich-text {
|
|
1737
|
+
min-height: 40px;
|
|
1738
|
+
padding: 12px;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
.block-editor-content-only-controls__screen.components-navigator-screen {
|
|
1742
|
+
padding: 8px 0 16px 0;
|
|
1743
|
+
}
|
|
1744
|
+
.block-editor-content-only-controls__screen {
|
|
1745
|
+
border-top: 1px solid #e0e0e0;
|
|
1746
|
+
}
|
|
1747
|
+
.block-editor-content-only-controls__screen .components-tools-panel {
|
|
1748
|
+
border-top: none;
|
|
1749
|
+
padding-top: 8px;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
.block-editor-content-only-controls__button-panel {
|
|
1753
|
+
padding: 4px;
|
|
1754
|
+
font-weight: 500 !important;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
.block-editor-content-only-controls__back-button,
|
|
1758
|
+
.block-editor-content-only-controls__drill-down-button {
|
|
1759
|
+
width: 100%;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
.block-editor-content-only-controls__fields-container {
|
|
1763
|
+
padding: 0 16px;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
.block-editor-content-only-controls__fields-header {
|
|
1767
|
+
padding: 8px 0;
|
|
1768
|
+
margin-bottom: 4px;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1626
1771
|
.block-editor-date-format-picker {
|
|
1627
1772
|
margin: 0 0 16px;
|
|
1628
1773
|
padding: 0;
|
|
@@ -1656,10 +1801,6 @@ iframe[name=editor-canvas] {
|
|
|
1656
1801
|
text-transform: capitalize;
|
|
1657
1802
|
}
|
|
1658
1803
|
|
|
1659
|
-
.block-editor-font-family-control:not(.is-next-has-no-margin-bottom) {
|
|
1660
|
-
margin-bottom: 8px;
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
1804
|
.block-editor-global-styles__toggle-icon {
|
|
1664
1805
|
fill: currentColor;
|
|
1665
1806
|
}
|
package/build-style/style.css
CHANGED
|
@@ -531,6 +531,10 @@ iframe[name=editor-canvas] {
|
|
|
531
531
|
left: 50%;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
+
.block-editor-block-tools--is-dragging > .popover-slot {
|
|
535
|
+
display: none;
|
|
536
|
+
}
|
|
537
|
+
|
|
534
538
|
.block-editor-block-lock-modal {
|
|
535
539
|
z-index: 1000001;
|
|
536
540
|
}
|
|
@@ -1623,6 +1627,147 @@ iframe[name=editor-canvas] {
|
|
|
1623
1627
|
}
|
|
1624
1628
|
}
|
|
1625
1629
|
|
|
1630
|
+
.block-editor-content-only-controls__link {
|
|
1631
|
+
width: 100%;
|
|
1632
|
+
box-shadow: inset 0 0 0 1px #ccc;
|
|
1633
|
+
}
|
|
1634
|
+
.block-editor-content-only-controls__link:focus:not(:disabled) {
|
|
1635
|
+
box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
.block-editor-content-only-controls__link-row {
|
|
1639
|
+
align-items: center;
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
.block-editor-content-only-controls__link-title {
|
|
1643
|
+
width: 100%;
|
|
1644
|
+
white-space: nowrap;
|
|
1645
|
+
text-overflow: ellipsis;
|
|
1646
|
+
overflow: hidden;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.block-editor-content-only-controls__media {
|
|
1650
|
+
width: 100%;
|
|
1651
|
+
box-shadow: inset 0 0 0 1px #ccc;
|
|
1652
|
+
}
|
|
1653
|
+
.block-editor-content-only-controls__media:focus:not(:disabled) {
|
|
1654
|
+
box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
.block-editor-content-only-controls__media-replace-flow {
|
|
1658
|
+
display: block;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
.block-editor-content-only-controls__media-row {
|
|
1662
|
+
align-items: center;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
.block-editor-content-only-controls__media-placeholder {
|
|
1666
|
+
width: 24px;
|
|
1667
|
+
height: 24px;
|
|
1668
|
+
border-radius: 2px;
|
|
1669
|
+
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
|
|
1670
|
+
display: inline-block;
|
|
1671
|
+
padding: 0;
|
|
1672
|
+
background: #fff linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
.block-editor-content-only-controls__media-title {
|
|
1676
|
+
width: 100%;
|
|
1677
|
+
white-space: nowrap;
|
|
1678
|
+
text-overflow: ellipsis;
|
|
1679
|
+
overflow: hidden;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
block-editor-content-only-controls__media-thumbnail {
|
|
1683
|
+
width: 100%;
|
|
1684
|
+
height: 100%;
|
|
1685
|
+
border-radius: 2px;
|
|
1686
|
+
align-self: center;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
.block-editor-content-only-controls__rich-text {
|
|
1690
|
+
width: 100%;
|
|
1691
|
+
margin: 0;
|
|
1692
|
+
background: #fff;
|
|
1693
|
+
color: #1e1e1e;
|
|
1694
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
1695
|
+
padding: 6px 8px;
|
|
1696
|
+
/* Fonts smaller than 16px causes mobile safari to zoom. */
|
|
1697
|
+
font-size: 16px;
|
|
1698
|
+
/* Override core line-height. To be reviewed. */
|
|
1699
|
+
line-height: normal;
|
|
1700
|
+
box-shadow: 0 0 0 transparent;
|
|
1701
|
+
border-radius: 2px;
|
|
1702
|
+
border: 1px solid #949494;
|
|
1703
|
+
}
|
|
1704
|
+
@media not (prefers-reduced-motion) {
|
|
1705
|
+
.block-editor-content-only-controls__rich-text {
|
|
1706
|
+
transition: box-shadow 0.1s linear;
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
@media (min-width: 600px) {
|
|
1710
|
+
.block-editor-content-only-controls__rich-text {
|
|
1711
|
+
font-size: 13px;
|
|
1712
|
+
/* Override core line-height. To be reviewed. */
|
|
1713
|
+
line-height: normal;
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
.block-editor-content-only-controls__rich-text:focus {
|
|
1717
|
+
border-color: var(--wp-admin-theme-color, #3858e9);
|
|
1718
|
+
box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color, #3858e9);
|
|
1719
|
+
outline: 2px solid transparent;
|
|
1720
|
+
}
|
|
1721
|
+
.block-editor-content-only-controls__rich-text::-webkit-input-placeholder {
|
|
1722
|
+
color: rgba(30, 30, 30, 0.62);
|
|
1723
|
+
}
|
|
1724
|
+
.block-editor-content-only-controls__rich-text::-moz-placeholder {
|
|
1725
|
+
color: rgba(30, 30, 30, 0.62);
|
|
1726
|
+
}
|
|
1727
|
+
.block-editor-content-only-controls__rich-text:-ms-input-placeholder {
|
|
1728
|
+
color: rgba(30, 30, 30, 0.62);
|
|
1729
|
+
}
|
|
1730
|
+
.block-editor-content-only-controls__rich-text {
|
|
1731
|
+
border-color: #949494;
|
|
1732
|
+
}
|
|
1733
|
+
.block-editor-content-only-controls__rich-text::placeholder {
|
|
1734
|
+
color: color-mix(in srgb, #1e1e1e, transparent 38%);
|
|
1735
|
+
}
|
|
1736
|
+
.block-editor-content-only-controls__rich-text {
|
|
1737
|
+
min-height: 40px;
|
|
1738
|
+
padding: 12px;
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1741
|
+
.block-editor-content-only-controls__screen.components-navigator-screen {
|
|
1742
|
+
padding: 8px 0 16px 0;
|
|
1743
|
+
}
|
|
1744
|
+
.block-editor-content-only-controls__screen {
|
|
1745
|
+
border-top: 1px solid #e0e0e0;
|
|
1746
|
+
}
|
|
1747
|
+
.block-editor-content-only-controls__screen .components-tools-panel {
|
|
1748
|
+
border-top: none;
|
|
1749
|
+
padding-top: 8px;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
.block-editor-content-only-controls__button-panel {
|
|
1753
|
+
padding: 4px;
|
|
1754
|
+
font-weight: 500 !important;
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
.block-editor-content-only-controls__back-button,
|
|
1758
|
+
.block-editor-content-only-controls__drill-down-button {
|
|
1759
|
+
width: 100%;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
.block-editor-content-only-controls__fields-container {
|
|
1763
|
+
padding: 0 16px;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
.block-editor-content-only-controls__fields-header {
|
|
1767
|
+
padding: 8px 0;
|
|
1768
|
+
margin-bottom: 4px;
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1626
1771
|
.block-editor-date-format-picker {
|
|
1627
1772
|
margin: 0 0 16px;
|
|
1628
1773
|
padding: 0;
|
|
@@ -1656,10 +1801,6 @@ iframe[name=editor-canvas] {
|
|
|
1656
1801
|
text-transform: capitalize;
|
|
1657
1802
|
}
|
|
1658
1803
|
|
|
1659
|
-
.block-editor-font-family-control:not(.is-next-has-no-margin-bottom) {
|
|
1660
|
-
margin-bottom: 8px;
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
1804
|
.block-editor-global-styles__toggle-icon {
|
|
1664
1805
|
fill: currentColor;
|
|
1665
1806
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.9.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -55,41 +55,42 @@
|
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
56
56
|
"@emotion/styled": "^11.6.0",
|
|
57
57
|
"@react-spring/web": "^9.4.5",
|
|
58
|
-
"@wordpress/a11y": "^4.
|
|
59
|
-
"@wordpress/api-fetch": "^7.
|
|
60
|
-
"@wordpress/base-styles": "^6.
|
|
61
|
-
"@wordpress/blob": "^4.
|
|
62
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
63
|
-
"@wordpress/blocks": "^15.
|
|
64
|
-
"@wordpress/commands": "^1.
|
|
65
|
-
"@wordpress/components": "^30.
|
|
66
|
-
"@wordpress/compose": "^7.
|
|
67
|
-
"@wordpress/data": "^10.
|
|
68
|
-
"@wordpress/
|
|
69
|
-
"@wordpress/
|
|
70
|
-
"@wordpress/
|
|
71
|
-
"@wordpress/
|
|
72
|
-
"@wordpress/
|
|
73
|
-
"@wordpress/
|
|
74
|
-
"@wordpress/
|
|
75
|
-
"@wordpress/
|
|
76
|
-
"@wordpress/
|
|
77
|
-
"@wordpress/
|
|
78
|
-
"@wordpress/
|
|
79
|
-
"@wordpress/
|
|
80
|
-
"@wordpress/
|
|
81
|
-
"@wordpress/
|
|
82
|
-
"@wordpress/
|
|
83
|
-
"@wordpress/
|
|
84
|
-
"@wordpress/
|
|
85
|
-
"@wordpress/
|
|
86
|
-
"@wordpress/
|
|
87
|
-
"@wordpress/
|
|
88
|
-
"@wordpress/
|
|
89
|
-
"@wordpress/
|
|
90
|
-
"@wordpress/
|
|
91
|
-
"@wordpress/
|
|
92
|
-
"@wordpress/
|
|
58
|
+
"@wordpress/a11y": "^4.36.0",
|
|
59
|
+
"@wordpress/api-fetch": "^7.36.0",
|
|
60
|
+
"@wordpress/base-styles": "^6.12.0",
|
|
61
|
+
"@wordpress/blob": "^4.36.0",
|
|
62
|
+
"@wordpress/block-serialization-default-parser": "^5.36.0",
|
|
63
|
+
"@wordpress/blocks": "^15.9.0",
|
|
64
|
+
"@wordpress/commands": "^1.36.0",
|
|
65
|
+
"@wordpress/components": "^30.9.0",
|
|
66
|
+
"@wordpress/compose": "^7.36.0",
|
|
67
|
+
"@wordpress/data": "^10.36.0",
|
|
68
|
+
"@wordpress/dataviews": "^11.0.0",
|
|
69
|
+
"@wordpress/date": "^5.36.0",
|
|
70
|
+
"@wordpress/deprecated": "^4.36.0",
|
|
71
|
+
"@wordpress/dom": "^4.36.0",
|
|
72
|
+
"@wordpress/element": "^6.36.0",
|
|
73
|
+
"@wordpress/escape-html": "^3.36.0",
|
|
74
|
+
"@wordpress/global-styles-engine": "^1.3.0",
|
|
75
|
+
"@wordpress/hooks": "^4.36.0",
|
|
76
|
+
"@wordpress/html-entities": "^4.36.0",
|
|
77
|
+
"@wordpress/i18n": "^6.9.0",
|
|
78
|
+
"@wordpress/icons": "^11.3.0",
|
|
79
|
+
"@wordpress/interactivity": "^6.36.0",
|
|
80
|
+
"@wordpress/is-shallow-equal": "^5.36.0",
|
|
81
|
+
"@wordpress/keyboard-shortcuts": "^5.36.0",
|
|
82
|
+
"@wordpress/keycodes": "^4.36.0",
|
|
83
|
+
"@wordpress/notices": "^5.36.0",
|
|
84
|
+
"@wordpress/preferences": "^4.36.0",
|
|
85
|
+
"@wordpress/priority-queue": "^3.36.0",
|
|
86
|
+
"@wordpress/private-apis": "^1.36.0",
|
|
87
|
+
"@wordpress/rich-text": "^7.36.0",
|
|
88
|
+
"@wordpress/style-engine": "^2.36.0",
|
|
89
|
+
"@wordpress/token-list": "^3.36.0",
|
|
90
|
+
"@wordpress/upload-media": "^0.21.0",
|
|
91
|
+
"@wordpress/url": "^4.36.0",
|
|
92
|
+
"@wordpress/warning": "^3.36.0",
|
|
93
|
+
"@wordpress/wordcount": "^4.36.0",
|
|
93
94
|
"change-case": "^4.1.2",
|
|
94
95
|
"clsx": "^2.1.1",
|
|
95
96
|
"colord": "^2.7.0",
|
|
@@ -112,5 +113,5 @@
|
|
|
112
113
|
"publishConfig": {
|
|
113
114
|
"access": "public"
|
|
114
115
|
},
|
|
115
|
-
"gitHead": "
|
|
116
|
+
"gitHead": "b35cf1a2dce04665e99fd6b9c2891c0b336361b9"
|
|
116
117
|
}
|
|
@@ -2,40 +2,21 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { Button, __experimentalVStack as VStack } from '@wordpress/components';
|
|
5
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
5
|
import { __ } from '@wordpress/i18n';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* Internal dependencies
|
|
10
9
|
*/
|
|
11
|
-
import
|
|
12
|
-
import { unlock } from '../../lock-unlock';
|
|
10
|
+
import useContentOnlySectionEdit from '../../hooks/use-content-only-section-edit';
|
|
13
11
|
|
|
14
12
|
export default function EditContents( { clientId } ) {
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
isSectionBlock,
|
|
23
|
-
getParentSectionBlock,
|
|
24
|
-
getEditedContentOnlySection,
|
|
25
|
-
isWithinEditedContentOnlySection,
|
|
26
|
-
} = unlock( select( blockEditorStore ) );
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
isWithinSection:
|
|
30
|
-
isSectionBlock( clientId ) ||
|
|
31
|
-
!! getParentSectionBlock( clientId ),
|
|
32
|
-
isWithinEditedSection:
|
|
33
|
-
isWithinEditedContentOnlySection( clientId ),
|
|
34
|
-
editedContentOnlySection: getEditedContentOnlySection(),
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
[ clientId ]
|
|
38
|
-
);
|
|
13
|
+
const {
|
|
14
|
+
isWithinSection,
|
|
15
|
+
isWithinEditedSection,
|
|
16
|
+
editedContentOnlySection,
|
|
17
|
+
editContentOnlySection,
|
|
18
|
+
stopEditingContentOnlySection,
|
|
19
|
+
} = useContentOnlySectionEdit( clientId );
|
|
39
20
|
|
|
40
21
|
if ( ! isWithinSection && ! isWithinEditedSection ) {
|
|
41
22
|
return null;
|
|
@@ -56,8 +37,8 @@ export default function EditContents( { clientId } ) {
|
|
|
56
37
|
} }
|
|
57
38
|
>
|
|
58
39
|
{ editedContentOnlySection
|
|
59
|
-
? __( 'Exit
|
|
60
|
-
: __( 'Edit
|
|
40
|
+
? __( 'Exit section' )
|
|
41
|
+
: __( 'Edit section' ) }
|
|
61
42
|
</Button>
|
|
62
43
|
</VStack>
|
|
63
44
|
);
|
|
@@ -29,7 +29,6 @@ import PositionControls from '../inspector-controls-tabs/position-controls-panel
|
|
|
29
29
|
import useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';
|
|
30
30
|
import { useBorderPanelLabel } from '../../hooks/border';
|
|
31
31
|
import ContentTab from '../inspector-controls-tabs/content-tab';
|
|
32
|
-
|
|
33
32
|
import { unlock } from '../../lock-unlock';
|
|
34
33
|
|
|
35
34
|
function BlockStylesPanel( { clientId } ) {
|
|
@@ -368,7 +367,10 @@ const BlockInspectorSingleBlock = ( {
|
|
|
368
367
|
{ hasBlockStyles && (
|
|
369
368
|
<BlockStylesPanel clientId={ clientId } />
|
|
370
369
|
) }
|
|
371
|
-
<ContentTab
|
|
370
|
+
<ContentTab
|
|
371
|
+
rootClientId={ clientId }
|
|
372
|
+
contentClientIds={ contentClientIds }
|
|
373
|
+
/>
|
|
372
374
|
{ ! isSectionBlock && (
|
|
373
375
|
<StyleInspectorSlots
|
|
374
376
|
blockName={ blockName }
|
|
@@ -563,6 +563,7 @@ function BlockListBlockProvider( props ) {
|
|
|
563
563
|
isSelectionEnabled,
|
|
564
564
|
getTemplateLock,
|
|
565
565
|
isSectionBlock: _isSectionBlock,
|
|
566
|
+
getParentSectionBlock,
|
|
566
567
|
getBlockWithoutAttributes,
|
|
567
568
|
getBlockAttributes,
|
|
568
569
|
canRemoveBlock,
|
|
@@ -674,6 +675,9 @@ function BlockListBlockProvider( props ) {
|
|
|
674
675
|
isSelectionEnabled: isSelectionEnabled(),
|
|
675
676
|
isLocked: !! getTemplateLock( rootClientId ),
|
|
676
677
|
isSectionBlock: _isSectionBlock( clientId ),
|
|
678
|
+
isWithinSectionBlock:
|
|
679
|
+
_isSectionBlock( clientId ) ||
|
|
680
|
+
!! getParentSectionBlock( clientId ),
|
|
677
681
|
canRemove,
|
|
678
682
|
canMove,
|
|
679
683
|
isSelected: _isSelected,
|
|
@@ -756,6 +760,7 @@ function BlockListBlockProvider( props ) {
|
|
|
756
760
|
isDragging,
|
|
757
761
|
hasChildSelected,
|
|
758
762
|
isSectionBlock,
|
|
763
|
+
isWithinSectionBlock,
|
|
759
764
|
isEditingDisabled,
|
|
760
765
|
hasEditableOutline,
|
|
761
766
|
className,
|
|
@@ -802,6 +807,7 @@ function BlockListBlockProvider( props ) {
|
|
|
802
807
|
isDragging,
|
|
803
808
|
hasChildSelected,
|
|
804
809
|
isSectionBlock,
|
|
810
|
+
isWithinSectionBlock,
|
|
805
811
|
isEditingDisabled,
|
|
806
812
|
hasEditableOutline,
|
|
807
813
|
isEditingContentOnlySection,
|
|
@@ -222,6 +222,11 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
222
222
|
cursor: grab;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
+
// Dragging multi selected blocks is not supported yet.
|
|
226
|
+
&.is-multi-selected {
|
|
227
|
+
cursor: default;
|
|
228
|
+
}
|
|
229
|
+
|
|
225
230
|
&[contenteditable],
|
|
226
231
|
[contenteditable] {
|
|
227
232
|
cursor: text;
|
|
@@ -226,6 +226,8 @@ function Items( {
|
|
|
226
226
|
rootClientId === selectedBlockClientId
|
|
227
227
|
);
|
|
228
228
|
|
|
229
|
+
const templateLock = getTemplateLock( rootClientId );
|
|
230
|
+
|
|
229
231
|
return {
|
|
230
232
|
order: _order,
|
|
231
233
|
selectedBlocks: selectedBlockClientIds,
|
|
@@ -238,7 +240,7 @@ function Items( {
|
|
|
238
240
|
rootClientId
|
|
239
241
|
) ) &&
|
|
240
242
|
getBlockEditingMode( rootClientId ) !== 'disabled' &&
|
|
241
|
-
!
|
|
243
|
+
( ! templateLock || templateLock === 'contentOnly' ) &&
|
|
242
244
|
hasAppender &&
|
|
243
245
|
! _isZoomOut() &&
|
|
244
246
|
( hasCustomAppender ||
|
|
@@ -100,6 +100,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
100
100
|
isEditingContentOnlySection,
|
|
101
101
|
defaultClassName,
|
|
102
102
|
isSectionBlock,
|
|
103
|
+
isWithinSectionBlock,
|
|
103
104
|
canMove,
|
|
104
105
|
isBlockHidden,
|
|
105
106
|
} = useContext( PrivateBlockContext );
|
|
@@ -108,13 +109,14 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
|
|
|
108
109
|
const blockLabel = sprintf( __( 'Block: %s' ), blockTitle );
|
|
109
110
|
const htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';
|
|
110
111
|
const ffDragRef = useFirefoxDraggableCompatibility();
|
|
112
|
+
const isHoverEnabled = ! isWithinSectionBlock;
|
|
111
113
|
const mergedRefs = useMergeRefs( [
|
|
112
114
|
props.ref,
|
|
113
115
|
useFocusFirstElement( { clientId, initialPosition } ),
|
|
114
116
|
useBlockRefProvider( clientId ),
|
|
115
117
|
useFocusHandler( clientId ),
|
|
116
118
|
useEventHandlers( { clientId, isSelected } ),
|
|
117
|
-
useIsHovered(),
|
|
119
|
+
useIsHovered( { isEnabled: isHoverEnabled } ),
|
|
118
120
|
useIntersectionObserver(),
|
|
119
121
|
useMovingAnimation( { triggerAnimationOnChange: index, clientId } ),
|
|
120
122
|
useDisabled( { isDisabled: ! hasOverlay } ),
|