@wordpress/block-editor 12.13.0 → 12.15.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 +4 -0
- package/README.md +1 -1
- package/build/components/block-heading-level-dropdown/index.js +1 -1
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-list/block.native.js +2 -0
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +2 -9
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list-appender/index.js +16 -3
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-parent-selector/index.js +1 -1
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +25 -16
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-list/index.js +36 -19
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +6 -4
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-rename/index.js +28 -0
- package/build/components/block-rename/index.js.map +1 -0
- package/build/components/block-rename/is-empty-string.js +10 -0
- package/build/components/block-rename/is-empty-string.js.map +1 -0
- package/build/components/block-rename/modal.js +87 -0
- package/build/components/block-rename/modal.js.map +1 -0
- package/build/components/block-rename/rename-control.js +74 -0
- package/build/components/block-rename/rename-control.js.map +1 -0
- package/build/components/block-rename/use-block-rename.js +17 -0
- package/build/components/block-rename/use-block-rename.js.map +1 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js +33 -20
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +7 -0
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +0 -8
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +18 -14
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-tools/back-compat.js +2 -2
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +11 -81
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/empty-block-inserter.js +56 -0
- package/build/components/block-tools/empty-block-inserter.js.map +1 -0
- package/build/components/block-tools/index.js +48 -9
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/selected-block-tools.js +113 -0
- package/build/components/block-tools/selected-block-tools.js.map +1 -0
- package/build/components/block-tools/use-selected-block-tool-props.js +56 -0
- package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -0
- package/build/components/block-types-list/index.js +6 -2
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +8 -1
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/editable-text/index.js +1 -2
- package/build/components/editable-text/index.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +1 -1
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/iframe/index.js +4 -3
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-size-control/index.js +0 -5
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +3 -1
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +29 -31
- package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/{explorer.js → index.js} +7 -7
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/{sidebar.js → pattern-explorer-sidebar.js} +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -0
- package/build/components/inserter/block-patterns-explorer/{patterns-list.js → pattern-list.js} +4 -4
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/index.js +75 -0
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +48 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +108 -0
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -0
- package/build/components/inserter/{block-patterns-filter.js → block-patterns-tab/patterns-filter.js} +18 -34
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +55 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -0
- package/build/components/inserter/block-patterns-tab/utils.js +69 -0
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -0
- package/build/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +9 -5
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +15 -12
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/menu.js +3 -4
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter-listbox/index.js +11 -6
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +24 -23
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +5 -5
- package/build/components/inserter-listbox/row.js.map +1 -1
- package/build/components/link-control/index.js +6 -5
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/list-view/block-select-button.js +39 -0
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +16 -3
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/index.js +3 -2
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +69 -18
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/preview-options/index.js +4 -2
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -14
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/index.js +0 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +4 -2
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/native/format-edit.js +45 -0
- package/build/components/rich-text/native/format-edit.js.map +1 -0
- package/build/components/rich-text/native/get-format-colors.native.js +41 -0
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -0
- package/build/components/rich-text/native/index.js +9 -0
- package/build/components/rich-text/native/index.js.map +1 -0
- package/build/components/rich-text/native/index.native.js +1189 -0
- package/build/components/rich-text/native/index.native.js.map +1 -0
- package/build/components/rich-text/native/toolbar-button-with-options.native.js +58 -0
- package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -0
- package/build/components/rich-text/native/use-format-types.js +111 -0
- package/build/components/rich-text/native/use-format-types.js.map +1 -0
- package/build/components/rich-text/use-input-rules.js +30 -1
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +2 -5
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -1
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +4 -1
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-moving-animation/index.js +2 -1
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-settings/index.js +2 -2
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +7 -3
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +10 -10
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +2 -2
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/anchor.js +7 -6
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +16 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-hooks.js +7 -8
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-renaming.js +42 -0
- package/build/hooks/block-renaming.js.map +1 -1
- package/build/hooks/content-lock-ui.js +5 -5
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/custom-class-name.js +8 -7
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/custom-fields.js +57 -52
- package/build/hooks/custom-fields.js.map +1 -1
- package/build/hooks/duotone.js +9 -20
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout.js +103 -93
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +10 -9
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +10 -13
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/utils.js +30 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +4 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/private-apis.js +3 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +30 -37
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +18 -0
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +18 -13
- package/build/store/selectors.js.map +1 -1
- package/build/utils/transform-styles/index.js +26 -6
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-list/block.native.js +2 -0
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +3 -10
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +16 -3
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +1 -1
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +24 -15
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +4 -2
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +36 -19
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +7 -5
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-rename/index.js +4 -0
- package/build-module/components/block-rename/index.js.map +1 -0
- package/build-module/components/block-rename/is-empty-string.js +4 -0
- package/build-module/components/block-rename/is-empty-string.js.map +1 -0
- package/build-module/components/block-rename/modal.js +79 -0
- package/build-module/components/block-rename/modal.js.map +1 -0
- package/build-module/components/block-rename/rename-control.js +66 -0
- package/build-module/components/block-rename/rename-control.js.map +1 -0
- package/build-module/components/block-rename/use-block-rename.js +10 -0
- package/build-module/components/block-rename/use-block-rename.js.map +1 -0
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +34 -21
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +7 -0
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +0 -8
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +17 -13
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +1 -1
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +11 -80
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/empty-block-inserter.js +48 -0
- package/build-module/components/block-tools/empty-block-inserter.js.map +1 -0
- package/build-module/components/block-tools/index.js +48 -9
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/selected-block-tools.js +105 -0
- package/build-module/components/block-tools/selected-block-tools.js.map +1 -0
- package/build-module/components/block-tools/use-selected-block-tool-props.js +50 -0
- package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -0
- package/build-module/components/block-types-list/index.js +6 -2
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +8 -1
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/editable-text/index.js +1 -2
- package/build-module/components/editable-text/index.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +1 -1
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/iframe/index.js +4 -3
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-size-control/index.js +0 -5
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +3 -1
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +30 -32
- package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/{explorer.js → index.js} +5 -5
- package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/{sidebar.js → pattern-explorer-sidebar.js} +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -0
- package/build-module/components/inserter/block-patterns-explorer/{patterns-list.js → pattern-list.js} +3 -3
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/index.js +66 -0
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +42 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +100 -0
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -0
- package/build-module/components/inserter/{block-patterns-filter.js → block-patterns-tab/patterns-filter.js} +7 -20
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +47 -0
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js +57 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -0
- package/build-module/components/inserter/hooks/use-patterns-state.js +2 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +9 -5
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +15 -12
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/menu.js +4 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter-listbox/index.js +13 -8
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inserter-listbox/item.js +25 -23
- package/build-module/components/inserter-listbox/item.js.map +1 -1
- package/build-module/components/inserter-listbox/row.js +6 -5
- package/build-module/components/inserter-listbox/row.js.map +1 -1
- package/build-module/components/link-control/index.js +7 -6
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +39 -0
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +16 -3
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/index.js +3 -2
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-list-view-expand-selected-item.js +2 -3
- package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +69 -17
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/preview-options/index.js +4 -2
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -14
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/index.js +0 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +4 -2
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/format-edit.js +38 -0
- package/build-module/components/rich-text/native/format-edit.js.map +1 -0
- package/build-module/components/rich-text/native/get-format-colors.native.js +34 -0
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -0
- package/build-module/components/rich-text/native/index.js +2 -0
- package/build-module/components/rich-text/native/index.js.map +1 -0
- package/build-module/components/rich-text/native/index.native.js +1179 -0
- package/build-module/components/rich-text/native/index.native.js.map +1 -0
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +51 -0
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -0
- package/build-module/components/rich-text/native/use-format-types.js +104 -0
- package/build-module/components/rich-text/native/use-format-types.js.map +1 -0
- package/build-module/components/rich-text/use-input-rules.js +31 -2
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +2 -5
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +2 -1
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +4 -1
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +2 -1
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +2 -2
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +7 -3
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +8 -8
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +2 -2
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/anchor.js +5 -4
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +17 -5
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-hooks.js +5 -6
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-renaming.js +40 -0
- package/build-module/hooks/block-renaming.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +3 -3
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +6 -5
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/custom-fields.js +57 -52
- package/build-module/hooks/custom-fields.js.map +1 -1
- package/build-module/hooks/duotone.js +10 -21
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout.js +103 -93
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +11 -10
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +10 -13
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/utils.js +30 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +4 -3
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/private-apis.js +4 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +29 -37
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +17 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +17 -13
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +24 -7
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +6 -6
- package/build-style/content.css +6 -6
- package/build-style/style-rtl.css +26 -20
- package/build-style/style.css +26 -20
- package/package.json +31 -31
- package/src/components/block-heading-level-dropdown/index.js +1 -1
- package/src/components/block-list/block.native.js +2 -0
- package/src/components/block-list/index.js +4 -18
- package/src/components/block-list-appender/index.js +20 -4
- package/src/components/block-parent-selector/index.js +1 -1
- package/src/components/block-pattern-setup/index.js +38 -22
- package/src/components/block-pattern-setup/setup-toolbar.js +2 -0
- package/src/components/block-pattern-setup/style.scss +4 -1
- package/src/components/block-patterns-list/README.md +4 -4
- package/src/components/block-patterns-list/index.js +60 -34
- package/src/components/block-patterns-list/style.scss +7 -0
- package/src/components/block-quick-navigation/index.js +11 -5
- package/src/components/block-rename/index.js +3 -0
- package/src/components/block-rename/is-empty-string.js +3 -0
- package/src/components/block-rename/modal.js +115 -0
- package/src/components/block-rename/rename-control.js +80 -0
- package/src/components/block-rename/use-block-rename.js +10 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +38 -34
- package/src/components/block-settings-menu-controls/index.js +9 -0
- package/src/components/block-styles/index.js +0 -10
- package/src/components/block-switcher/pattern-transformations-menu.js +20 -14
- package/src/components/block-toolbar/block-toolbar-menu.native.js +1 -4
- package/src/components/block-toolbar/style.scss +8 -0
- package/src/components/block-tools/back-compat.js +1 -1
- package/src/components/block-tools/block-contextual-toolbar.js +11 -134
- package/src/components/block-tools/empty-block-inserter.js +56 -0
- package/src/components/block-tools/index.js +72 -16
- package/src/components/block-tools/selected-block-tools.js +127 -0
- package/src/components/block-tools/style.scss +0 -10
- package/src/components/block-tools/use-selected-block-tool-props.js +66 -0
- package/src/components/block-types-list/index.js +5 -4
- package/src/components/button-block-appender/content.scss +2 -2
- package/src/components/date-format-picker/index.js +7 -0
- package/src/components/editable-text/README.md +0 -36
- package/src/components/editable-text/index.js +1 -8
- package/src/components/global-styles/advanced-panel.js +1 -1
- package/src/components/iframe/index.js +4 -3
- package/src/components/image-size-control/index.js +0 -6
- package/src/components/inner-blocks/index.js +6 -2
- package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +57 -33
- package/src/components/inserter/block-patterns-explorer/{explorer.js → index.js} +4 -4
- package/src/components/inserter/block-patterns-explorer/{patterns-list.js → pattern-list.js} +9 -2
- package/src/components/inserter/block-patterns-tab/index.js +118 -0
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +48 -0
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +179 -0
- package/src/components/inserter/{block-patterns-filter.js → block-patterns-tab/patterns-filter.js} +15 -21
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +101 -0
- package/src/components/inserter/block-patterns-tab/utils.js +78 -0
- package/src/components/inserter/hooks/use-patterns-state.js +3 -1
- package/src/components/inserter/media-tab/media-list.js +7 -7
- package/src/components/inserter/media-tab/media-preview.js +27 -22
- package/src/components/inserter/menu.js +4 -5
- package/src/components/inserter-listbox/index.js +11 -7
- package/src/components/inserter-listbox/item.js +11 -12
- package/src/components/inserter-listbox/row.js +6 -12
- package/src/components/link-control/README.md +2 -2
- package/src/components/link-control/index.js +15 -6
- package/src/components/link-control/style.scss +8 -5
- package/src/components/list-view/block-select-button.js +44 -1
- package/src/components/list-view/block.js +11 -11
- package/src/components/list-view/index.js +2 -0
- package/src/components/list-view/use-list-view-expand-selected-item.js +7 -8
- package/src/components/media-replace-flow/style.scss +2 -2
- package/src/components/navigable-toolbar/index.js +71 -25
- package/src/components/plain-text/README.md +2 -30
- package/src/components/preview-options/index.js +2 -0
- package/src/components/provider/use-block-sync.js +2 -21
- package/src/components/rich-text/README.md +6 -63
- package/src/components/rich-text/index.js +0 -1
- package/src/components/rich-text/index.native.js +4 -2
- package/src/components/rich-text/native/format-edit.js +44 -0
- package/src/components/rich-text/native/get-format-colors.native.js +54 -0
- package/src/components/rich-text/native/index.js +1 -0
- package/src/components/rich-text/native/index.native.js +1406 -0
- package/src/components/rich-text/native/style.native.scss +28 -0
- package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +79 -0
- package/src/components/rich-text/native/test/index.native.js +278 -0
- package/src/components/rich-text/native/test/performance/rich-text.native.js +44 -0
- package/src/components/rich-text/native/toolbar-button-with-options.native.js +61 -0
- package/src/components/rich-text/native/use-format-types.js +146 -0
- package/src/components/rich-text/use-input-rules.js +30 -2
- package/src/components/rich-text/use-paste-handler.js +1 -6
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
- package/src/components/url-input/README.md +1 -74
- package/src/components/url-popover/image-url-input-ui.js +1 -0
- package/src/components/use-block-drop-zone/index.js +4 -1
- package/src/components/use-moving-animation/index.js +1 -1
- package/src/components/use-settings/index.js +2 -2
- package/src/components/use-settings/test/index.js +1 -1
- package/src/components/writing-flow/use-tab-nav.js +8 -3
- package/src/hooks/align.js +8 -8
- package/src/hooks/align.native.js +2 -2
- package/src/hooks/anchor.js +21 -23
- package/src/hooks/background.js +28 -6
- package/src/hooks/block-hooks.js +20 -16
- package/src/hooks/block-renaming.js +47 -0
- package/src/hooks/content-lock-ui.js +3 -3
- package/src/hooks/custom-class-name.js +7 -6
- package/src/hooks/custom-fields.js +73 -70
- package/src/hooks/duotone.js +23 -33
- package/src/hooks/index.js +0 -1
- package/src/hooks/layout.js +126 -113
- package/src/hooks/position.js +8 -21
- package/src/hooks/style.js +17 -31
- package/src/hooks/test/__snapshots__/align.native.js.snap +5 -5
- package/src/hooks/test/align.js +4 -4
- package/src/hooks/utils.js +33 -1
- package/src/layouts/constrained.js +57 -50
- package/src/private-apis.js +4 -1
- package/src/store/actions.js +26 -72
- package/src/store/reducer.js +19 -0
- package/src/store/selectors.js +15 -19
- package/src/style.scss +1 -1
- package/src/utils/test/transform-styles.js +49 -0
- package/src/utils/transform-styles/index.js +39 -13
- package/build/components/block-tools/selected-block-popover.js +0 -221
- package/build/components/block-tools/selected-block-popover.js.map +0 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +0 -1
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +0 -1
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +0 -1
- package/build/components/inserter/block-patterns-filter.js.map +0 -1
- package/build/components/inserter/block-patterns-tab.js +0 -270
- package/build/components/inserter/block-patterns-tab.js.map +0 -1
- package/build/hooks/block-rename-ui.js +0 -165
- package/build/hooks/block-rename-ui.js.map +0 -1
- package/build/store/utils.js +0 -22
- package/build/store/utils.js.map +0 -1
- package/build-module/components/block-tools/selected-block-popover.js +0 -213
- package/build-module/components/block-tools/selected-block-popover.js.map +0 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +0 -1
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +0 -1
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +0 -1
- package/build-module/components/inserter/block-patterns-filter.js.map +0 -1
- package/build-module/components/inserter/block-patterns-tab.js +0 -254
- package/build-module/components/inserter/block-patterns-tab.js.map +0 -1
- package/build-module/hooks/block-rename-ui.js +0 -157
- package/build-module/hooks/block-rename-ui.js.map +0 -1
- package/build-module/store/utils.js +0 -16
- package/build-module/store/utils.js.map +0 -1
- package/src/components/block-tools/selected-block-popover.js +0 -265
- package/src/components/inserter/block-patterns-tab.js +0 -448
- package/src/hooks/block-rename-ui.js +0 -226
- package/src/store/utils.js +0 -12
- /package/src/{hooks/block-rename-ui.scss → components/block-rename/style.scss} +0 -0
- /package/src/components/inserter/block-patterns-explorer/{sidebar.js → pattern-explorer-sidebar.js} +0 -0
package/build/hooks/layout.js
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.addAttribute = addAttribute;
|
|
8
8
|
exports.useLayoutClasses = useLayoutClasses;
|
|
9
9
|
exports.useLayoutStyles = useLayoutStyles;
|
|
10
|
-
exports.withLayoutStyles = exports.
|
|
10
|
+
exports.withLayoutStyles = exports.withLayoutControls = exports.withChildLayoutStyles = void 0;
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
13
|
var _compose = require("@wordpress/compose");
|
|
@@ -16,7 +16,6 @@ var _blocks = require("@wordpress/blocks");
|
|
|
16
16
|
var _data = require("@wordpress/data");
|
|
17
17
|
var _components = require("@wordpress/components");
|
|
18
18
|
var _i18n = require("@wordpress/i18n");
|
|
19
|
-
var _element = require("@wordpress/element");
|
|
20
19
|
var _store = require("../store");
|
|
21
20
|
var _components2 = require("../components");
|
|
22
21
|
var _useSettings = require("../components/use-settings");
|
|
@@ -25,7 +24,6 @@ var _blockEditingMode = require("../components/block-editing-mode");
|
|
|
25
24
|
var _definitions = require("../layouts/definitions");
|
|
26
25
|
var _object = require("../utils/object");
|
|
27
26
|
var _utils = require("./utils");
|
|
28
|
-
var _lockUnlock = require("../lock-unlock");
|
|
29
27
|
/**
|
|
30
28
|
* External dependencies
|
|
31
29
|
*/
|
|
@@ -128,11 +126,11 @@ function LayoutPanel({
|
|
|
128
126
|
name: blockName
|
|
129
127
|
}) {
|
|
130
128
|
const settings = (0, _utils.useBlockSettings)(blockName);
|
|
129
|
+
// Block settings come from theme.json under settings.[blockName].
|
|
131
130
|
const {
|
|
132
|
-
layout:
|
|
133
|
-
allowEditing: allowEditingSetting
|
|
134
|
-
}
|
|
131
|
+
layout: layoutSettings
|
|
135
132
|
} = settings;
|
|
133
|
+
// Layout comes from block attributes.
|
|
136
134
|
const {
|
|
137
135
|
layout
|
|
138
136
|
} = attributes;
|
|
@@ -151,13 +149,19 @@ function LayoutPanel({
|
|
|
151
149
|
if (blockEditingMode !== 'default') {
|
|
152
150
|
return null;
|
|
153
151
|
}
|
|
152
|
+
|
|
153
|
+
// Layout block support comes from the block's block.json.
|
|
154
154
|
const layoutBlockSupport = (0, _blocks.getBlockSupport)(blockName, layoutBlockSupportKey, {});
|
|
155
|
+
const blockSupportAndThemeSettings = {
|
|
156
|
+
...layoutSettings,
|
|
157
|
+
...layoutBlockSupport
|
|
158
|
+
};
|
|
155
159
|
const {
|
|
156
160
|
allowSwitching,
|
|
157
|
-
allowEditing =
|
|
161
|
+
allowEditing = true,
|
|
158
162
|
allowInheriting = true,
|
|
159
163
|
default: defaultBlockLayout
|
|
160
|
-
} =
|
|
164
|
+
} = blockSupportAndThemeSettings;
|
|
161
165
|
if (!allowEditing) {
|
|
162
166
|
return null;
|
|
163
167
|
}
|
|
@@ -211,11 +215,11 @@ function LayoutPanel({
|
|
|
211
215
|
}), layoutType && layoutType.name !== 'default' && (0, _react.createElement)(layoutType.inspectorControls, {
|
|
212
216
|
layout: usedLayout,
|
|
213
217
|
onChange: onChangeLayout,
|
|
214
|
-
layoutBlockSupport:
|
|
218
|
+
layoutBlockSupport: blockSupportAndThemeSettings
|
|
215
219
|
}), constrainedType && displayControlsForLegacyLayouts && (0, _react.createElement)(constrainedType.inspectorControls, {
|
|
216
220
|
layout: usedLayout,
|
|
217
221
|
onChange: onChangeLayout,
|
|
218
|
-
layoutBlockSupport:
|
|
222
|
+
layoutBlockSupport: blockSupportAndThemeSettings
|
|
219
223
|
}))), !inherit && layoutType && (0, _react.createElement)(layoutType.toolBarControls, {
|
|
220
224
|
layout: usedLayout,
|
|
221
225
|
onChange: onChangeLayout,
|
|
@@ -268,7 +272,7 @@ function addAttribute(settings) {
|
|
|
268
272
|
*
|
|
269
273
|
* @return {Function} Wrapped component.
|
|
270
274
|
*/
|
|
271
|
-
const
|
|
275
|
+
const withLayoutControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
|
|
272
276
|
const supportLayout = hasLayoutBlockSupport(props.name);
|
|
273
277
|
return [supportLayout && (0, _react.createElement)(LayoutPanel, {
|
|
274
278
|
key: "layout",
|
|
@@ -277,29 +281,16 @@ const withInspectorControls = (0, _compose.createHigherOrderComponent)(BlockEdit
|
|
|
277
281
|
key: "edit",
|
|
278
282
|
...props
|
|
279
283
|
})];
|
|
280
|
-
}, '
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
*
|
|
287
|
-
* @return {Function} Wrapped component.
|
|
288
|
-
*/
|
|
289
|
-
exports.withInspectorControls = withInspectorControls;
|
|
290
|
-
const withLayoutStyles = (0, _compose.createHigherOrderComponent)(BlockListBlock => props => {
|
|
284
|
+
}, 'withLayoutControls');
|
|
285
|
+
exports.withLayoutControls = withLayoutControls;
|
|
286
|
+
function BlockWithLayoutStyles({
|
|
287
|
+
block: BlockListBlock,
|
|
288
|
+
props
|
|
289
|
+
}) {
|
|
291
290
|
const {
|
|
292
291
|
name,
|
|
293
292
|
attributes
|
|
294
293
|
} = props;
|
|
295
|
-
const blockSupportsLayout = hasLayoutBlockSupport(name);
|
|
296
|
-
const disableLayoutStyles = (0, _data.useSelect)(select => {
|
|
297
|
-
const {
|
|
298
|
-
getSettings
|
|
299
|
-
} = select(_store.store);
|
|
300
|
-
return !!getSettings().disableLayoutStyles;
|
|
301
|
-
});
|
|
302
|
-
const shouldRenderLayoutStyles = blockSupportsLayout && !disableLayoutStyles;
|
|
303
294
|
const id = (0, _compose.useInstanceId)(BlockListBlock);
|
|
304
295
|
const {
|
|
305
296
|
layout
|
|
@@ -311,7 +302,8 @@ const withLayoutStyles = (0, _compose.createHigherOrderComponent)(BlockListBlock
|
|
|
311
302
|
...layout,
|
|
312
303
|
type: 'constrained'
|
|
313
304
|
} : layout || defaultBlockLayout || {};
|
|
314
|
-
const layoutClasses =
|
|
305
|
+
const layoutClasses = useLayoutClasses(attributes, name);
|
|
306
|
+
|
|
315
307
|
// Higher specificity to override defaults from theme.json.
|
|
316
308
|
const selector = `.wp-container-${id}.wp-container-${id}`;
|
|
317
309
|
const [blockGapSupport] = (0, _useSettings.useSettings)('spacing.blockGap');
|
|
@@ -319,110 +311,128 @@ const withLayoutStyles = (0, _compose.createHigherOrderComponent)(BlockListBlock
|
|
|
319
311
|
|
|
320
312
|
// Get CSS string for the current layout type.
|
|
321
313
|
// The CSS and `style` element is only output if it is not empty.
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
hasBlockGapSupport
|
|
331
|
-
});
|
|
332
|
-
}
|
|
314
|
+
const fullLayoutType = (0, _layouts.getLayoutType)(usedLayout?.type || 'default');
|
|
315
|
+
const css = fullLayoutType?.getLayoutStyle?.({
|
|
316
|
+
blockName: name,
|
|
317
|
+
selector,
|
|
318
|
+
layout: usedLayout,
|
|
319
|
+
style: attributes?.style,
|
|
320
|
+
hasBlockGapSupport
|
|
321
|
+
});
|
|
333
322
|
|
|
334
323
|
// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.
|
|
335
324
|
const layoutClassNames = (0, _classnames.default)({
|
|
336
|
-
[`wp-container-${id}`]:
|
|
325
|
+
[`wp-container-${id}`]: !!css // Only attach a container class if there is generated CSS to be attached.
|
|
337
326
|
}, layoutClasses);
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
342
|
-
(0, _element.useEffect)(() => {
|
|
343
|
-
if (!css) return;
|
|
344
|
-
setStyleOverride(selector, {
|
|
345
|
-
css
|
|
346
|
-
});
|
|
347
|
-
return () => {
|
|
348
|
-
deleteStyleOverride(selector);
|
|
349
|
-
};
|
|
350
|
-
}, [selector, css, setStyleOverride, deleteStyleOverride]);
|
|
327
|
+
(0, _utils.useStyleOverride)({
|
|
328
|
+
css
|
|
329
|
+
});
|
|
351
330
|
return (0, _react.createElement)(BlockListBlock, {
|
|
352
331
|
...props,
|
|
353
332
|
__unstableLayoutClassNames: layoutClassNames
|
|
354
333
|
});
|
|
355
|
-
}
|
|
334
|
+
}
|
|
356
335
|
|
|
357
336
|
/**
|
|
358
|
-
* Override the default block element to add the
|
|
337
|
+
* Override the default block element to add the layout styles.
|
|
359
338
|
*
|
|
360
339
|
* @param {Function} BlockListBlock Original component.
|
|
361
340
|
*
|
|
362
341
|
* @return {Function} Wrapped component.
|
|
363
342
|
*/
|
|
343
|
+
const withLayoutStyles = (0, _compose.createHigherOrderComponent)(BlockListBlock => props => {
|
|
344
|
+
const blockSupportsLayout = hasLayoutBlockSupport(props.name);
|
|
345
|
+
const shouldRenderLayoutStyles = (0, _data.useSelect)(select => {
|
|
346
|
+
// The callback returns early to avoid block editor subscription.
|
|
347
|
+
if (!blockSupportsLayout) {
|
|
348
|
+
return false;
|
|
349
|
+
}
|
|
350
|
+
return !select(_store.store).getSettings().disableLayoutStyles;
|
|
351
|
+
}, [blockSupportsLayout]);
|
|
352
|
+
if (!shouldRenderLayoutStyles) {
|
|
353
|
+
return (0, _react.createElement)(BlockListBlock, {
|
|
354
|
+
...props
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
return (0, _react.createElement)(BlockWithLayoutStyles, {
|
|
358
|
+
block: BlockListBlock,
|
|
359
|
+
props: props
|
|
360
|
+
});
|
|
361
|
+
}, 'withLayoutStyles');
|
|
364
362
|
exports.withLayoutStyles = withLayoutStyles;
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
layout = {}
|
|
372
|
-
} = {}
|
|
373
|
-
} = attributes;
|
|
363
|
+
function BlockWithChildLayoutStyles({
|
|
364
|
+
block: BlockListBlock,
|
|
365
|
+
props
|
|
366
|
+
}) {
|
|
367
|
+
var _props$attributes$sty;
|
|
368
|
+
const layout = (_props$attributes$sty = props.attributes.style?.layout) !== null && _props$attributes$sty !== void 0 ? _props$attributes$sty : {};
|
|
374
369
|
const {
|
|
375
370
|
selfStretch,
|
|
376
371
|
flexSize
|
|
377
372
|
} = layout;
|
|
378
|
-
const hasChildLayout = selfStretch || flexSize;
|
|
379
|
-
const disableLayoutStyles = (0, _data.useSelect)(select => {
|
|
380
|
-
const {
|
|
381
|
-
getSettings
|
|
382
|
-
} = select(_store.store);
|
|
383
|
-
return !!getSettings().disableLayoutStyles;
|
|
384
|
-
});
|
|
385
|
-
const shouldRenderChildLayoutStyles = hasChildLayout && !disableLayoutStyles;
|
|
386
373
|
const id = (0, _compose.useInstanceId)(BlockListBlock);
|
|
387
374
|
const selector = `.wp-container-content-${id}`;
|
|
388
375
|
let css = '';
|
|
389
376
|
if (selfStretch === 'fixed' && flexSize) {
|
|
390
|
-
css
|
|
377
|
+
css = `${selector} {
|
|
391
378
|
flex-basis: ${flexSize};
|
|
392
379
|
box-sizing: border-box;
|
|
393
380
|
}`;
|
|
394
381
|
} else if (selfStretch === 'fill') {
|
|
395
|
-
css
|
|
382
|
+
css = `${selector} {
|
|
396
383
|
flex-grow: 1;
|
|
397
384
|
}`;
|
|
398
385
|
}
|
|
399
386
|
|
|
400
387
|
// Attach a `wp-container-content` id-based classname.
|
|
401
|
-
const className = (0, _classnames.default)(props
|
|
402
|
-
[`wp-container-content-${id}`]:
|
|
388
|
+
const className = (0, _classnames.default)(props.className, {
|
|
389
|
+
[`wp-container-content-${id}`]: !!css // Only attach a container class if there is generated CSS to be attached.
|
|
403
390
|
});
|
|
404
391
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
409
|
-
(0, _element.useEffect)(() => {
|
|
410
|
-
if (!css) return;
|
|
411
|
-
setStyleOverride(selector, {
|
|
412
|
-
css
|
|
413
|
-
});
|
|
414
|
-
return () => {
|
|
415
|
-
deleteStyleOverride(selector);
|
|
416
|
-
};
|
|
417
|
-
}, [selector, css, setStyleOverride, deleteStyleOverride]);
|
|
392
|
+
(0, _utils.useStyleOverride)({
|
|
393
|
+
css
|
|
394
|
+
});
|
|
418
395
|
return (0, _react.createElement)(BlockListBlock, {
|
|
419
396
|
...props,
|
|
420
397
|
className: className
|
|
421
398
|
});
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* Override the default block element to add the child layout styles.
|
|
403
|
+
*
|
|
404
|
+
* @param {Function} BlockListBlock Original component.
|
|
405
|
+
*
|
|
406
|
+
* @return {Function} Wrapped component.
|
|
407
|
+
*/
|
|
408
|
+
const withChildLayoutStyles = (0, _compose.createHigherOrderComponent)(BlockListBlock => props => {
|
|
409
|
+
var _props$attributes$sty2;
|
|
410
|
+
const layout = (_props$attributes$sty2 = props.attributes.style?.layout) !== null && _props$attributes$sty2 !== void 0 ? _props$attributes$sty2 : {};
|
|
411
|
+
const {
|
|
412
|
+
selfStretch,
|
|
413
|
+
flexSize
|
|
414
|
+
} = layout;
|
|
415
|
+
const hasChildLayout = selfStretch || flexSize;
|
|
416
|
+
const shouldRenderChildLayoutStyles = (0, _data.useSelect)(select => {
|
|
417
|
+
// The callback returns early to avoid block editor subscription.
|
|
418
|
+
if (!hasChildLayout) {
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
return !select(_store.store).getSettings().disableLayoutStyles;
|
|
422
|
+
}, [hasChildLayout]);
|
|
423
|
+
if (!shouldRenderChildLayoutStyles) {
|
|
424
|
+
return (0, _react.createElement)(BlockListBlock, {
|
|
425
|
+
...props
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
return (0, _react.createElement)(BlockWithChildLayoutStyles, {
|
|
429
|
+
block: BlockListBlock,
|
|
430
|
+
props: props
|
|
431
|
+
});
|
|
422
432
|
}, 'withChildLayoutStyles');
|
|
423
433
|
exports.withChildLayoutStyles = withChildLayoutStyles;
|
|
424
434
|
(0, _hooks.addFilter)('blocks.registerBlockType', 'core/layout/addAttribute', addAttribute);
|
|
425
435
|
(0, _hooks.addFilter)('editor.BlockListBlock', 'core/editor/layout/with-layout-styles', withLayoutStyles);
|
|
426
436
|
(0, _hooks.addFilter)('editor.BlockListBlock', 'core/editor/layout/with-child-layout-styles', withChildLayoutStyles);
|
|
427
|
-
(0, _hooks.addFilter)('editor.BlockEdit', 'core/editor/layout/with-inspector-controls',
|
|
437
|
+
(0, _hooks.addFilter)('editor.BlockEdit', 'core/editor/layout/with-inspector-controls', withLayoutControls);
|
|
428
438
|
//# sourceMappingURL=layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_hooks","_blocks","_data","_components","_i18n","_element","_store","_components2","_useSettings","_layouts","_blockEditingMode","_definitions","_object","_utils","_lockUnlock","layoutBlockSupportKey","hasLayoutBlockSupport","blockName","hasBlockSupport","useLayoutClasses","blockAttributes","rootPaddingAlignment","useSelect","select","getSettings","blockEditorStore","__experimentalFeatures","useRootPaddingAwareAlignments","layout","default","defaultBlockLayout","getBlockSupport","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","LAYOUT_DEFINITIONS","className","baseClassName","splitBlockName","split","fullBlockName","pop","join","compoundClassName","push","orientation","kebabCase","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","getLayoutType","blockGapSupport","useSettings","hasBlockGapSupport","css","getLayoutStyle","LayoutPanel","setAttributes","attributes","name","settings","useBlockSettings","allowEditing","allowEditingSetting","defaultThemeLayout","themeSupportsLayout","supportsLayout","blockEditingMode","useBlockEditingMode","layoutBlockSupport","allowSwitching","allowInheriting","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","_react","createElement","Fragment","InspectorControls","PanelBody","title","__","ToggleControl","__nextHasNoMarginBottom","label","checked","onChange","help","LayoutTypeSwitcher","inspectorControls","toolBarControls","ButtonGroup","getLayoutTypes","map","Button","key","isPressed","onClick","addAttribute","_settings$attributes$","withInspectorControls","createHigherOrderComponent","BlockEdit","props","supportLayout","exports","withLayoutStyles","BlockListBlock","blockSupportsLayout","disableLayoutStyles","shouldRenderLayoutStyles","id","useInstanceId","layoutClasses","layoutClassNames","classnames","setStyleOverride","deleteStyleOverride","unlock","useDispatch","useEffect","__unstableLayoutClassNames","withChildLayoutStyles","selfStretch","flexSize","hasChildLayout","shouldRenderChildLayoutStyles","addFilter"],"sources":["@wordpress/block-editor/src/hooks/layout.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport { useSettings } from '../components/use-settings';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { LAYOUT_DEFINITIONS } from '../layouts/definitions';\nimport { kebabCase } from '../utils/object';\nimport { useBlockSettings } from './utils';\nimport { unlock } from '../lock-unlock';\n\nconst layoutBlockSupportKey = 'layout';\n\nfunction hasLayoutBlockSupport( blockName ) {\n\treturn (\n\t\thasBlockSupport( blockName, 'layout' ) ||\n\t\thasBlockSupport( blockName, '__experimentalLayout' )\n\t);\n}\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst rootPaddingAlignment = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalFeatures\n\t\t\t?.useRootPaddingAwareAlignments;\n\t}, [] );\n\tconst { layout } = blockAttributes;\n\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif ( LAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className ) {\n\t\tconst baseClassName =\n\t\t\tLAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className;\n\t\tconst splitBlockName = blockName.split( '/' );\n\t\tconst fullBlockName =\n\t\t\tsplitBlockName[ 0 ] === 'core'\n\t\t\t\t? splitBlockName.pop()\n\t\t\t\t: splitBlockName.join( '-' );\n\t\tconst compoundClassName = `wp-block-${ fullBlockName }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tif (\n\t\t( usedLayout?.inherit ||\n\t\t\tusedLayout?.contentSize ||\n\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\trootPaddingAlignment\n\t) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n\treturn css;\n}\n\nfunction LayoutPanel( { setAttributes, attributes, name: blockName } ) {\n\tconst settings = useBlockSettings( blockName );\n\tconst {\n\t\tlayout: { allowEditing: allowEditingSetting },\n\t} = settings;\n\n\tconst { layout } = attributes;\n\tconst [ defaultThemeLayout ] = useSettings( 'layout' );\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = allowEditingSetting ?? true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = layoutBlockSupport;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t// Only show the inherit toggle if it's supported,\n\t// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t!! defaultThemeLayout &&\n\t\t( ! layout?.type ||\n\t\t\tlayout?.type === 'default' ||\n\t\t\tlayout?.type === 'constrained' ||\n\t\t\tlayout?.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst {\n\t\tinherit = false,\n\t\ttype = 'default',\n\t\tcontentSize = null,\n\t} = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( type === 'default' || type === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( type );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__toggle-control\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasLayoutBlockSupport( settings ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include layout controls\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withInspectorControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst supportLayout = hasLayoutBlockSupport( props.name );\n\n\t\treturn [\n\t\t\tsupportLayout && <LayoutPanel key=\"layout\" { ...props } />,\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withInspectorControls'\n);\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst blockSupportsLayout = hasLayoutBlockSupport( name );\n\t\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\treturn !! getSettings().disableLayoutStyles;\n\t\t} );\n\t\tconst shouldRenderLayoutStyles =\n\t\t\tblockSupportsLayout && ! disableLayoutStyles;\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst { layout } = attributes;\n\t\tconst { default: defaultBlockLayout } =\n\t\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\t\tconst usedLayout =\n\t\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t\t: layout || defaultBlockLayout || {};\n\t\tconst layoutClasses = blockSupportsLayout\n\t\t\t? useLayoutClasses( attributes, name )\n\t\t\t: null;\n\t\t// Higher specificity to override defaults from theme.json.\n\t\tconst selector = `.wp-container-${ id }.wp-container-${ id }`;\n\t\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\t\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t\t// Get CSS string for the current layout type.\n\t\t// The CSS and `style` element is only output if it is not empty.\n\t\tlet css;\n\t\tif ( shouldRenderLayoutStyles ) {\n\t\t\tconst fullLayoutType = getLayoutType(\n\t\t\t\tusedLayout?.type || 'default'\n\t\t\t);\n\t\t\tcss = fullLayoutType?.getLayoutStyle?.( {\n\t\t\t\tblockName: name,\n\t\t\t\tselector,\n\t\t\t\tlayout: usedLayout,\n\t\t\t\tstyle: attributes?.style,\n\t\t\t\thasBlockGapSupport,\n\t\t\t} );\n\t\t}\n\n\t\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\t\tconst layoutClassNames = classnames(\n\t\t\t{\n\t\t\t\t[ `wp-container-${ id }` ]: shouldRenderLayoutStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t\t},\n\t\t\tlayoutClasses\n\t\t);\n\n\t\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\t\tuseDispatch( blockEditorStore )\n\t\t);\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! css ) return;\n\t\t\tsetStyleOverride( selector, { css } );\n\t\t\treturn () => {\n\t\t\t\tdeleteStyleOverride( selector );\n\t\t\t};\n\t\t}, [ selector, css, setStyleOverride, deleteStyleOverride ] );\n\n\t\treturn (\n\t\t\t<BlockListBlock\n\t\t\t\t{ ...props }\n\t\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t\t/>\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\n/**\n * Override the default block element to add the child layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withChildLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { attributes } = props;\n\t\tconst { style: { layout = {} } = {} } = attributes;\n\t\tconst { selfStretch, flexSize } = layout;\n\t\tconst hasChildLayout = selfStretch || flexSize;\n\t\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\treturn !! getSettings().disableLayoutStyles;\n\t\t} );\n\t\tconst shouldRenderChildLayoutStyles =\n\t\t\thasChildLayout && ! disableLayoutStyles;\n\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst selector = `.wp-container-content-${ id }`;\n\n\t\tlet css = '';\n\n\t\tif ( selfStretch === 'fixed' && flexSize ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tflex-basis: ${ flexSize };\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`;\n\t\t} else if ( selfStretch === 'fill' ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`;\n\t\t}\n\n\t\t// Attach a `wp-container-content` id-based classname.\n\t\tconst className = classnames( props?.className, {\n\t\t\t[ `wp-container-content-${ id }` ]:\n\t\t\t\tshouldRenderChildLayoutStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t} );\n\n\t\tconst { setStyleOverride, deleteStyleOverride } = unlock(\n\t\t\tuseDispatch( blockEditorStore )\n\t\t);\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! css ) return;\n\t\t\tsetStyleOverride( selector, { css } );\n\t\t\treturn () => {\n\t\t\t\tdeleteStyleOverride( selector );\n\t\t\t};\n\t\t}, [ selector, css, setStyleOverride, deleteStyleOverride ] );\n\n\t\treturn <BlockListBlock { ...props } className={ className } />;\n\t},\n\t'withChildLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-child-layout-styles',\n\twithChildLayoutStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/layout/with-inspector-controls',\n\twithInspectorControls\n);\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAMA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAZ,OAAA;AACA,IAAAa,YAAA,GAAAb,OAAA;AACA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,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AA6B,gBAAS,EACR,uBAAuB,EACvB,uCAAuC,EACvCrB,gBACD,CAAC;AACD,IAAAqB,gBAAS,EACR,uBAAuB,EACvB,6CAA6C,EAC7CL,qBACD,CAAC;AACD,IAAAK,gBAAS,EACR,kBAAkB,EAClB,4CAA4C,EAC5C3B,qBACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_hooks","_blocks","_data","_components","_i18n","_store","_components2","_useSettings","_layouts","_blockEditingMode","_definitions","_object","_utils","layoutBlockSupportKey","hasLayoutBlockSupport","blockName","hasBlockSupport","useLayoutClasses","blockAttributes","rootPaddingAlignment","useSelect","select","getSettings","blockEditorStore","__experimentalFeatures","useRootPaddingAwareAlignments","layout","default","defaultBlockLayout","getBlockSupport","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","LAYOUT_DEFINITIONS","className","baseClassName","splitBlockName","split","fullBlockName","pop","join","compoundClassName","push","orientation","kebabCase","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","getLayoutType","blockGapSupport","useSettings","hasBlockGapSupport","css","getLayoutStyle","LayoutPanel","setAttributes","attributes","name","settings","useBlockSettings","layoutSettings","defaultThemeLayout","themeSupportsLayout","supportsLayout","blockEditingMode","useBlockEditingMode","layoutBlockSupport","blockSupportAndThemeSettings","allowSwitching","allowEditing","allowInheriting","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","_react","createElement","Fragment","InspectorControls","PanelBody","title","__","ToggleControl","__nextHasNoMarginBottom","label","checked","onChange","help","LayoutTypeSwitcher","inspectorControls","toolBarControls","ButtonGroup","getLayoutTypes","map","Button","key","isPressed","onClick","addAttribute","_settings$attributes$","withLayoutControls","createHigherOrderComponent","BlockEdit","props","supportLayout","exports","BlockWithLayoutStyles","block","BlockListBlock","id","useInstanceId","layoutClasses","layoutClassNames","classnames","useStyleOverride","__unstableLayoutClassNames","withLayoutStyles","blockSupportsLayout","shouldRenderLayoutStyles","disableLayoutStyles","BlockWithChildLayoutStyles","_props$attributes$sty","selfStretch","flexSize","withChildLayoutStyles","_props$attributes$sty2","hasChildLayout","shouldRenderChildLayoutStyles","addFilter"],"sources":["@wordpress/block-editor/src/hooks/layout.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport { useSettings } from '../components/use-settings';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { LAYOUT_DEFINITIONS } from '../layouts/definitions';\nimport { kebabCase } from '../utils/object';\nimport { useBlockSettings, useStyleOverride } from './utils';\n\nconst layoutBlockSupportKey = 'layout';\n\nfunction hasLayoutBlockSupport( blockName ) {\n\treturn (\n\t\thasBlockSupport( blockName, 'layout' ) ||\n\t\thasBlockSupport( blockName, '__experimentalLayout' )\n\t);\n}\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst rootPaddingAlignment = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalFeatures\n\t\t\t?.useRootPaddingAwareAlignments;\n\t}, [] );\n\tconst { layout } = blockAttributes;\n\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif ( LAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className ) {\n\t\tconst baseClassName =\n\t\t\tLAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className;\n\t\tconst splitBlockName = blockName.split( '/' );\n\t\tconst fullBlockName =\n\t\t\tsplitBlockName[ 0 ] === 'core'\n\t\t\t\t? splitBlockName.pop()\n\t\t\t\t: splitBlockName.join( '-' );\n\t\tconst compoundClassName = `wp-block-${ fullBlockName }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tif (\n\t\t( usedLayout?.inherit ||\n\t\t\tusedLayout?.contentSize ||\n\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\trootPaddingAlignment\n\t) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n\treturn css;\n}\n\nfunction LayoutPanel( { setAttributes, attributes, name: blockName } ) {\n\tconst settings = useBlockSettings( blockName );\n\t// Block settings come from theme.json under settings.[blockName].\n\tconst { layout: layoutSettings } = settings;\n\t// Layout comes from block attributes.\n\tconst { layout } = attributes;\n\tconst [ defaultThemeLayout ] = useSettings( 'layout' );\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tif ( blockEditingMode !== 'default' ) {\n\t\treturn null;\n\t}\n\n\t// Layout block support comes from the block's block.json.\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst blockSupportAndThemeSettings = {\n\t\t...layoutSettings,\n\t\t...layoutBlockSupport,\n\t};\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = blockSupportAndThemeSettings;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t// Only show the inherit toggle if it's supported,\n\t// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t!! defaultThemeLayout &&\n\t\t( ! layout?.type ||\n\t\t\tlayout?.type === 'default' ||\n\t\t\tlayout?.type === 'constrained' ||\n\t\t\tlayout?.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst {\n\t\tinherit = false,\n\t\ttype = 'default',\n\t\tcontentSize = null,\n\t} = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( type === 'default' || type === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( type );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__toggle-control\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ blockSupportAndThemeSettings }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasLayoutBlockSupport( settings ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include layout controls\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst supportLayout = hasLayoutBlockSupport( props.name );\n\n\t\treturn [\n\t\t\tsupportLayout && <LayoutPanel key=\"layout\" { ...props } />,\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withLayoutControls'\n);\n\nfunction BlockWithLayoutStyles( { block: BlockListBlock, props } ) {\n\tconst { name, attributes } = props;\n\tconst id = useInstanceId( BlockListBlock );\n\tconst { layout } = attributes;\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\tconst layoutClasses = useLayoutClasses( attributes, name );\n\n\t// Higher specificity to override defaults from theme.json.\n\tconst selector = `.wp-container-${ id }.wp-container-${ id }`;\n\tconst [ blockGapSupport ] = useSettings( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t// Get CSS string for the current layout type.\n\t// The CSS and `style` element is only output if it is not empty.\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName: name,\n\t\tselector,\n\t\tlayout: usedLayout,\n\t\tstyle: attributes?.style,\n\t\thasBlockGapSupport,\n\t} );\n\n\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\tconst layoutClassNames = classnames(\n\t\t{\n\t\t\t[ `wp-container-${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t},\n\t\tlayoutClasses\n\t);\n\n\tuseStyleOverride( { css } );\n\n\treturn (\n\t\t<BlockListBlock\n\t\t\t{ ...props }\n\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t/>\n\t);\n}\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst blockSupportsLayout = hasLayoutBlockSupport( props.name );\n\t\tconst shouldRenderLayoutStyles = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// The callback returns early to avoid block editor subscription.\n\t\t\t\tif ( ! blockSupportsLayout ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn ! select( blockEditorStore ).getSettings()\n\t\t\t\t\t.disableLayoutStyles;\n\t\t\t},\n\t\t\t[ blockSupportsLayout ]\n\t\t);\n\n\t\tif ( ! shouldRenderLayoutStyles ) {\n\t\t\treturn <BlockListBlock { ...props } />;\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockWithLayoutStyles block={ BlockListBlock } props={ props } />\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\nfunction BlockWithChildLayoutStyles( { block: BlockListBlock, props } ) {\n\tconst layout = props.attributes.style?.layout ?? {};\n\tconst { selfStretch, flexSize } = layout;\n\n\tconst id = useInstanceId( BlockListBlock );\n\tconst selector = `.wp-container-content-${ id }`;\n\n\tlet css = '';\n\tif ( selfStretch === 'fixed' && flexSize ) {\n\t\tcss = `${ selector } {\n\t\t\t\tflex-basis: ${ flexSize };\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`;\n\t} else if ( selfStretch === 'fill' ) {\n\t\tcss = `${ selector } {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`;\n\t}\n\n\t// Attach a `wp-container-content` id-based classname.\n\tconst className = classnames( props.className, {\n\t\t[ `wp-container-content-${ id }` ]: !! css, // Only attach a container class if there is generated CSS to be attached.\n\t} );\n\n\tuseStyleOverride( { css } );\n\n\treturn <BlockListBlock { ...props } className={ className } />;\n}\n\n/**\n * Override the default block element to add the child layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withChildLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst layout = props.attributes.style?.layout ?? {};\n\t\tconst { selfStretch, flexSize } = layout;\n\t\tconst hasChildLayout = selfStretch || flexSize;\n\n\t\tconst shouldRenderChildLayoutStyles = useSelect(\n\t\t\t( select ) => {\n\t\t\t\t// The callback returns early to avoid block editor subscription.\n\t\t\t\tif ( ! hasChildLayout ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn ! select( blockEditorStore ).getSettings()\n\t\t\t\t\t.disableLayoutStyles;\n\t\t\t},\n\t\t\t[ hasChildLayout ]\n\t\t);\n\n\t\tif ( ! shouldRenderChildLayoutStyles ) {\n\t\t\treturn <BlockListBlock { ...props } />;\n\t\t}\n\n\t\treturn (\n\t\t\t<BlockWithChildLayoutStyles\n\t\t\t\tblock={ BlockListBlock }\n\t\t\t\tprops={ props }\n\t\t\t/>\n\t\t);\n\t},\n\t'withChildLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-child-layout-styles',\n\twithChildLayoutStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/layout/with-inspector-controls',\n\twithLayoutControls\n);\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAMA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,iBAAA,GAAAX,OAAA;AACA,IAAAY,YAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AA9BA;AACA;AACA;;AAGA;AACA;AACA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,CAAC;AACD,IAAA8B,gBAAS,EACR,uBAAuB,EACvB,uCAAuC,EACvCZ,gBACD,CAAC;AACD,IAAAY,gBAAS,EACR,uBAAuB,EACvB,6CAA6C,EAC7CJ,qBACD,CAAC;AACD,IAAAI,gBAAS,EACR,kBAAkB,EAClB,4CAA4C,EAC5C5B,kBACD,CAAC"}
|
package/build/hooks/position.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.hasStickyOrFixedPositionValue = hasStickyOrFixedPositionValue;
|
|
|
13
13
|
exports.hasStickyPositionSupport = hasStickyPositionSupport;
|
|
14
14
|
exports.resetPosition = resetPosition;
|
|
15
15
|
exports.useIsPositionDisabled = useIsPositionDisabled;
|
|
16
|
-
exports.withPositionStyles = exports.
|
|
16
|
+
exports.withPositionStyles = exports.withPositionControls = void 0;
|
|
17
17
|
var _react = require("react");
|
|
18
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
19
19
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -23,7 +23,6 @@ var _compose = require("@wordpress/compose");
|
|
|
23
23
|
var _data = require("@wordpress/data");
|
|
24
24
|
var _element = require("@wordpress/element");
|
|
25
25
|
var _hooks = require("@wordpress/hooks");
|
|
26
|
-
var _blockList = _interopRequireDefault(require("../components/block-list"));
|
|
27
26
|
var _useSettings = require("../components/use-settings");
|
|
28
27
|
var _inspectorControls = _interopRequireDefault(require("../components/inspector-controls"));
|
|
29
28
|
var _useBlockDisplayInformation = _interopRequireDefault(require("../components/use-block-display-information"));
|
|
@@ -309,7 +308,7 @@ function PositionPanel(props) {
|
|
|
309
308
|
*
|
|
310
309
|
* @return {Function} Wrapped component.
|
|
311
310
|
*/
|
|
312
|
-
const
|
|
311
|
+
const withPositionControls = (0, _compose.createHigherOrderComponent)(BlockEdit => props => {
|
|
313
312
|
const {
|
|
314
313
|
name: blockName
|
|
315
314
|
} = props;
|
|
@@ -323,7 +322,7 @@ const withInspectorControls = (0, _compose.createHigherOrderComponent)(BlockEdit
|
|
|
323
322
|
key: "edit",
|
|
324
323
|
...props
|
|
325
324
|
})];
|
|
326
|
-
}, '
|
|
325
|
+
}, 'withPositionControls');
|
|
327
326
|
|
|
328
327
|
/**
|
|
329
328
|
* Override the default block element to add the position styles.
|
|
@@ -332,7 +331,7 @@ const withInspectorControls = (0, _compose.createHigherOrderComponent)(BlockEdit
|
|
|
332
331
|
*
|
|
333
332
|
* @return {Function} Wrapped component.
|
|
334
333
|
*/
|
|
335
|
-
exports.
|
|
334
|
+
exports.withPositionControls = withPositionControls;
|
|
336
335
|
const withPositionStyles = (0, _compose.createHigherOrderComponent)(BlockListBlock => props => {
|
|
337
336
|
const {
|
|
338
337
|
name,
|
|
@@ -342,7 +341,6 @@ const withPositionStyles = (0, _compose.createHigherOrderComponent)(BlockListBlo
|
|
|
342
341
|
const isPositionDisabled = useIsPositionDisabled(props);
|
|
343
342
|
const allowPositionStyles = hasPositionBlockSupport && !isPositionDisabled;
|
|
344
343
|
const id = (0, _compose.useInstanceId)(BlockListBlock);
|
|
345
|
-
const element = (0, _element.useContext)(_blockList.default.__unstableElementContext);
|
|
346
344
|
|
|
347
345
|
// Higher specificity to override defaults in editor UI.
|
|
348
346
|
const positionSelector = `.wp-container-${id}.wp-container-${id}`;
|
|
@@ -362,12 +360,15 @@ const withPositionStyles = (0, _compose.createHigherOrderComponent)(BlockListBlo
|
|
|
362
360
|
// Only attach a container class if there is generated CSS to be attached.
|
|
363
361
|
[`is-position-${attributes?.style?.position?.type}`]: allowPositionStyles && !!css && !!attributes?.style?.position?.type
|
|
364
362
|
});
|
|
365
|
-
|
|
363
|
+
(0, _utils.useStyleOverride)({
|
|
364
|
+
css
|
|
365
|
+
});
|
|
366
|
+
return (0, _react.createElement)(BlockListBlock, {
|
|
366
367
|
...props,
|
|
367
368
|
className: className
|
|
368
|
-
})
|
|
369
|
+
});
|
|
369
370
|
}, 'withPositionStyles');
|
|
370
371
|
exports.withPositionStyles = withPositionStyles;
|
|
371
372
|
(0, _hooks.addFilter)('editor.BlockListBlock', 'core/editor/position/with-position-styles', withPositionStyles);
|
|
372
|
-
(0, _hooks.addFilter)('editor.BlockEdit', 'core/editor/position/with-inspector-controls',
|
|
373
|
+
(0, _hooks.addFilter)('editor.BlockEdit', 'core/editor/position/with-inspector-controls', withPositionControls);
|
|
373
374
|
//# sourceMappingURL=position.js.map
|