@wordpress/block-editor 15.18.1-next.v.202604201441.0 → 15.19.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 +7 -1
- package/build/components/autocomplete/index.cjs.map +3 -3
- package/build/components/background-image-control/index.cjs +2 -1
- package/build/components/background-image-control/index.cjs.map +2 -2
- package/build/components/block-allowed-blocks/modal.cjs.map +2 -2
- package/build/components/block-bindings/attribute-control.cjs.map +3 -3
- package/build/components/block-card/index.cjs +2 -2
- package/build/components/block-card/index.cjs.map +3 -3
- package/build/components/block-controls/fill.cjs.map +2 -2
- package/build/components/block-inspector/edit-contents.cjs +7 -1
- package/build/components/block-inspector/edit-contents.cjs.map +2 -2
- package/build/components/block-mover/button.cjs +9 -3
- package/build/components/block-mover/button.cjs.map +2 -2
- package/build/components/block-pattern-setup/index.cjs +3 -2
- package/build/components/block-pattern-setup/index.cjs.map +2 -2
- package/build/components/block-patterns-list/index.cjs +2 -1
- package/build/components/block-patterns-list/index.cjs.map +2 -2
- package/build/components/block-patterns-paging/index.cjs.map +3 -3
- package/build/components/block-settings-menu/block-settings-dropdown.cjs +2 -2
- package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +3 -3
- package/build/components/block-settings-menu/index.cjs +2 -2
- package/build/components/block-settings-menu/index.cjs.map +3 -3
- package/build/components/block-styles/menu-items.cjs.map +3 -3
- package/build/components/block-switcher/index.cjs.map +3 -3
- package/build/components/block-switcher/pattern-transformations-menu.cjs +2 -1
- package/build/components/block-switcher/pattern-transformations-menu.cjs.map +2 -2
- package/build/components/block-toolbar/edit-section-button.cjs +7 -1
- package/build/components/block-toolbar/edit-section-button.cjs.map +2 -2
- package/build/components/block-toolbar/pattern-overrides-dropdown.cjs.map +3 -3
- package/build/components/block-variation-transforms/index.cjs +4 -3
- package/build/components/block-variation-transforms/index.cjs.map +2 -2
- package/build/components/block-visibility/modal.cjs +0 -10
- package/build/components/block-visibility/modal.cjs.map +3 -3
- package/build/components/block-visibility/viewport-visibility-info.cjs +2 -2
- package/build/components/block-visibility/viewport-visibility-info.cjs.map +3 -3
- package/build/components/collab/{block-comment-icon-slot.cjs → note-icon-slot.cjs} +8 -8
- package/build/components/collab/note-icon-slot.cjs.map +7 -0
- package/build/components/collab/{block-comment-icon-toolbar-slot.cjs → note-icon-toolbar-slot.cjs} +9 -9
- package/build/components/collab/note-icon-toolbar-slot.cjs.map +7 -0
- package/build/components/date-format-picker/index.cjs +2 -1
- package/build/components/date-format-picker/index.cjs.map +2 -2
- package/build/components/dimensions-tool/scale-tool.cjs +2 -2
- package/build/components/dimensions-tool/scale-tool.cjs.map +2 -2
- package/build/components/global-styles/state-control.cjs +111 -37
- package/build/components/global-styles/state-control.cjs.map +3 -3
- package/build/components/gradients/use-gradient.cjs +2 -2
- package/build/components/gradients/use-gradient.cjs.map +2 -2
- package/build/components/grid/grid-item-movers.cjs +2 -1
- package/build/components/grid/grid-item-movers.cjs.map +2 -2
- package/build/components/iframe/use-scale-canvas.cjs.map +2 -2
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.cjs.map +2 -2
- package/build/components/inserter/index.cjs +41 -43
- package/build/components/inserter/index.cjs.map +2 -2
- package/build/components/inserter/menu.cjs +32 -3
- package/build/components/inserter/menu.cjs.map +3 -3
- package/build/components/inserter/search-results.cjs +3 -3
- package/build/components/inserter/search-results.cjs.map +2 -2
- package/build/components/inserter/tips.cjs +1 -1
- package/build/components/inserter/tips.cjs.map +2 -2
- package/build/components/inspector-popover-header/index.cjs.map +3 -3
- package/build/components/link-control/link-preview.cjs +2 -2
- package/build/components/link-control/link-preview.cjs.map +2 -2
- package/build/components/link-control/settings.cjs +2 -1
- package/build/components/link-control/settings.cjs.map +2 -2
- package/build/components/link-picker/link-picker.cjs +3 -2
- package/build/components/link-picker/link-picker.cjs.map +2 -2
- package/build/components/link-picker/link-preview.cjs +2 -2
- package/build/components/link-picker/link-preview.cjs.map +2 -2
- package/build/components/list-view/block-select-button.cjs +2 -2
- package/build/components/list-view/block-select-button.cjs.map +2 -2
- package/build/components/list-view/index.cjs +2 -1
- package/build/components/list-view/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +80 -7
- package/build/components/provider/index.cjs.map +2 -2
- package/build/components/responsive-block-control/label.cjs +9 -2
- package/build/components/responsive-block-control/label.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/index.cjs.map +2 -2
- package/build/components/rich-text/event-listeners/paste-handler.cjs +12 -5
- package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
- package/build/hooks/block-bindings.cjs.map +3 -3
- package/build/hooks/custom-css.cjs +1 -1
- package/build/hooks/custom-css.cjs.map +2 -2
- package/build/layouts/flex.cjs +5 -8
- package/build/layouts/flex.cjs.map +3 -3
- package/build/layouts/grid.cjs +5 -5
- package/build/layouts/grid.cjs.map +2 -2
- package/build/private-apis.cjs +5 -4
- package/build/private-apis.cjs.map +3 -3
- package/build/store/actions.cjs +2 -2
- package/build/store/actions.cjs.map +2 -2
- package/build/store/private-keys.cjs +3 -0
- package/build/store/private-keys.cjs.map +2 -2
- package/build/store/reducer.cjs +8 -30
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/dom.cjs +3 -1
- package/build/utils/dom.cjs.map +2 -2
- package/build-module/components/autocomplete/index.mjs +2 -2
- package/build-module/components/autocomplete/index.mjs.map +2 -2
- package/build-module/components/background-image-control/index.mjs +2 -2
- package/build-module/components/background-image-control/index.mjs.map +2 -2
- package/build-module/components/block-allowed-blocks/modal.mjs +2 -2
- package/build-module/components/block-allowed-blocks/modal.mjs.map +2 -2
- package/build-module/components/block-bindings/attribute-control.mjs +3 -3
- package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
- package/build-module/components/block-card/index.mjs +4 -4
- package/build-module/components/block-card/index.mjs.map +2 -2
- package/build-module/components/block-controls/fill.mjs.map +2 -2
- package/build-module/components/block-inspector/edit-contents.mjs +7 -1
- package/build-module/components/block-inspector/edit-contents.mjs.map +2 -2
- package/build-module/components/block-mover/button.mjs +11 -5
- package/build-module/components/block-mover/button.mjs.map +2 -2
- package/build-module/components/block-pattern-setup/index.mjs +2 -1
- package/build-module/components/block-pattern-setup/index.mjs.map +2 -2
- package/build-module/components/block-patterns-list/index.mjs +1 -1
- package/build-module/components/block-patterns-list/index.mjs.map +2 -2
- package/build-module/components/block-patterns-paging/index.mjs +3 -3
- package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +2 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
- package/build-module/components/block-settings-menu/index.mjs +2 -2
- package/build-module/components/block-settings-menu/index.mjs.map +2 -2
- package/build-module/components/block-styles/menu-items.mjs +2 -2
- package/build-module/components/block-styles/menu-items.mjs.map +2 -2
- package/build-module/components/block-switcher/index.mjs +2 -2
- package/build-module/components/block-switcher/index.mjs.map +2 -2
- package/build-module/components/block-switcher/pattern-transformations-menu.mjs +2 -7
- package/build-module/components/block-switcher/pattern-transformations-menu.mjs.map +2 -2
- package/build-module/components/block-toolbar/edit-section-button.mjs +7 -1
- package/build-module/components/block-toolbar/edit-section-button.mjs.map +2 -2
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs +2 -2
- package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs.map +2 -2
- package/build-module/components/block-variation-transforms/index.mjs +4 -4
- package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
- package/build-module/components/block-visibility/modal.mjs +0 -10
- package/build-module/components/block-visibility/modal.mjs.map +3 -3
- package/build-module/components/block-visibility/viewport-visibility-info.mjs +4 -4
- package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
- package/build-module/components/collab/note-icon-slot.mjs +8 -0
- package/build-module/components/collab/note-icon-slot.mjs.map +7 -0
- package/build-module/components/collab/note-icon-toolbar-slot.mjs +10 -0
- package/build-module/components/collab/note-icon-toolbar-slot.mjs.map +7 -0
- package/build-module/components/date-format-picker/index.mjs +2 -2
- package/build-module/components/date-format-picker/index.mjs.map +2 -2
- package/build-module/components/dimensions-tool/scale-tool.mjs +2 -2
- package/build-module/components/dimensions-tool/scale-tool.mjs.map +2 -2
- package/build-module/components/global-styles/state-control.mjs +119 -40
- package/build-module/components/global-styles/state-control.mjs.map +2 -2
- package/build-module/components/gradients/use-gradient.mjs +2 -2
- package/build-module/components/gradients/use-gradient.mjs.map +2 -2
- package/build-module/components/grid/grid-item-movers.mjs +2 -5
- package/build-module/components/grid/grid-item-movers.mjs.map +2 -2
- package/build-module/components/iframe/use-scale-canvas.mjs.map +2 -2
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs +3 -3
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs.map +1 -1
- package/build-module/components/inserter/index.mjs +41 -43
- package/build-module/components/inserter/index.mjs.map +2 -2
- package/build-module/components/inserter/menu.mjs +34 -4
- package/build-module/components/inserter/menu.mjs.map +2 -2
- package/build-module/components/inserter/search-results.mjs +1 -1
- package/build-module/components/inserter/search-results.mjs.map +1 -1
- package/build-module/components/inserter/tips.mjs +1 -1
- package/build-module/components/inserter/tips.mjs.map +2 -2
- package/build-module/components/inspector-popover-header/index.mjs +2 -2
- package/build-module/components/inspector-popover-header/index.mjs.map +2 -2
- package/build-module/components/link-control/link-preview.mjs +2 -2
- package/build-module/components/link-control/link-preview.mjs.map +2 -2
- package/build-module/components/link-control/settings.mjs +3 -2
- package/build-module/components/link-control/settings.mjs.map +2 -2
- package/build-module/components/link-picker/link-picker.mjs +1 -1
- package/build-module/components/link-picker/link-picker.mjs.map +2 -2
- package/build-module/components/link-picker/link-preview.mjs +2 -2
- package/build-module/components/link-picker/link-preview.mjs.map +2 -2
- package/build-module/components/list-view/block-select-button.mjs +2 -2
- package/build-module/components/list-view/block-select-button.mjs.map +2 -2
- package/build-module/components/list-view/index.mjs +2 -4
- package/build-module/components/list-view/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +82 -8
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/responsive-block-control/label.mjs +9 -2
- package/build-module/components/responsive-block-control/label.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/index.mjs.map +2 -2
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs +12 -5
- package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
- package/build-module/hooks/block-bindings.mjs +2 -2
- package/build-module/hooks/block-bindings.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/layouts/flex.mjs +4 -7
- package/build-module/layouts/flex.mjs.map +2 -2
- package/build-module/layouts/grid.mjs +4 -4
- package/build-module/layouts/grid.mjs.map +2 -2
- package/build-module/private-apis.mjs +7 -5
- package/build-module/private-apis.mjs.map +2 -2
- package/build-module/store/actions.mjs +2 -2
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/private-keys.mjs +2 -0
- package/build-module/store/private-keys.mjs.map +2 -2
- package/build-module/store/reducer.mjs +8 -30
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/dom.mjs +2 -1
- package/build-module/utils/dom.mjs.map +2 -2
- package/build-style/content-rtl.css +0 -3
- package/build-style/content.css +0 -3
- package/build-style/style-rtl.css +29 -3
- package/build-style/style.css +29 -3
- package/build-types/components/block-context/index.d.ts +9 -16
- package/build-types/components/block-context/index.d.ts.map +1 -1
- package/build-types/utils/dom.d.ts +13 -6
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +39 -38
- package/src/components/autocomplete/index.js +4 -2
- package/src/components/background-image-control/index.js +2 -2
- package/src/components/block-allowed-blocks/modal.js +3 -3
- package/src/components/block-bindings/attribute-control.js +4 -4
- package/src/components/block-card/index.js +5 -5
- package/src/components/block-controls/fill.js +1 -0
- package/src/components/block-inspector/edit-contents.js +4 -2
- package/src/components/block-list/content.scss +0 -4
- package/src/components/block-manager/style.scss +3 -2
- package/src/components/block-mover/button.js +17 -7
- package/src/components/block-pattern-setup/index.js +2 -1
- package/src/components/block-patterns-list/index.js +1 -1
- package/src/components/block-patterns-paging/index.js +5 -6
- package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
- package/src/components/block-settings-menu/index.js +2 -2
- package/src/components/block-styles/menu-items.js +3 -3
- package/src/components/block-switcher/index.js +3 -3
- package/src/components/block-switcher/pattern-transformations-menu.js +2 -7
- package/src/components/block-toolbar/edit-section-button.js +5 -1
- package/src/components/block-toolbar/pattern-overrides-dropdown.js +2 -2
- package/src/components/block-variation-transforms/index.js +4 -4
- package/src/components/block-visibility/modal.js +0 -1
- package/src/components/block-visibility/viewport-visibility-info.js +5 -5
- package/src/components/collab/note-icon-slot.js +8 -0
- package/src/components/collab/note-icon-toolbar-slot.js +10 -0
- package/src/components/date-format-picker/index.js +4 -2
- package/src/components/dimensions-tool/scale-tool.js +2 -2
- package/src/components/global-styles/state-control.js +152 -49
- package/src/components/global-styles/style.scss +9 -0
- package/src/components/gradients/use-gradient.js +3 -1
- package/src/components/grid/grid-item-movers.js +2 -5
- package/src/components/iframe/use-scale-canvas.js +0 -4
- package/src/components/inner-blocks/README.md +5 -1
- package/src/components/inner-blocks/index.native.js +1 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -5
- package/src/components/inserter/index.js +58 -69
- package/src/components/inserter/menu.js +35 -3
- package/src/components/inserter/search-results.js +1 -1
- package/src/components/inserter/style.scss +18 -3
- package/src/components/inserter/tips.js +1 -1
- package/src/components/inspector-popover-header/index.js +2 -2
- package/src/components/link-control/link-preview.js +3 -3
- package/src/components/link-control/settings.js +3 -2
- package/src/components/link-picker/link-picker.js +1 -1
- package/src/components/link-picker/link-preview.js +3 -3
- package/src/components/list-view/block-select-button.js +3 -3
- package/src/components/list-view/index.js +2 -4
- package/src/components/provider/index.js +149 -8
- package/src/components/responsive-block-control/label.js +5 -2
- package/src/components/rich-text/event-listeners/index.js +0 -1
- package/src/components/rich-text/event-listeners/paste-handler.js +18 -4
- package/src/hooks/block-bindings.js +3 -3
- package/src/hooks/custom-css.js +1 -8
- package/src/layouts/flex.js +7 -9
- package/src/layouts/grid.js +7 -4
- package/src/private-apis.js +6 -4
- package/src/store/actions.js +12 -6
- package/src/store/private-keys.js +1 -0
- package/src/store/reducer.js +11 -39
- package/src/store/selectors.js +6 -0
- package/src/store/test/reducer.js +39 -0
- package/src/utils/dom.js +3 -3
- package/src/utils/test/dom.js +47 -4
- package/build/components/collab/block-comment-icon-slot.cjs.map +0 -7
- package/build/components/collab/block-comment-icon-toolbar-slot.cjs.map +0 -7
- package/build-module/components/collab/block-comment-icon-slot.mjs +0 -8
- package/build-module/components/collab/block-comment-icon-slot.mjs.map +0 -7
- package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs +0 -10
- package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs.map +0 -7
- package/src/components/collab/block-comment-icon-slot.js +0 -8
- package/src/components/collab/block-comment-icon-toolbar-slot.js +0 -10
|
@@ -40,7 +40,7 @@ function isElementVisible(element) {
|
|
|
40
40
|
if (!viewport) {
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
43
|
-
if (element.
|
|
43
|
+
if (element.hasAttribute("data-visually-hidden")) {
|
|
44
44
|
return false;
|
|
45
45
|
}
|
|
46
46
|
const bounds = element.getBoundingClientRect();
|
|
@@ -101,6 +101,7 @@ export {
|
|
|
101
101
|
WITH_OVERFLOW_ELEMENT_BLOCKS,
|
|
102
102
|
getBlockClientId,
|
|
103
103
|
getElementBounds,
|
|
104
|
+
isElementVisible,
|
|
104
105
|
isInSameBlock,
|
|
105
106
|
isInsideRootBlock,
|
|
106
107
|
rectUnion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/dom.js"],
|
|
4
|
-
"sourcesContent": ["const BLOCK_SELECTOR = '.block-editor-block-list__block';\nconst APPENDER_SELECTOR = '.block-list-appender';\nconst BLOCK_APPENDER_CLASS = '.block-editor-button-block-appender';\n\n/**\n * Returns true if two elements are contained within the same block.\n *\n * @param {Element} a First element.\n * @param {Element} b Second element.\n *\n * @return {boolean} Whether elements are in the same block.\n */\nexport function isInSameBlock( a, b ) {\n\treturn a.closest( BLOCK_SELECTOR ) === b.closest( BLOCK_SELECTOR );\n}\n\n/**\n * Returns true if an element is considered part of the block and not its inner\n * blocks or appender.\n *\n * @param {Element} blockElement Block container element.\n * @param {Element} element Element.\n *\n * @return {boolean} Whether an element is considered part of the block and not\n * its inner blocks or appender.\n */\nexport function isInsideRootBlock( blockElement, element ) {\n\tconst parentBlock = element.closest(\n\t\t[ BLOCK_SELECTOR, APPENDER_SELECTOR, BLOCK_APPENDER_CLASS ].join( ',' )\n\t);\n\treturn parentBlock === blockElement;\n}\n\n/**\n * Finds the block client ID given any DOM node inside the block.\n *\n * @param {Node?} node DOM node.\n *\n * @return {string|undefined} Client ID or undefined if the node is not part of\n * a block.\n */\nexport function getBlockClientId( node ) {\n\twhile ( node && node.nodeType !== node.ELEMENT_NODE ) {\n\t\tnode = node.parentNode;\n\t}\n\n\tif ( ! node ) {\n\t\treturn;\n\t}\n\n\tconst elementNode = /** @type {Element} */ ( node );\n\tconst blockNode = elementNode.closest( BLOCK_SELECTOR );\n\n\tif ( ! blockNode ) {\n\t\treturn;\n\t}\n\n\treturn blockNode.id.slice( 'block-'.length );\n}\n\n/**\n * Calculates the union of two rectangles.\n *\n * @param {DOMRect} rect1 First rectangle.\n * @param {DOMRect} rect2 Second rectangle.\n * @return {DOMRect} Union of the two rectangles.\n */\nexport function rectUnion( rect1, rect2 ) {\n\tconst left = Math.min( rect1.left, rect2.left );\n\tconst right = Math.max( rect1.right, rect2.right );\n\tconst bottom = Math.max( rect1.bottom, rect2.bottom );\n\tconst top = Math.min( rect1.top, rect2.top );\n\n\treturn new window.DOMRectReadOnly( left, top, right - left, bottom - top );\n}\n\n/**\n * Returns whether an element is visible.\n *\n * @param {Element} element Element.\n * @return {boolean} Whether the element is visible.\n */\
|
|
5
|
-
"mappings": ";AAAA,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAUtB,SAAS,cAAe,GAAG,GAAI;AACrC,SAAO,EAAE,QAAS,cAAe,MAAM,EAAE,QAAS,cAAe;AAClE;AAYO,SAAS,kBAAmB,cAAc,SAAU;AAC1D,QAAM,cAAc,QAAQ;AAAA,IAC3B,CAAE,gBAAgB,mBAAmB,oBAAqB,EAAE,KAAM,GAAI;AAAA,EACvE;AACA,SAAO,gBAAgB;AACxB;AAUO,SAAS,iBAAkB,MAAO;AACxC,SAAQ,QAAQ,KAAK,aAAa,KAAK,cAAe;AACrD,WAAO,KAAK;AAAA,EACb;AAEA,MAAK,CAAE,MAAO;AACb;AAAA,EACD;AAEA,QAAM;AAAA;AAAA,IAAuC;AAAA;AAC7C,QAAM,YAAY,YAAY,QAAS,cAAe;AAEtD,MAAK,CAAE,WAAY;AAClB;AAAA,EACD;AAEA,SAAO,UAAU,GAAG,MAAO,SAAS,MAAO;AAC5C;AASO,SAAS,UAAW,OAAO,OAAQ;AACzC,QAAM,OAAO,KAAK,IAAK,MAAM,MAAM,MAAM,IAAK;AAC9C,QAAM,QAAQ,KAAK,IAAK,MAAM,OAAO,MAAM,KAAM;AACjD,QAAM,SAAS,KAAK,IAAK,MAAM,QAAQ,MAAM,MAAO;AACpD,QAAM,MAAM,KAAK,IAAK,MAAM,KAAK,MAAM,GAAI;AAE3C,SAAO,IAAI,OAAO,gBAAiB,MAAM,KAAK,QAAQ,MAAM,SAAS,GAAI;AAC1E;
|
|
4
|
+
"sourcesContent": ["const BLOCK_SELECTOR = '.block-editor-block-list__block';\nconst APPENDER_SELECTOR = '.block-list-appender';\nconst BLOCK_APPENDER_CLASS = '.block-editor-button-block-appender';\n\n/**\n * Returns true if two elements are contained within the same block.\n *\n * @param {Element} a First element.\n * @param {Element} b Second element.\n *\n * @return {boolean} Whether elements are in the same block.\n */\nexport function isInSameBlock( a, b ) {\n\treturn a.closest( BLOCK_SELECTOR ) === b.closest( BLOCK_SELECTOR );\n}\n\n/**\n * Returns true if an element is considered part of the block and not its inner\n * blocks or appender.\n *\n * @param {Element} blockElement Block container element.\n * @param {Element} element Element.\n *\n * @return {boolean} Whether an element is considered part of the block and not\n * its inner blocks or appender.\n */\nexport function isInsideRootBlock( blockElement, element ) {\n\tconst parentBlock = element.closest(\n\t\t[ BLOCK_SELECTOR, APPENDER_SELECTOR, BLOCK_APPENDER_CLASS ].join( ',' )\n\t);\n\treturn parentBlock === blockElement;\n}\n\n/**\n * Finds the block client ID given any DOM node inside the block.\n *\n * @param {Node?} node DOM node.\n *\n * @return {string|undefined} Client ID or undefined if the node is not part of\n * a block.\n */\nexport function getBlockClientId( node ) {\n\twhile ( node && node.nodeType !== node.ELEMENT_NODE ) {\n\t\tnode = node.parentNode;\n\t}\n\n\tif ( ! node ) {\n\t\treturn;\n\t}\n\n\tconst elementNode = /** @type {Element} */ ( node );\n\tconst blockNode = elementNode.closest( BLOCK_SELECTOR );\n\n\tif ( ! blockNode ) {\n\t\treturn;\n\t}\n\n\treturn blockNode.id.slice( 'block-'.length );\n}\n\n/**\n * Calculates the union of two rectangles.\n *\n * @param {DOMRect} rect1 First rectangle.\n * @param {DOMRect} rect2 Second rectangle.\n * @return {DOMRect} Union of the two rectangles.\n */\nexport function rectUnion( rect1, rect2 ) {\n\tconst left = Math.min( rect1.left, rect2.left );\n\tconst right = Math.max( rect1.right, rect2.right );\n\tconst bottom = Math.max( rect1.bottom, rect2.bottom );\n\tconst top = Math.min( rect1.top, rect2.top );\n\n\treturn new window.DOMRectReadOnly( left, top, right - left, bottom - top );\n}\n\n/**\n * Returns whether an element is visible.\n *\n * @param {Element} element Element.\n * @return {boolean} Whether the element is visible.\n */\nexport function isElementVisible( element ) {\n\tconst viewport = element.ownerDocument.defaultView;\n\tif ( ! viewport ) {\n\t\treturn false;\n\t}\n\n\t// Check for <VisuallyHidden> components.\n\tif ( element.hasAttribute( 'data-visually-hidden' ) ) {\n\t\treturn false;\n\t}\n\n\tconst bounds = element.getBoundingClientRect();\n\tif ( bounds.width === 0 || bounds.height === 0 ) {\n\t\treturn false;\n\t}\n\n\t// Older browsers, e.g. Safari < 17.4 may not support the `checkVisibility` method.\n\tif ( element.checkVisibility ) {\n\t\treturn element.checkVisibility?.( {\n\t\t\topacityProperty: true,\n\t\t\tcontentVisibilityAuto: true,\n\t\t\tvisibilityProperty: true,\n\t\t} );\n\t}\n\n\tconst style = viewport.getComputedStyle( element );\n\n\tif (\n\t\tstyle.display === 'none' ||\n\t\tstyle.visibility === 'hidden' ||\n\t\tstyle.opacity === '0'\n\t) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * Checks if the element is scrollable.\n *\n * @param {Element} element Element.\n * @return {boolean} True if the element is scrollable.\n */\nfunction isScrollable( element ) {\n\tconst style = window.getComputedStyle( element );\n\treturn (\n\t\tstyle.overflowX === 'auto' ||\n\t\tstyle.overflowX === 'scroll' ||\n\t\tstyle.overflowY === 'auto' ||\n\t\tstyle.overflowY === 'scroll'\n\t);\n}\n\nexport const WITH_OVERFLOW_ELEMENT_BLOCKS = [ 'core/navigation' ];\n/**\n * Returns the bounding rectangle of an element, with special handling for blocks\n * that have visible overflowing children (defined in WITH_OVERFLOW_ELEMENT_BLOCKS).\n *\n * For blocks like Navigation that can have overflowing elements (e.g. submenus),\n * this function calculates the combined bounds of both the parent and its visible\n * children. The returned rect may extend beyond the viewport.\n * The returned rect represents the full extent of the element and its visible\n * children, which may extend beyond the viewport.\n *\n * @param {Element} element Element.\n * @return {DOMRect} Bounding client rect of the element and its visible children.\n */\nexport function getElementBounds( element ) {\n\tconst viewport = element.ownerDocument.defaultView;\n\n\tif ( ! viewport ) {\n\t\treturn new window.DOMRectReadOnly();\n\t}\n\n\tlet bounds = element.getBoundingClientRect();\n\tconst dataType = element.getAttribute( 'data-type' );\n\n\t/*\n\t * For blocks with overflowing elements (like Navigation), include the bounds\n\t * of visible children that extend beyond the parent container.\n\t */\n\tif ( dataType && WITH_OVERFLOW_ELEMENT_BLOCKS.includes( dataType ) ) {\n\t\tconst stack = [ element ];\n\t\tlet currentElement;\n\n\t\twhile ( ( currentElement = stack.pop() ) ) {\n\t\t\t// Children won\u2019t affect bounds unless the element is not scrollable.\n\t\t\tif ( ! isScrollable( currentElement ) ) {\n\t\t\t\tfor ( const child of currentElement.children ) {\n\t\t\t\t\tif ( isElementVisible( child ) ) {\n\t\t\t\t\t\tconst childBounds = child.getBoundingClientRect();\n\t\t\t\t\t\tbounds = rectUnion( bounds, childBounds );\n\t\t\t\t\t\tstack.push( child );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/*\n\t * Take into account the outer horizontal limits of the container in which\n\t * an element is supposed to be \"visible\". For example, if an element is\n\t * positioned -10px to the left of the window x value (0), this function\n\t * discounts the negative overhang because it's not visible and therefore\n\t * not to be counted in the visibility calculations. Top and bottom values\n\t * are not accounted for to accommodate vertical scroll.\n\t */\n\tconst left = Math.max( bounds.left, 0 );\n\tconst right = Math.min( bounds.right, viewport.innerWidth );\n\tbounds = new window.DOMRectReadOnly(\n\t\tleft,\n\t\tbounds.top,\n\t\tright - left,\n\t\tbounds.height\n\t);\n\n\treturn bounds;\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAUtB,SAAS,cAAe,GAAG,GAAI;AACrC,SAAO,EAAE,QAAS,cAAe,MAAM,EAAE,QAAS,cAAe;AAClE;AAYO,SAAS,kBAAmB,cAAc,SAAU;AAC1D,QAAM,cAAc,QAAQ;AAAA,IAC3B,CAAE,gBAAgB,mBAAmB,oBAAqB,EAAE,KAAM,GAAI;AAAA,EACvE;AACA,SAAO,gBAAgB;AACxB;AAUO,SAAS,iBAAkB,MAAO;AACxC,SAAQ,QAAQ,KAAK,aAAa,KAAK,cAAe;AACrD,WAAO,KAAK;AAAA,EACb;AAEA,MAAK,CAAE,MAAO;AACb;AAAA,EACD;AAEA,QAAM;AAAA;AAAA,IAAuC;AAAA;AAC7C,QAAM,YAAY,YAAY,QAAS,cAAe;AAEtD,MAAK,CAAE,WAAY;AAClB;AAAA,EACD;AAEA,SAAO,UAAU,GAAG,MAAO,SAAS,MAAO;AAC5C;AASO,SAAS,UAAW,OAAO,OAAQ;AACzC,QAAM,OAAO,KAAK,IAAK,MAAM,MAAM,MAAM,IAAK;AAC9C,QAAM,QAAQ,KAAK,IAAK,MAAM,OAAO,MAAM,KAAM;AACjD,QAAM,SAAS,KAAK,IAAK,MAAM,QAAQ,MAAM,MAAO;AACpD,QAAM,MAAM,KAAK,IAAK,MAAM,KAAK,MAAM,GAAI;AAE3C,SAAO,IAAI,OAAO,gBAAiB,MAAM,KAAK,QAAQ,MAAM,SAAS,GAAI;AAC1E;AAQO,SAAS,iBAAkB,SAAU;AAC3C,QAAM,WAAW,QAAQ,cAAc;AACvC,MAAK,CAAE,UAAW;AACjB,WAAO;AAAA,EACR;AAGA,MAAK,QAAQ,aAAc,sBAAuB,GAAI;AACrD,WAAO;AAAA,EACR;AAEA,QAAM,SAAS,QAAQ,sBAAsB;AAC7C,MAAK,OAAO,UAAU,KAAK,OAAO,WAAW,GAAI;AAChD,WAAO;AAAA,EACR;AAGA,MAAK,QAAQ,iBAAkB;AAC9B,WAAO,QAAQ,kBAAmB;AAAA,MACjC,iBAAiB;AAAA,MACjB,uBAAuB;AAAA,MACvB,oBAAoB;AAAA,IACrB,CAAE;AAAA,EACH;AAEA,QAAM,QAAQ,SAAS,iBAAkB,OAAQ;AAEjD,MACC,MAAM,YAAY,UAClB,MAAM,eAAe,YACrB,MAAM,YAAY,KACjB;AACD,WAAO;AAAA,EACR;AAEA,SAAO;AACR;AAQA,SAAS,aAAc,SAAU;AAChC,QAAM,QAAQ,OAAO,iBAAkB,OAAQ;AAC/C,SACC,MAAM,cAAc,UACpB,MAAM,cAAc,YACpB,MAAM,cAAc,UACpB,MAAM,cAAc;AAEtB;AAEO,IAAM,+BAA+B,CAAE,iBAAkB;AAczD,SAAS,iBAAkB,SAAU;AAC3C,QAAM,WAAW,QAAQ,cAAc;AAEvC,MAAK,CAAE,UAAW;AACjB,WAAO,IAAI,OAAO,gBAAgB;AAAA,EACnC;AAEA,MAAI,SAAS,QAAQ,sBAAsB;AAC3C,QAAM,WAAW,QAAQ,aAAc,WAAY;AAMnD,MAAK,YAAY,6BAA6B,SAAU,QAAS,GAAI;AACpE,UAAM,QAAQ,CAAE,OAAQ;AACxB,QAAI;AAEJ,WAAU,iBAAiB,MAAM,IAAI,GAAM;AAE1C,UAAK,CAAE,aAAc,cAAe,GAAI;AACvC,mBAAY,SAAS,eAAe,UAAW;AAC9C,cAAK,iBAAkB,KAAM,GAAI;AAChC,kBAAM,cAAc,MAAM,sBAAsB;AAChD,qBAAS,UAAW,QAAQ,WAAY;AACxC,kBAAM,KAAM,KAAM;AAAA,UACnB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAUA,QAAM,OAAO,KAAK,IAAK,OAAO,MAAM,CAAE;AACtC,QAAM,QAAQ,KAAK,IAAK,OAAO,OAAO,SAAS,UAAW;AAC1D,WAAS,IAAI,OAAO;AAAA,IACnB;AAAA,IACA,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,EACR;AAEA,SAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -236,9 +236,6 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
236
236
|
.block-editor-block-list__layout .block-editor-block-list__block.has-negative-margin.is-selected, .block-editor-block-list__layout .block-editor-block-list__block.has-negative-margin.has-child-selected {
|
|
237
237
|
z-index: 20;
|
|
238
238
|
}
|
|
239
|
-
.block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel * {
|
|
240
|
-
z-index: 1;
|
|
241
|
-
}
|
|
242
239
|
.block-editor-block-list__layout .block-editor-block-list__block {
|
|
243
240
|
/**
|
|
244
241
|
* Notices
|
package/build-style/content.css
CHANGED
|
@@ -236,9 +236,6 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection=true] .blo
|
|
|
236
236
|
.block-editor-block-list__layout .block-editor-block-list__block.has-negative-margin.is-selected, .block-editor-block-list__layout .block-editor-block-list__block.has-negative-margin.has-child-selected {
|
|
237
237
|
z-index: 20;
|
|
238
238
|
}
|
|
239
|
-
.block-editor-block-list__layout .block-editor-block-list__block .reusable-block-edit-panel * {
|
|
240
|
-
z-index: 1;
|
|
241
|
-
}
|
|
242
239
|
.block-editor-block-list__layout .block-editor-block-list__block {
|
|
243
240
|
/**
|
|
244
241
|
* Notices
|
|
@@ -832,6 +832,7 @@ iframe[name=editor-canvas] {
|
|
|
832
832
|
}
|
|
833
833
|
|
|
834
834
|
.block-editor-block-manager__category {
|
|
835
|
+
isolation: isolate;
|
|
835
836
|
margin: 0 0 24px 0;
|
|
836
837
|
}
|
|
837
838
|
|
|
@@ -1639,6 +1640,14 @@ iframe[name=editor-canvas] {
|
|
|
1639
1640
|
text-align: left;
|
|
1640
1641
|
}
|
|
1641
1642
|
|
|
1643
|
+
.block-editor-global-styles-state-control {
|
|
1644
|
+
margin-top: -4px;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
.block-editor-global-styles-state-control__badges {
|
|
1648
|
+
min-height: 24px;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1642
1651
|
.block-editor-global-styles-filters-panel__dropdown,
|
|
1643
1652
|
.block-editor-global-styles__shadow-dropdown {
|
|
1644
1653
|
display: block;
|
|
@@ -4041,7 +4050,20 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
4041
4050
|
}
|
|
4042
4051
|
|
|
4043
4052
|
.block-editor-inserter__search {
|
|
4044
|
-
padding: 16px
|
|
4053
|
+
padding: 16px;
|
|
4054
|
+
position: sticky;
|
|
4055
|
+
top: 0;
|
|
4056
|
+
z-index: 2;
|
|
4057
|
+
background-color: #fff;
|
|
4058
|
+
border-bottom: 1px solid transparent;
|
|
4059
|
+
}
|
|
4060
|
+
@media not (prefers-reduced-motion) {
|
|
4061
|
+
.block-editor-inserter__search {
|
|
4062
|
+
transition: border-bottom-color 0.1s linear;
|
|
4063
|
+
}
|
|
4064
|
+
}
|
|
4065
|
+
.block-editor-inserter__search.is-scrolled {
|
|
4066
|
+
border-bottom-color: #e0e0e0;
|
|
4045
4067
|
}
|
|
4046
4068
|
|
|
4047
4069
|
.block-editor-inserter__no-tab-container {
|
|
@@ -4054,7 +4076,7 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
4054
4076
|
position: relative;
|
|
4055
4077
|
display: inline-flex;
|
|
4056
4078
|
align-items: center;
|
|
4057
|
-
padding:
|
|
4079
|
+
padding: 0 16px;
|
|
4058
4080
|
}
|
|
4059
4081
|
|
|
4060
4082
|
.block-editor-inserter__panel-content {
|
|
@@ -4137,12 +4159,16 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
4137
4159
|
.block-editor-inserter__media-tabs-container,
|
|
4138
4160
|
.block-editor-inserter__block-patterns-tabs-container {
|
|
4139
4161
|
flex-grow: 1;
|
|
4140
|
-
padding: 16px;
|
|
4162
|
+
padding: 0 16px 16px;
|
|
4141
4163
|
display: flex;
|
|
4142
4164
|
flex-direction: column;
|
|
4143
4165
|
justify-content: space-between;
|
|
4144
4166
|
}
|
|
4145
4167
|
|
|
4168
|
+
.block-editor-inserter__media-tabs-container {
|
|
4169
|
+
padding-top: 16px;
|
|
4170
|
+
}
|
|
4171
|
+
|
|
4146
4172
|
.block-editor-inserter__category-tablist {
|
|
4147
4173
|
margin-bottom: 8px;
|
|
4148
4174
|
}
|
package/build-style/style.css
CHANGED
|
@@ -832,6 +832,7 @@ iframe[name=editor-canvas] {
|
|
|
832
832
|
}
|
|
833
833
|
|
|
834
834
|
.block-editor-block-manager__category {
|
|
835
|
+
isolation: isolate;
|
|
835
836
|
margin: 0 0 24px 0;
|
|
836
837
|
}
|
|
837
838
|
|
|
@@ -1639,6 +1640,14 @@ iframe[name=editor-canvas] {
|
|
|
1639
1640
|
text-align: right;
|
|
1640
1641
|
}
|
|
1641
1642
|
|
|
1643
|
+
.block-editor-global-styles-state-control {
|
|
1644
|
+
margin-top: -4px;
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
.block-editor-global-styles-state-control__badges {
|
|
1648
|
+
min-height: 24px;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1642
1651
|
.block-editor-global-styles-filters-panel__dropdown,
|
|
1643
1652
|
.block-editor-global-styles__shadow-dropdown {
|
|
1644
1653
|
display: block;
|
|
@@ -4043,7 +4052,20 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
4043
4052
|
}
|
|
4044
4053
|
|
|
4045
4054
|
.block-editor-inserter__search {
|
|
4046
|
-
padding: 16px
|
|
4055
|
+
padding: 16px;
|
|
4056
|
+
position: sticky;
|
|
4057
|
+
top: 0;
|
|
4058
|
+
z-index: 2;
|
|
4059
|
+
background-color: #fff;
|
|
4060
|
+
border-bottom: 1px solid transparent;
|
|
4061
|
+
}
|
|
4062
|
+
@media not (prefers-reduced-motion) {
|
|
4063
|
+
.block-editor-inserter__search {
|
|
4064
|
+
transition: border-bottom-color 0.1s linear;
|
|
4065
|
+
}
|
|
4066
|
+
}
|
|
4067
|
+
.block-editor-inserter__search.is-scrolled {
|
|
4068
|
+
border-bottom-color: #e0e0e0;
|
|
4047
4069
|
}
|
|
4048
4070
|
|
|
4049
4071
|
.block-editor-inserter__no-tab-container {
|
|
@@ -4056,7 +4078,7 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
4056
4078
|
position: relative;
|
|
4057
4079
|
display: inline-flex;
|
|
4058
4080
|
align-items: center;
|
|
4059
|
-
padding:
|
|
4081
|
+
padding: 0 16px;
|
|
4060
4082
|
}
|
|
4061
4083
|
|
|
4062
4084
|
.block-editor-inserter__panel-content {
|
|
@@ -4139,12 +4161,16 @@ div.block-editor-bindings__panel button:hover .block-editor-bindings__item span
|
|
|
4139
4161
|
.block-editor-inserter__media-tabs-container,
|
|
4140
4162
|
.block-editor-inserter__block-patterns-tabs-container {
|
|
4141
4163
|
flex-grow: 1;
|
|
4142
|
-
padding: 16px;
|
|
4164
|
+
padding: 0 16px 16px;
|
|
4143
4165
|
display: flex;
|
|
4144
4166
|
flex-direction: column;
|
|
4145
4167
|
justify-content: space-between;
|
|
4146
4168
|
}
|
|
4147
4169
|
|
|
4170
|
+
.block-editor-inserter__media-tabs-container {
|
|
4171
|
+
padding-top: 16px;
|
|
4172
|
+
}
|
|
4173
|
+
|
|
4148
4174
|
.block-editor-inserter__category-tablist {
|
|
4149
4175
|
margin-bottom: 8px;
|
|
4150
4176
|
}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component which merges passed value with current consumed block context.
|
|
3
|
-
*
|
|
4
|
-
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-context/README.md
|
|
5
|
-
*
|
|
6
|
-
* @param {BlockContextProviderProps} props
|
|
7
|
-
*/
|
|
8
|
-
export function BlockContextProvider({ value, children }: BlockContextProviderProps): import("react").JSX.Element;
|
|
9
|
-
export default Context;
|
|
10
1
|
export type ReactNode = React.ReactNode;
|
|
11
2
|
export type BlockContextProviderProps = {
|
|
12
|
-
/**
|
|
13
|
-
* Context value to merge with current
|
|
14
|
-
* value.
|
|
15
|
-
*/
|
|
16
3
|
value: Record<string, any>;
|
|
17
|
-
/**
|
|
18
|
-
* Component children.
|
|
19
|
-
*/
|
|
20
4
|
children: ReactNode;
|
|
21
5
|
};
|
|
22
6
|
/** @typedef {React.ReactNode} ReactNode */
|
|
@@ -29,4 +13,13 @@ export type BlockContextProviderProps = {
|
|
|
29
13
|
*/
|
|
30
14
|
/** @type {React.Context<Record<string,*>>} */
|
|
31
15
|
declare const Context: React.Context<Record<string, any>>;
|
|
16
|
+
/**
|
|
17
|
+
* Component which merges passed value with current consumed block context.
|
|
18
|
+
*
|
|
19
|
+
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-context/README.md
|
|
20
|
+
*
|
|
21
|
+
* @param {BlockContextProviderProps} props
|
|
22
|
+
*/
|
|
23
|
+
export declare function BlockContextProvider({ value, children }: BlockContextProviderProps): import("react").JSX.Element;
|
|
24
|
+
export default Context;
|
|
32
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/block-context/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/block-context/index.js"],"names":[],"mappings":"AAKI,YAA2B,SAAS,GAA1B,KAAK,CAAC,SAAS,CAAW;AAGrC,YAAS,yBAAyB,GAElC;IAA6B,KAAK,EAAvB,MAAM,CAAC,MAAM,EAAC,GAAC,CAAC,CAE3B;IAA6B,QAAQ,EAA1B,SAAS,CACtB;CAAA,CAAA;AARD,2CAA2C;AAE3C;;;;;;GAMG;AAEH,8CAA8C;AAC9C,QAAA,MAAM,OAAO,EADF,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAC,GAAC,CAAC,CACN,CAAC;AAGpC;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAF9C,yBAE8C,+BAQxD;eAEc,OAAO"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @return {boolean} Whether elements are in the same block.
|
|
8
8
|
*/
|
|
9
|
-
export function isInSameBlock(a: Element, b: Element): boolean;
|
|
9
|
+
export declare function isInSameBlock(a: Element, b: Element): boolean;
|
|
10
10
|
/**
|
|
11
11
|
* Returns true if an element is considered part of the block and not its inner
|
|
12
12
|
* blocks or appender.
|
|
@@ -17,7 +17,7 @@ export function isInSameBlock(a: Element, b: Element): boolean;
|
|
|
17
17
|
* @return {boolean} Whether an element is considered part of the block and not
|
|
18
18
|
* its inner blocks or appender.
|
|
19
19
|
*/
|
|
20
|
-
export function isInsideRootBlock(blockElement: Element, element: Element): boolean;
|
|
20
|
+
export declare function isInsideRootBlock(blockElement: Element, element: Element): boolean;
|
|
21
21
|
/**
|
|
22
22
|
* Finds the block client ID given any DOM node inside the block.
|
|
23
23
|
*
|
|
@@ -26,7 +26,7 @@ export function isInsideRootBlock(blockElement: Element, element: Element): bool
|
|
|
26
26
|
* @return {string|undefined} Client ID or undefined if the node is not part of
|
|
27
27
|
* a block.
|
|
28
28
|
*/
|
|
29
|
-
export function getBlockClientId(node: Node | null): string | undefined;
|
|
29
|
+
export declare function getBlockClientId(node: Node | null): string | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* Calculates the union of two rectangles.
|
|
32
32
|
*
|
|
@@ -34,7 +34,15 @@ export function getBlockClientId(node: Node | null): string | undefined;
|
|
|
34
34
|
* @param {DOMRect} rect2 Second rectangle.
|
|
35
35
|
* @return {DOMRect} Union of the two rectangles.
|
|
36
36
|
*/
|
|
37
|
-
export function rectUnion(rect1: DOMRect, rect2: DOMRect): DOMRect;
|
|
37
|
+
export declare function rectUnion(rect1: DOMRect, rect2: DOMRect): DOMRect;
|
|
38
|
+
/**
|
|
39
|
+
* Returns whether an element is visible.
|
|
40
|
+
*
|
|
41
|
+
* @param {Element} element Element.
|
|
42
|
+
* @return {boolean} Whether the element is visible.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isElementVisible(element: Element): boolean;
|
|
45
|
+
export declare const WITH_OVERFLOW_ELEMENT_BLOCKS: string[];
|
|
38
46
|
/**
|
|
39
47
|
* Returns the bounding rectangle of an element, with special handling for blocks
|
|
40
48
|
* that have visible overflowing children (defined in WITH_OVERFLOW_ELEMENT_BLOCKS).
|
|
@@ -48,6 +56,5 @@ export function rectUnion(rect1: DOMRect, rect2: DOMRect): DOMRect;
|
|
|
48
56
|
* @param {Element} element Element.
|
|
49
57
|
* @return {DOMRect} Bounding client rect of the element and its visible children.
|
|
50
58
|
*/
|
|
51
|
-
export function getElementBounds(element: Element): DOMRect;
|
|
52
|
-
export const WITH_OVERFLOW_ELEMENT_BLOCKS: string[];
|
|
59
|
+
export declare function getElementBounds(element: Element): DOMRect;
|
|
53
60
|
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/utils/dom.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAE,CAAC,EALrB,OAKqB,EAAE,CAAC,EAJxB,OAIwB,GAFvB,OAAO,CAIlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAE,YAAY,EANpC,OAMoC,EAAE,OAAO,EAL7C,OAK6C,GAH5C,OAAO,CAQlB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAE,IAAI,EAL3B,IAAI,OAKuB,GAH1B,MAAM,GAAC,SAAS,CAoB3B;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAE,KAAK,EAJrB,OAIqB,EAAE,KAAK,EAH5B,OAG4B,GAF3B,OAAO,CASlB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAH9B,OAG8B,GAF7B,OAAO,CAsClB;AAkBD,eAAO,MAAM,4BAA4B,UAAwB,CAAC;AAClE;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAH9B,OAG8B,GAF7B,OAAO,CAoDlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.19.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -61,42 +61,43 @@
|
|
|
61
61
|
],
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@react-spring/web": "^9.4.5",
|
|
64
|
-
"@wordpress/a11y": "^4.
|
|
65
|
-
"@wordpress/base-styles": "^
|
|
66
|
-
"@wordpress/blob": "^4.
|
|
67
|
-
"@wordpress/block-serialization-default-parser": "^5.
|
|
68
|
-
"@wordpress/blocks": "^15.
|
|
69
|
-
"@wordpress/commands": "^1.
|
|
70
|
-
"@wordpress/components": "^33.
|
|
71
|
-
"@wordpress/compose": "^7.
|
|
72
|
-
"@wordpress/data": "^10.
|
|
73
|
-
"@wordpress/dataviews": "^14.
|
|
74
|
-
"@wordpress/date": "^5.
|
|
75
|
-
"@wordpress/deprecated": "^4.
|
|
76
|
-
"@wordpress/dom": "^4.
|
|
77
|
-
"@wordpress/element": "^6.
|
|
78
|
-
"@wordpress/escape-html": "^3.
|
|
79
|
-
"@wordpress/global-styles-engine": "^1.
|
|
80
|
-
"@wordpress/hooks": "^4.
|
|
81
|
-
"@wordpress/html-entities": "^4.
|
|
82
|
-
"@wordpress/i18n": "^6.
|
|
83
|
-
"@wordpress/icons": "^
|
|
84
|
-
"@wordpress/image-cropper": "^1.
|
|
85
|
-
"@wordpress/interactivity": "^6.
|
|
86
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
87
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
88
|
-
"@wordpress/keycodes": "^4.
|
|
89
|
-
"@wordpress/notices": "^5.
|
|
90
|
-
"@wordpress/preferences": "^4.
|
|
91
|
-
"@wordpress/priority-queue": "^3.
|
|
92
|
-
"@wordpress/private-apis": "^1.
|
|
93
|
-
"@wordpress/rich-text": "^7.
|
|
94
|
-
"@wordpress/style-engine": "^2.
|
|
95
|
-
"@wordpress/token-list": "^3.
|
|
96
|
-
"@wordpress/
|
|
97
|
-
"@wordpress/
|
|
98
|
-
"@wordpress/
|
|
99
|
-
"@wordpress/
|
|
64
|
+
"@wordpress/a11y": "^4.46.0",
|
|
65
|
+
"@wordpress/base-styles": "^8.0.0",
|
|
66
|
+
"@wordpress/blob": "^4.46.0",
|
|
67
|
+
"@wordpress/block-serialization-default-parser": "^5.46.0",
|
|
68
|
+
"@wordpress/blocks": "^15.19.0",
|
|
69
|
+
"@wordpress/commands": "^1.46.0",
|
|
70
|
+
"@wordpress/components": "^33.1.0",
|
|
71
|
+
"@wordpress/compose": "^7.46.0",
|
|
72
|
+
"@wordpress/data": "^10.46.0",
|
|
73
|
+
"@wordpress/dataviews": "^14.3.0",
|
|
74
|
+
"@wordpress/date": "^5.46.0",
|
|
75
|
+
"@wordpress/deprecated": "^4.46.0",
|
|
76
|
+
"@wordpress/dom": "^4.46.0",
|
|
77
|
+
"@wordpress/element": "^6.46.0",
|
|
78
|
+
"@wordpress/escape-html": "^3.46.0",
|
|
79
|
+
"@wordpress/global-styles-engine": "^1.13.0",
|
|
80
|
+
"@wordpress/hooks": "^4.46.0",
|
|
81
|
+
"@wordpress/html-entities": "^4.46.0",
|
|
82
|
+
"@wordpress/i18n": "^6.19.0",
|
|
83
|
+
"@wordpress/icons": "^13.1.0",
|
|
84
|
+
"@wordpress/image-cropper": "^1.10.0",
|
|
85
|
+
"@wordpress/interactivity": "^6.46.0",
|
|
86
|
+
"@wordpress/is-shallow-equal": "^5.46.0",
|
|
87
|
+
"@wordpress/keyboard-shortcuts": "^5.46.0",
|
|
88
|
+
"@wordpress/keycodes": "^4.46.0",
|
|
89
|
+
"@wordpress/notices": "^5.46.0",
|
|
90
|
+
"@wordpress/preferences": "^4.46.0",
|
|
91
|
+
"@wordpress/priority-queue": "^3.46.0",
|
|
92
|
+
"@wordpress/private-apis": "^1.46.0",
|
|
93
|
+
"@wordpress/rich-text": "^7.46.0",
|
|
94
|
+
"@wordpress/style-engine": "^2.46.0",
|
|
95
|
+
"@wordpress/token-list": "^3.46.0",
|
|
96
|
+
"@wordpress/ui": "^0.13.0",
|
|
97
|
+
"@wordpress/upload-media": "^0.31.0",
|
|
98
|
+
"@wordpress/url": "^4.46.0",
|
|
99
|
+
"@wordpress/warning": "^3.46.0",
|
|
100
|
+
"@wordpress/wordcount": "^4.46.0",
|
|
100
101
|
"change-case": "^4.1.2",
|
|
101
102
|
"clsx": "^2.1.1",
|
|
102
103
|
"colord": "^2.7.0",
|
|
@@ -123,5 +124,5 @@
|
|
|
123
124
|
"publishConfig": {
|
|
124
125
|
"access": "public"
|
|
125
126
|
},
|
|
126
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "51264e33b95fadff9a06b68141e674ce9cde9675"
|
|
127
128
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { applyFilters, hasFilter } from '@wordpress/hooks';
|
|
5
5
|
import {
|
|
6
|
-
Autocomplete,
|
|
6
|
+
Autocomplete as WCAutocomplete,
|
|
7
7
|
__unstableUseAutocompleteProps as useAutocompleteProps,
|
|
8
8
|
} from '@wordpress/components';
|
|
9
9
|
import { useMemo } from '@wordpress/element';
|
|
@@ -68,7 +68,9 @@ export function useBlockEditorAutocompleteProps( props ) {
|
|
|
68
68
|
* @type {React.FC}
|
|
69
69
|
*/
|
|
70
70
|
function BlockEditorAutocomplete( props ) {
|
|
71
|
-
return
|
|
71
|
+
return (
|
|
72
|
+
<WCAutocomplete { ...props } completers={ useCompleters( props ) } />
|
|
73
|
+
);
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
/**
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
FlexBlock,
|
|
17
17
|
FocalPointPicker,
|
|
18
18
|
MenuItem,
|
|
19
|
-
VisuallyHidden,
|
|
20
19
|
__experimentalHStack as HStack,
|
|
21
20
|
__experimentalTruncate as Truncate,
|
|
22
21
|
Dropdown,
|
|
@@ -25,6 +24,7 @@ import {
|
|
|
25
24
|
__experimentalDropdownContentWrapper as DropdownContentWrapper,
|
|
26
25
|
Button,
|
|
27
26
|
} from '@wordpress/components';
|
|
27
|
+
import { VisuallyHidden } from '@wordpress/ui';
|
|
28
28
|
import { reset as resetIcon } from '@wordpress/icons';
|
|
29
29
|
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
30
30
|
import { store as noticesStore } from '@wordpress/notices';
|
|
@@ -162,7 +162,7 @@ function InspectorImagePreviewItem( {
|
|
|
162
162
|
>
|
|
163
163
|
{ label }
|
|
164
164
|
</Truncate>
|
|
165
|
-
<VisuallyHidden
|
|
165
|
+
<VisuallyHidden render={ <span /> }>
|
|
166
166
|
{ imgUrl
|
|
167
167
|
? sprintf(
|
|
168
168
|
/* translators: %s: file name */
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
Flex,
|
|
7
7
|
FlexItem,
|
|
8
8
|
Modal,
|
|
9
|
-
__experimentalText as
|
|
9
|
+
__experimentalText as WCText,
|
|
10
10
|
__experimentalVStack as VStack,
|
|
11
11
|
} from '@wordpress/components';
|
|
12
12
|
import { useState } from '@wordpress/element';
|
|
@@ -58,11 +58,11 @@ export default function BlockAllowedBlocksModal( {
|
|
|
58
58
|
} }
|
|
59
59
|
spacing="4"
|
|
60
60
|
>
|
|
61
|
-
<
|
|
61
|
+
<WCText>
|
|
62
62
|
{ __(
|
|
63
63
|
'Select which blocks can be added inside this container.'
|
|
64
64
|
) }
|
|
65
|
-
</
|
|
65
|
+
</WCText>
|
|
66
66
|
<BlockManager
|
|
67
67
|
blockTypes={ blockTypes }
|
|
68
68
|
selectedBlockTypes={ currentSelectedBlockTypes }
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from '@wordpress/blocks';
|
|
14
14
|
import {
|
|
15
15
|
__experimentalItem as Item,
|
|
16
|
-
__experimentalText as
|
|
16
|
+
__experimentalText as WCText,
|
|
17
17
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
18
18
|
__experimentalVStack as VStack,
|
|
19
19
|
privateApis as componentsPrivateApis,
|
|
@@ -142,14 +142,14 @@ export default function BlockBindingsAttributeControl( {
|
|
|
142
142
|
className="block-editor-bindings__item"
|
|
143
143
|
spacing={ 0 }
|
|
144
144
|
>
|
|
145
|
-
<
|
|
146
|
-
<
|
|
145
|
+
<WCText truncate>{ attribute }</WCText>
|
|
146
|
+
<WCText
|
|
147
147
|
truncate
|
|
148
148
|
variant={ isValid ? 'muted' : undefined }
|
|
149
149
|
isDestructive={ ! isValid }
|
|
150
150
|
>
|
|
151
151
|
{ displayText }
|
|
152
|
-
</
|
|
152
|
+
</WCText>
|
|
153
153
|
</VStack>
|
|
154
154
|
</Menu.TriggerButton>
|
|
155
155
|
{ ! isAttributeReadOnly && (
|
|
@@ -9,7 +9,7 @@ import clsx from 'clsx';
|
|
|
9
9
|
import {
|
|
10
10
|
Button,
|
|
11
11
|
Icon,
|
|
12
|
-
__experimentalText as
|
|
12
|
+
__experimentalText as WCText,
|
|
13
13
|
__experimentalVStack as VStack,
|
|
14
14
|
__experimentalHStack as HStack,
|
|
15
15
|
privateApis as componentsPrivateApis,
|
|
@@ -32,7 +32,7 @@ import { unlock } from '../../lock-unlock';
|
|
|
32
32
|
import { store as blockEditorStore } from '../../store';
|
|
33
33
|
import BlockIcon from '../block-icon';
|
|
34
34
|
|
|
35
|
-
const { Badge } = unlock( componentsPrivateApis );
|
|
35
|
+
const { Badge: WCBadge } = unlock( componentsPrivateApis );
|
|
36
36
|
|
|
37
37
|
function OptionalParentSelectButton( { children, onClick } ) {
|
|
38
38
|
if ( ! onClick ) {
|
|
@@ -197,7 +197,7 @@ function BlockCard( {
|
|
|
197
197
|
{ ! parentClientId &&
|
|
198
198
|
! isChild &&
|
|
199
199
|
!! name?.length && (
|
|
200
|
-
<
|
|
200
|
+
<WCBadge>{ title }</WCBadge>
|
|
201
201
|
) }
|
|
202
202
|
</TitleElement>
|
|
203
203
|
{ children }
|
|
@@ -205,9 +205,9 @@ function BlockCard( {
|
|
|
205
205
|
</OptionalParentSelectButton>
|
|
206
206
|
</HStack>
|
|
207
207
|
{ ! parentClientId && ! isChild && description && (
|
|
208
|
-
<
|
|
208
|
+
<WCText className="block-editor-block-card__description">
|
|
209
209
|
{ description }
|
|
210
|
-
</
|
|
210
|
+
</WCText>
|
|
211
211
|
) }
|
|
212
212
|
</VStack>
|
|
213
213
|
</div>
|
|
@@ -34,6 +34,7 @@ export default function BlockControlsFill( {
|
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
36
|
<StyleProvider document={ document }>
|
|
37
|
+
{ /* eslint-disable-next-line react-hooks/static-components */ }
|
|
37
38
|
<Fill>
|
|
38
39
|
{ ( fillProps ) => {
|
|
39
40
|
// `fillProps.forwardedContext` is an array of context provider entries, provided by slot,
|
|
@@ -76,8 +76,10 @@ function InlineEditButton( {
|
|
|
76
76
|
onClick={ handleClick }
|
|
77
77
|
>
|
|
78
78
|
{ editedContentOnlySection
|
|
79
|
-
?
|
|
80
|
-
|
|
79
|
+
? /* translators: Button label to leave pattern editing mode. */
|
|
80
|
+
__( 'Exit pattern' )
|
|
81
|
+
: /* translators: Button label to enter pattern editing mode. */
|
|
82
|
+
__( 'Edit pattern' ) }
|
|
81
83
|
</Button>
|
|
82
84
|
</VStack>
|
|
83
85
|
);
|
|
@@ -153,10 +153,6 @@ _::-webkit-full-page-media, _:future, :root [data-has-multi-selection="true"] .b
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
.reusable-block-edit-panel * {
|
|
157
|
-
z-index: z-index(".block-editor-block-list__block .reusable-block-edit-panel *");
|
|
158
|
-
}
|
|
159
|
-
|
|
160
156
|
/**
|
|
161
157
|
* Notices
|
|
162
158
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
@use "@wordpress/base-styles/variables" as *;
|
|
2
2
|
@use "@wordpress/base-styles/colors" as *;
|
|
3
|
-
@use "@wordpress/base-styles/z-index" as *;
|
|
4
3
|
|
|
5
4
|
.block-editor-block-manager__no-results {
|
|
6
5
|
font-style: italic;
|
|
@@ -9,6 +8,7 @@
|
|
|
9
8
|
}
|
|
10
9
|
|
|
11
10
|
.block-editor-block-manager__category {
|
|
11
|
+
isolation: isolate;
|
|
12
12
|
margin: 0 0 $grid-unit-30 0;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
top: - $grid-unit-05; // Offsets the top padding on the modal content container
|
|
18
18
|
padding: $grid-unit-20 0;
|
|
19
19
|
background-color: $white;
|
|
20
|
-
|
|
20
|
+
// Make sure sticky category titles appear above the options.
|
|
21
|
+
z-index: 1;
|
|
21
22
|
|
|
22
23
|
.components-checkbox-control__label {
|
|
23
24
|
font-weight: 600;
|