@wordpress/block-editor 14.5.0 → 14.7.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 +0 -8
- package/build/autocompleters/block.js +13 -5
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/block-canvas/index.js +10 -0
- package/build/components/block-canvas/index.js.map +1 -1
- package/build/components/block-card/index.js +2 -2
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-full-height-alignment-control/index.js +1 -1
- package/build/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build/components/block-list/block.js +15 -29
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +1 -7
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +5 -5
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +1 -2
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +4 -3
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
- package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +1 -1
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-patterns-list/index.js +23 -26
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-patterns-paging/index.js +1 -1
- package/build/components/block-patterns-paging/index.js.map +1 -1
- package/build/components/block-popover/index.js +3 -46
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/async.js +51 -0
- package/build/components/block-preview/async.js.map +1 -0
- package/build/components/block-preview/index.js +6 -3
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +5 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js +4 -3
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-toolbar/change-design.js +119 -0
- package/build/components/block-toolbar/change-design.js.map +1 -0
- package/build/components/block-toolbar/index.js +19 -7
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/index.js +16 -19
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +4 -3
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/use-show-block-tools.js +7 -10
- package/build/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +20 -29
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +2 -2
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +6 -10
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +7 -10
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/collab/block-comment-icon-slot.js +18 -0
- package/build/components/collab/block-comment-icon-slot.js.map +1 -0
- package/build/components/collab/block-comment-icon-toolbar-slot.js +18 -0
- package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +4 -4
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/global-styles/color-panel.js +1 -4
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +26 -14
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-context.native.js +6 -0
- package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +4 -4
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +33 -22
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-size-control/index.js +61 -20
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/inner-blocks/index.js +9 -5
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -2
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -3
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/utils.js +5 -1
- package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +15 -2
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
- package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build/components/inserter/menu.js +4 -2
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/search-results.js +0 -2
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter-button/index.native.js +1 -1
- package/build/components/inserter-button/index.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +0 -2
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/utils.js +3 -6
- package/build/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build/components/link-control/link-preview.js +12 -9
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/list-view/appender.js +4 -3
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/branch.js +6 -5
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +1 -2
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/media-placeholder/index.js +4 -4
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/rich-text/event-listeners/index.js +3 -1
- package/build/components/rich-text/event-listeners/index.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +2 -6
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/spacing-sizes-control/index.js +2 -2
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -3
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/linked-button.js +1 -5
- package/build/components/spacing-sizes-control/linked-button.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +1 -1
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/tool-selector/index.js +1 -4
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/url-input/index.js +4 -2
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +6 -7
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +5 -5
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +0 -1
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-moving-animation/index.js +1 -3
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-settings/index.js +1 -3
- package/build/components/use-settings/index.js.map +1 -1
- package/build/components/writing-flow/index.js +5 -3
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +2 -3
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/block-bindings.js +19 -8
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/contrast-checker.js +0 -1
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/duotone.js +2 -2
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +1 -1
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/style.js +4 -1
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +6 -6
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +5 -5
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/use-zoom-out.js +13 -22
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/hooks/utils.js +2 -2
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +0 -7
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/private-apis.js +6 -3
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +2 -33
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +1 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/private-actions.js +57 -8
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +10 -22
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +16 -6
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +53 -15
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +5 -4
- package/build/store/utils.js.map +1 -1
- package/build/utils/dom.js +37 -17
- package/build/utils/dom.js.map +1 -1
- package/build/utils/get-font-styles-and-weights.js +1 -1
- package/build/utils/get-font-styles-and-weights.js.map +1 -1
- package/build/utils/transform-styles/index.js +4 -3
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/autocompleters/block.js +14 -6
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/block-canvas/index.js +11 -1
- package/build-module/components/block-canvas/index.js.map +1 -1
- package/build-module/components/block-card/index.js +3 -3
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-full-height-alignment-control/index.js +1 -1
- package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build-module/components/block-list/block.js +16 -28
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +1 -7
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +5 -5
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +1 -2
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +4 -3
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -6
- package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +23 -26
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-patterns-paging/index.js +1 -1
- package/build-module/components/block-patterns-paging/index.js.map +1 -1
- package/build-module/components/block-popover/index.js +4 -47
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/async.js +44 -0
- package/build-module/components/block-preview/async.js.map +1 -0
- package/build-module/components/block-preview/index.js +6 -3
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +5 -0
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +5 -4
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-toolbar/change-design.js +111 -0
- package/build-module/components/block-toolbar/change-design.js.map +1 -0
- package/build-module/components/block-toolbar/index.js +19 -7
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/index.js +17 -20
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +4 -3
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/use-show-block-tools.js +7 -10
- package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +20 -29
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +2 -2
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +6 -10
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +8 -11
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/collab/block-comment-icon-slot.js +11 -0
- package/build-module/components/collab/block-comment-icon-slot.js.map +1 -0
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js +11 -0
- package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -0
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +4 -4
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +2 -5
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +26 -14
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-context.native.js +6 -0
- package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +4 -4
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +33 -22
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-size-control/index.js +62 -21
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +9 -5
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
- package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +6 -4
- package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
- package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +15 -2
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
- package/build-module/components/inserter/menu.js +5 -3
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/search-results.js +0 -2
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter-button/index.native.js +1 -1
- package/build-module/components/inserter-button/index.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +0 -2
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/utils.js +3 -6
- package/build-module/components/inspector-controls-tabs/utils.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +13 -10
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/list-view/appender.js +4 -3
- package/build-module/components/list-view/appender.js.map +1 -1
- package/build-module/components/list-view/branch.js +7 -6
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +1 -2
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +4 -4
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/index.js +4 -2
- package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +2 -6
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/spacing-sizes-control/index.js +3 -3
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/linked-button.js +2 -6
- package/build-module/components/spacing-sizes-control/linked-button.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +1 -1
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +1 -4
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/url-input/index.js +4 -2
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +5 -5
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +5 -5
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +0 -1
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +1 -3
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +1 -3
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/components/writing-flow/index.js +5 -3
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +2 -3
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/block-bindings.js +20 -9
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/contrast-checker.js +0 -1
- package/build-module/hooks/contrast-checker.js.map +1 -1
- package/build-module/hooks/duotone.js +2 -2
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +1 -1
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/style.js +4 -1
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +6 -6
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +5 -5
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +15 -23
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/hooks/utils.js +2 -2
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/private-apis.js +7 -5
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +2 -33
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +1 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/private-actions.js +54 -7
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +10 -21
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +16 -6
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +54 -16
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +3 -3
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/dom.js +35 -16
- package/build-module/utils/dom.js.map +1 -1
- package/build-module/utils/get-font-styles-and-weights.js +2 -2
- package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +3 -2
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +16 -10
- package/build-style/content.css +16 -10
- package/build-style/style-rtl.css +47 -25
- package/build-style/style.css +47 -25
- package/build-types/utils/dom.d.ts +7 -9
- package/build-types/utils/dom.d.ts.map +1 -1
- package/package.json +34 -32
- package/src/autocompleters/block.js +16 -7
- package/src/components/block-canvas/index.js +17 -1
- package/src/components/block-canvas/style.scss +3 -1
- package/src/components/block-card/index.js +3 -3
- package/src/components/block-full-height-alignment-control/index.js +1 -1
- package/src/components/block-inspector/style.scss +2 -7
- package/src/components/block-list/block.js +29 -50
- package/src/components/block-list/block.native.js +0 -4
- package/src/components/block-list/content.scss +1 -1
- package/src/components/block-list/index.js +4 -4
- package/src/components/block-list/use-block-props/index.js +0 -2
- package/src/components/block-list/use-block-props/use-focus-first-element.js +5 -3
- package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +7 -20
- package/src/components/block-list/use-in-between-inserter.js +1 -1
- package/src/components/block-patterns-list/README.md +8 -8
- package/src/components/block-patterns-list/index.js +35 -51
- package/src/components/block-patterns-list/stories/fixtures.js +834 -0
- package/src/components/block-patterns-list/stories/index.story.js +64 -0
- package/src/components/block-patterns-list/style.scss +2 -0
- package/src/components/block-patterns-paging/index.js +1 -1
- package/src/components/block-popover/index.js +4 -66
- package/src/components/block-preview/async.js +43 -0
- package/src/components/block-preview/index.js +8 -3
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -0
- package/src/components/block-settings-menu/index.js +3 -0
- package/src/components/block-toolbar/change-design.js +127 -0
- package/src/components/block-toolbar/index.js +25 -8
- package/src/components/block-toolbar/style.scss +16 -0
- package/src/components/block-tools/index.js +30 -27
- package/src/components/block-tools/insertion-point.js +4 -3
- package/src/components/block-tools/style.scss +12 -20
- package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
- package/src/components/block-tools/use-show-block-tools.js +3 -14
- package/src/components/block-tools/zoom-out-mode-inserters.js +25 -40
- package/src/components/block-variation-transforms/index.js +2 -2
- package/src/components/block-vertical-alignment-control/ui.js +11 -15
- package/src/components/border-radius-control/linked-button.js +9 -11
- package/src/components/collab/block-comment-icon-slot.js +12 -0
- package/src/components/collab/block-comment-icon-toolbar-slot.js +12 -0
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +7 -1
- package/src/components/convert-to-group-buttons/toolbar.js +4 -4
- package/src/components/default-block-appender/content.scss +13 -19
- package/src/components/global-styles/color-panel.js +2 -10
- package/src/components/global-styles/dimensions-panel.js +22 -16
- package/src/components/global-styles/test/use-global-styles-context.native.js +1 -0
- package/src/components/global-styles/use-global-styles-context.native.js +6 -0
- package/src/components/iframe/content.scss +4 -9
- package/src/components/iframe/get-compatibility-styles.js +4 -9
- package/src/components/iframe/index.js +48 -34
- package/src/components/iframe/style.scss +2 -3
- package/src/components/image-size-control/index.js +74 -43
- package/src/components/image-size-control/test/index.js +5 -63
- package/src/components/inner-blocks/index.js +12 -6
- package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
- package/src/components/inserter/block-patterns-tab/index.js +0 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -4
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +1 -1
- package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
- package/src/components/inserter/block-patterns-tab/utils.js +5 -0
- package/src/components/inserter/category-tabs/index.js +16 -2
- package/src/components/inserter/hooks/use-block-types-state.js +6 -1
- package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
- package/src/components/inserter/menu.js +6 -4
- package/src/components/inserter/search-results.js +0 -6
- package/src/components/inserter/style.scss +13 -0
- package/src/components/inserter-button/index.native.js +1 -1
- package/src/components/inspector-controls-tabs/index.js +1 -6
- package/src/components/inspector-controls-tabs/utils.js +0 -3
- package/src/components/link-control/link-preview.js +15 -8
- package/src/components/link-control/test/index.js +63 -24
- package/src/components/list-view/appender.js +5 -6
- package/src/components/list-view/branch.js +8 -6
- package/src/components/list-view/index.js +1 -2
- package/src/components/media-placeholder/index.js +4 -4
- package/src/components/provider/index.js +1 -3
- package/src/components/provider/test/experimental-provider.js +43 -1
- package/src/components/rich-text/event-listeners/index.js +4 -2
- package/src/components/rich-text/index.js +8 -1
- package/src/components/rich-text/index.native.js +0 -2
- package/src/components/spacing-sizes-control/index.js +3 -3
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
- package/src/components/spacing-sizes-control/linked-button.js +2 -12
- package/src/components/tabbed-sidebar/index.js +1 -1
- package/src/components/tabbed-sidebar/style.scss +1 -1
- package/src/components/tool-selector/index.js +1 -5
- package/src/components/url-input/index.js +4 -5
- package/src/components/use-block-commands/index.js +245 -234
- package/src/components/use-block-drop-zone/index.js +5 -5
- package/src/components/use-block-drop-zone/index.native.js +0 -1
- package/src/components/use-moving-animation/index.js +0 -1
- package/src/components/use-settings/index.js +0 -1
- package/src/components/writing-flow/index.js +5 -3
- package/src/components/writing-flow/use-tab-nav.js +1 -2
- package/src/hooks/block-bindings.js +48 -31
- package/src/hooks/contrast-checker.js +0 -1
- package/src/hooks/duotone.js +2 -2
- package/src/hooks/font-family.js +1 -1
- package/src/hooks/style.js +7 -3
- package/src/hooks/supports.js +6 -6
- package/src/hooks/typography.js +5 -5
- package/src/hooks/use-zoom-out.js +14 -34
- package/src/hooks/utils.js +7 -2
- package/src/index.js +0 -1
- package/src/private-apis.js +6 -3
- package/src/store/actions.js +3 -52
- package/src/store/defaults.js +2 -1
- package/src/store/private-actions.js +71 -8
- package/src/store/private-selectors.js +14 -25
- package/src/store/reducer.js +25 -11
- package/src/store/selectors.js +116 -53
- package/src/store/test/actions.js +41 -0
- package/src/store/test/private-selectors.js +5 -0
- package/src/store/test/reducer.js +23 -0
- package/src/store/utils.js +12 -11
- package/src/utils/dom.js +42 -17
- package/src/utils/get-font-styles-and-weights.js +2 -2
- package/src/utils/test/dom.js +224 -0
- package/src/utils/transform-styles/index.js +3 -2
- package/tsconfig.json +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -57
- package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
- package/build/components/block-toolbar/shuffle.js +0 -110
- package/build/components/block-toolbar/shuffle.js.map +0 -1
- package/build/components/block-tools/zoom-out-popover.js +0 -58
- package/build/components/block-tools/zoom-out-popover.js.map +0 -1
- package/build/components/block-tools/zoom-out-toolbar.js +0 -132
- package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
- package/build/components/block-vertical-alignment-control/icons.js +0 -48
- package/build/components/block-vertical-alignment-control/icons.js.map +0 -1
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -51
- package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +0 -1
- package/build-module/components/block-toolbar/shuffle.js +0 -103
- package/build-module/components/block-toolbar/shuffle.js.map +0 -1
- package/build-module/components/block-tools/zoom-out-popover.js +0 -49
- package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +0 -124
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
- package/build-module/components/block-vertical-alignment-control/icons.js +0 -41
- package/build-module/components/block-vertical-alignment-control/icons.js.map +0 -1
- package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +0 -65
- package/src/components/block-toolbar/shuffle.js +0 -111
- package/src/components/block-tools/zoom-out-popover.js +0 -47
- package/src/components/block-tools/zoom-out-toolbar.js +0 -135
- package/src/components/block-vertical-alignment-control/icons.js +0 -34
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_changeCase","require","_reactNative","_colord","_compose","_element","_components","_useMultipleOriginColorsAndGradients","_interopRequireDefault","_useSettings","_defaults","BLOCK_STYLE_ATTRIBUTES","GlobalStylesContext","exports","createContext","style","BLOCK_STYLE_ATTRIBUTES_MAPPING","textColor","text","background","link","placeholder","PADDING","UNKNOWN_VALUE","DEFAULT_FONT_SIZE","getBlockPaddings","mergedStyle","wrapperPropsStyle","blockStyleAttributes","blockColors","blockPaddings","padding","backgroundColor","undefined","getBlockColors","defaultColors","blockName","baseGlobalStyles","blockStyles","customBlockStyles","color","blockGlobalStyles","blocks","Object","entries","forEach","key","value","styleKey","_customBlockStyles$ke","styles","elements","linkColor","isCustomColor","startsWith","mappedColor","values","find","slug","getBlockTypography","fontSizes","typographyStyles","typography","parsedFontSizes","fontSize","lineHeight","parseInt","mappedFontSize","size","getValueFromObjectPath","object","path","fieldName","parseStylesVariables","mappedValues","customValues","stylesBase","variables","variable","regex","RegExp","varRegex","fontSizeRegex","replace","_$1","$2","split","mappedPresetValue","_mappedPresetValue$va","matchedValue","customValuesData","JSON","parse","colorKey","length","reduce","prev","curr","slice","camelCase","width","height","Dimensions","get","parsedFontSize","getPxFromCssUnit","getMappedValues","features","palette","colors","theme","custom","default","normalizeFontSizes","dimensions","normalizedFontSizes","keysToProcess","push","map","fontSizeObject","sizePx","useMobileGlobalStylesColors","type","colorGradientSettings","useMultipleOriginColorsAndGradients","availableThemeColors","origin","concat","defaultPaletteSetting","defaultPaletteValue","useSettings","defaultPalette","SETTINGS_DEFAULTS","getColorsAndGradients","defaultEditorColors","defaultEditorGradients","rawFeatures","__experimentalGlobalStylesBaseStyles","__experimentalFeatures","gradients","defaultGradients","getGlobalStyles","rawStyles","_features$color$text","_features$color$backg","_features$color$defau","_features$color$defau2","stringify","globalStyles","customLineHeight","spacing","getMergedGlobalStyles","globalStyle","blockAttributes","baseGlobalColors","baseColors","fromEntries","filter","includes","wrapperPropsStyleFiltered","blockTypography","useGlobalStyles","useContext","useEditorColorScheme","baseStyle","darkStyle","deviceColorScheme","usePreferredColorSchemeStyle","editorColors","editorBackgroundColor","isBackgroundColorDefined","isEditorBackgroundDark","colord","isDark"],"sources":["@wordpress/block-editor/src/components/global-styles/use-global-styles-context.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { camelCase } from 'change-case';\nimport { Dimensions } from 'react-native';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { createContext, useContext } from '@wordpress/element';\nimport { getPxFromCssUnit } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport useMultipleOriginColorsAndGradients from '../colors-gradients/use-multiple-origin-colors-and-gradients';\nimport { useSettings } from '../use-settings';\nimport { SETTINGS_DEFAULTS } from '../../store/defaults';\n\nconst BLOCK_STYLE_ATTRIBUTES = [\n\t'textColor',\n\t'backgroundColor',\n\t'style',\n\t'color',\n\t'fontSize',\n];\n\nexport const GlobalStylesContext = createContext( { style: {} } );\nGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES = BLOCK_STYLE_ATTRIBUTES;\n\n// Mapping style properties name to native.\nconst BLOCK_STYLE_ATTRIBUTES_MAPPING = {\n\ttextColor: 'color',\n\ttext: 'color',\n\tbackground: 'backgroundColor',\n\tlink: 'linkColor',\n\tplaceholder: 'placeholderColor',\n};\n\nconst PADDING = 12; // $solid-border-space\nconst UNKNOWN_VALUE = 'undefined';\nconst DEFAULT_FONT_SIZE = 16;\n\nexport function getBlockPaddings(\n\tmergedStyle,\n\twrapperPropsStyle,\n\tblockStyleAttributes,\n\tblockColors\n) {\n\tconst blockPaddings = {};\n\n\tif (\n\t\t! mergedStyle.padding &&\n\t\t( wrapperPropsStyle?.backgroundColor ||\n\t\t\tblockStyleAttributes?.backgroundColor ||\n\t\t\tblockColors?.backgroundColor )\n\t) {\n\t\tblockPaddings.padding = PADDING;\n\t\treturn blockPaddings;\n\t}\n\n\t// Prevent adding extra paddings to inner blocks without background colors.\n\tif (\n\t\tmergedStyle?.padding &&\n\t\t! wrapperPropsStyle?.backgroundColor &&\n\t\t! blockStyleAttributes?.backgroundColor &&\n\t\t! blockColors?.backgroundColor\n\t) {\n\t\tblockPaddings.padding = undefined;\n\t}\n\n\treturn blockPaddings;\n}\n\nexport function getBlockColors(\n\tblockStyleAttributes,\n\tdefaultColors,\n\tblockName,\n\tbaseGlobalStyles\n) {\n\tconst blockStyles = {};\n\tconst customBlockStyles = blockStyleAttributes?.style?.color || {};\n\tconst blockGlobalStyles = baseGlobalStyles?.blocks?.[ blockName ];\n\n\t// Global styles colors.\n\tif ( blockGlobalStyles?.color ) {\n\t\tObject.entries( blockGlobalStyles.color ).forEach(\n\t\t\t( [ key, value ] ) => {\n\t\t\t\tconst styleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING[ key ];\n\n\t\t\t\tif ( styleKey && value !== UNKNOWN_VALUE ) {\n\t\t\t\t\tconst color = customBlockStyles[ key ] ?? value;\n\t\t\t\t\tblockStyles[ styleKey ] = color;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t} else if ( baseGlobalStyles?.styles?.color?.text ) {\n\t\tblockStyles[ BLOCK_STYLE_ATTRIBUTES_MAPPING.text ] =\n\t\t\tbaseGlobalStyles?.styles?.color?.text;\n\t}\n\n\t// Global styles elements.\n\tif ( blockGlobalStyles?.elements ) {\n\t\tconst linkColor = blockGlobalStyles.elements?.link?.color?.text;\n\t\tconst styleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING.link;\n\n\t\tif ( styleKey && linkColor && linkColor !== UNKNOWN_VALUE ) {\n\t\t\tblockStyles[ styleKey ] = linkColor;\n\t\t}\n\t}\n\n\t// Custom colors.\n\tObject.entries( blockStyleAttributes ).forEach( ( [ key, value ] ) => {\n\t\tconst isCustomColor = value?.startsWith?.( '#' );\n\t\tlet styleKey = key;\n\n\t\tif ( BLOCK_STYLE_ATTRIBUTES_MAPPING[ styleKey ] ) {\n\t\t\tstyleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING[ styleKey ];\n\t\t}\n\n\t\tif ( ! isCustomColor ) {\n\t\t\tconst mappedColor = Object.values( defaultColors ?? {} ).find(\n\t\t\t\t( { slug } ) => slug === value\n\t\t\t);\n\n\t\t\tif ( mappedColor ) {\n\t\t\t\tblockStyles[ styleKey ] = mappedColor.color;\n\t\t\t}\n\t\t} else {\n\t\t\tblockStyles[ styleKey ] = value;\n\t\t}\n\t} );\n\n\t// Color placeholder.\n\tif ( blockStyles?.color ) {\n\t\tblockStyles[ BLOCK_STYLE_ATTRIBUTES_MAPPING.placeholder ] =\n\t\t\tblockStyles.color;\n\t}\n\n\treturn blockStyles;\n}\n\nfunction getBlockTypography(\n\tblockStyleAttributes,\n\tfontSizes,\n\tblockName,\n\tbaseGlobalStyles\n) {\n\tconst typographyStyles = {};\n\tconst customBlockStyles = blockStyleAttributes?.style?.typography || {};\n\tconst blockGlobalStyles = baseGlobalStyles?.blocks?.[ blockName ];\n\tconst parsedFontSizes = Object.values( fontSizes ?? {} );\n\n\t// Global styles.\n\tif ( blockGlobalStyles?.typography ) {\n\t\tconst fontSize = blockGlobalStyles?.typography?.fontSize;\n\t\tconst lineHeight = blockGlobalStyles?.typography?.lineHeight;\n\n\t\tif ( fontSize ) {\n\t\t\tif ( parseInt( fontSize, 10 ) ) {\n\t\t\t\ttypographyStyles.fontSize = fontSize;\n\t\t\t} else {\n\t\t\t\tconst mappedFontSize = parsedFontSizes.find(\n\t\t\t\t\t( { slug } ) => slug === fontSize\n\t\t\t\t);\n\n\t\t\t\tif ( mappedFontSize ) {\n\t\t\t\t\ttypographyStyles.fontSize = mappedFontSize?.size;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( lineHeight ) {\n\t\t\ttypographyStyles.lineHeight = lineHeight;\n\t\t}\n\t}\n\n\tif ( blockStyleAttributes?.fontSize && baseGlobalStyles ) {\n\t\tconst mappedFontSize = parsedFontSizes.find(\n\t\t\t( { slug } ) => slug === blockStyleAttributes?.fontSize\n\t\t);\n\n\t\tif ( mappedFontSize ) {\n\t\t\ttypographyStyles.fontSize = mappedFontSize?.size;\n\t\t}\n\t}\n\n\t// Custom styles.\n\tif ( customBlockStyles?.fontSize ) {\n\t\ttypographyStyles.fontSize = customBlockStyles?.fontSize;\n\t}\n\n\tif ( customBlockStyles?.lineHeight ) {\n\t\ttypographyStyles.lineHeight = customBlockStyles?.lineHeight;\n\t}\n\n\treturn typographyStyles;\n}\n\n/**\n * Return a value from a certain path of the object.\n * Path is specified as an array of properties, like: [ 'parent', 'child' ].\n *\n * @param {Object} object Input object.\n * @param {Array} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nexport function parseStylesVariables( styles, mappedValues, customValues ) {\n\tlet stylesBase = styles;\n\tconst variables = [ 'preset', 'custom', 'var', 'fontSize' ];\n\n\tif ( ! stylesBase ) {\n\t\treturn styles;\n\t}\n\n\tvariables.forEach( ( variable ) => {\n\t\t// Examples\n\t\t// var(--wp--preset--color--gray)\n\t\t// var(--wp--custom--body--typography--font-family)\n\t\t// var:preset|color|custom-color-2\n\t\tconst regex = new RegExp( `var\\\\(--wp--${ variable }--(.*?)\\\\)`, 'g' );\n\t\tconst varRegex = /\\\"var:preset\\|color\\|(.*?)\\\"/gm;\n\t\tconst fontSizeRegex = /\"fontSize\":\"(.*?)\"/gm;\n\n\t\tif ( variable === 'preset' ) {\n\t\t\tstylesBase = stylesBase.replace( regex, ( _$1, $2 ) => {\n\t\t\t\tconst path = $2.split( '--' );\n\t\t\t\tconst mappedPresetValue = mappedValues[ path[ 0 ] ];\n\t\t\t\tif ( mappedPresetValue && mappedPresetValue.slug ) {\n\t\t\t\t\tconst matchedValue = Object.values(\n\t\t\t\t\t\tmappedPresetValue.values ?? {}\n\t\t\t\t\t).find( ( { slug } ) => slug === path[ 1 ] );\n\t\t\t\t\treturn matchedValue?.[ mappedPresetValue.slug ];\n\t\t\t\t}\n\t\t\t\treturn UNKNOWN_VALUE;\n\t\t\t} );\n\t\t}\n\t\tif ( variable === 'custom' ) {\n\t\t\tconst customValuesData = customValues ?? JSON.parse( stylesBase );\n\t\t\tstylesBase = stylesBase.replace( regex, ( _$1, $2 ) => {\n\t\t\t\tconst path = $2.split( '--' );\n\n\t\t\t\t// Supports cases for variables like var(--wp--custom--color--background)\n\t\t\t\tif ( path[ 0 ] === 'color' ) {\n\t\t\t\t\tconst colorKey = path[ path.length - 1 ];\n\t\t\t\t\tif ( mappedValues?.color ) {\n\t\t\t\t\t\tconst matchedValue = mappedValues.color?.values?.find(\n\t\t\t\t\t\t\t( { slug } ) => slug === colorKey\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( matchedValue ) {\n\t\t\t\t\t\t\treturn `${ matchedValue?.color }`;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tpath.reduce(\n\t\t\t\t\t\t( prev, curr ) => prev && prev[ curr ],\n\t\t\t\t\t\tcustomValuesData\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn getValueFromObjectPath( customValuesData, path );\n\t\t\t\t}\n\n\t\t\t\t// Check for camelcase properties.\n\t\t\t\treturn getValueFromObjectPath( customValuesData, [\n\t\t\t\t\t...path.slice( 0, path.length - 1 ),\n\t\t\t\t\tcamelCase( path[ path.length - 1 ] ),\n\t\t\t\t] );\n\t\t\t} );\n\t\t}\n\n\t\tif ( variable === 'var' ) {\n\t\t\tstylesBase = stylesBase.replace( varRegex, ( _$1, $2 ) => {\n\t\t\t\tif ( mappedValues?.color ) {\n\t\t\t\t\tconst matchedValue = mappedValues.color?.values?.find(\n\t\t\t\t\t\t( { slug } ) => slug === $2\n\t\t\t\t\t);\n\t\t\t\t\treturn `\"${ matchedValue?.color }\"`;\n\t\t\t\t}\n\t\t\t\treturn UNKNOWN_VALUE;\n\t\t\t} );\n\t\t}\n\n\t\tif ( variable === 'fontSize' ) {\n\t\t\tconst { width, height } = Dimensions.get( 'window' );\n\n\t\t\tstylesBase = stylesBase.replace( fontSizeRegex, ( _$1, $2 ) => {\n\t\t\t\tconst parsedFontSize =\n\t\t\t\t\tgetPxFromCssUnit( $2, {\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\theight,\n\t\t\t\t\t\tfontSize: DEFAULT_FONT_SIZE,\n\t\t\t\t\t} ) || `${ DEFAULT_FONT_SIZE }px`;\n\n\t\t\t\treturn `\"fontSize\":\"${ parsedFontSize }\"`;\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn JSON.parse( stylesBase );\n}\n\nfunction getMappedValues( features, palette ) {\n\tconst typography = features?.typography;\n\tconst colors = [\n\t\t...( palette?.theme || [] ),\n\t\t...( palette?.custom || [] ),\n\t\t...( palette?.default || [] ),\n\t];\n\n\tconst fontSizes = {\n\t\t...typography?.fontSizes?.theme,\n\t\t...typography?.fontSizes?.custom,\n\t};\n\tconst mappedValues = {\n\t\tcolor: {\n\t\t\tvalues: colors,\n\t\t\tslug: 'color',\n\t\t},\n\t\t'font-size': {\n\t\t\tvalues: fontSizes,\n\t\t\tslug: 'size',\n\t\t},\n\t};\n\treturn mappedValues;\n}\n\n/**\n * Returns the normalized fontSizes to include the sizePx value for each of the different sizes.\n *\n * @param {Object} fontSizes found in global styles.\n * @return {Object} normalized sizes.\n */\nfunction normalizeFontSizes( fontSizes ) {\n\tif ( ! fontSizes ) {\n\t\treturn fontSizes;\n\t}\n\n\tconst dimensions = Dimensions.get( 'window' );\n\tconst normalizedFontSizes = {};\n\tconst keysToProcess = [];\n\n\t// Check if 'theme' or 'custom' keys exist and add them to keysToProcess array\n\tif ( fontSizes?.theme ) {\n\t\tkeysToProcess.push( 'theme' );\n\t}\n\tif ( fontSizes?.custom ) {\n\t\tkeysToProcess.push( 'custom' );\n\t}\n\n\t// If neither 'theme' nor 'custom' exist, add 'default' if it exists\n\tif ( keysToProcess.length === 0 && fontSizes?.default ) {\n\t\tkeysToProcess.push( 'default' );\n\t}\n\n\tkeysToProcess.forEach( ( key ) => {\n\t\tnormalizedFontSizes[ key ] = fontSizes[ key ].map(\n\t\t\t( fontSizeObject ) => {\n\t\t\t\tfontSizeObject.sizePx = getPxFromCssUnit( fontSizeObject.size, {\n\t\t\t\t\twidth: dimensions.width,\n\t\t\t\t\theight: dimensions.height,\n\t\t\t\t\tfontSize: DEFAULT_FONT_SIZE,\n\t\t\t\t} );\n\t\t\t\treturn fontSizeObject;\n\t\t\t}\n\t\t);\n\t} );\n\n\treturn normalizedFontSizes;\n}\n\nexport function useMobileGlobalStylesColors( type = 'colors' ) {\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\tconst availableThemeColors = colorGradientSettings?.[ type ]?.reduce(\n\t\t( colors, origin ) => colors.concat( origin?.[ type ] ),\n\t\t[]\n\t);\n\t// Default editor colors/gradients if it's not a block-based theme.\n\tconst defaultPaletteSetting =\n\t\ttype === 'colors' ? 'color.palette' : 'color.gradients';\n\tconst [ defaultPaletteValue ] = useSettings( defaultPaletteSetting );\n\t// In edge cases, the default palette might be undefined. To avoid\n\t// exceptions across the editor in that case, we explicitly return\n\t// the default editor colors.\n\tconst defaultPalette = defaultPaletteValue ?? SETTINGS_DEFAULTS.colors;\n\n\treturn availableThemeColors.length >= 1\n\t\t? availableThemeColors\n\t\t: defaultPalette;\n}\n\nexport function getColorsAndGradients(\n\tdefaultEditorColors = [],\n\tdefaultEditorGradients = [],\n\trawFeatures\n) {\n\tconst features = rawFeatures ? JSON.parse( rawFeatures ) : {};\n\n\treturn {\n\t\t__experimentalGlobalStylesBaseStyles: null,\n\t\t__experimentalFeatures: {\n\t\t\tcolor: {\n\t\t\t\t...( ! features?.color\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttext: true,\n\t\t\t\t\t\t\tbackground: true,\n\t\t\t\t\t\t\tpalette: {\n\t\t\t\t\t\t\t\tdefault: defaultEditorColors,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgradients: {\n\t\t\t\t\t\t\t\tdefault: defaultEditorGradients,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: features?.color ),\n\t\t\t\tdefaultPalette: defaultEditorColors?.length > 0,\n\t\t\t\tdefaultGradients: defaultEditorGradients?.length > 0,\n\t\t\t},\n\t\t},\n\t};\n}\n\nexport function getGlobalStyles( rawStyles, rawFeatures ) {\n\tconst features = rawFeatures ? JSON.parse( rawFeatures ) : {};\n\tconst mappedValues = getMappedValues( features, features?.color?.palette );\n\tconst colors = parseStylesVariables(\n\t\tJSON.stringify( features?.color ),\n\t\tmappedValues\n\t);\n\tconst gradients = parseStylesVariables(\n\t\tJSON.stringify( features?.color?.gradients ),\n\t\tmappedValues\n\t);\n\tconst customValues = parseStylesVariables(\n\t\tJSON.stringify( features?.custom ),\n\t\tmappedValues\n\t);\n\tconst globalStyles = parseStylesVariables(\n\t\trawStyles,\n\t\tmappedValues,\n\t\tcustomValues\n\t);\n\n\tconst fontSizes = normalizeFontSizes( features?.typography?.fontSizes );\n\n\treturn {\n\t\t__experimentalFeatures: {\n\t\t\tcolor: {\n\t\t\t\tpalette: colors?.palette,\n\t\t\t\tgradients,\n\t\t\t\ttext: features?.color?.text ?? true,\n\t\t\t\tbackground: features?.color?.background ?? true,\n\t\t\t\tdefaultPalette: features?.color?.defaultPalette ?? true,\n\t\t\t\tdefaultGradients: features?.color?.defaultGradients ?? true,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontSizes,\n\t\t\t\tcustomLineHeight: features?.custom?.[ 'line-height' ],\n\t\t\t},\n\t\t\tspacing: features?.spacing,\n\t\t},\n\t\t__experimentalGlobalStylesBaseStyles: globalStyles,\n\t};\n}\n\nexport const getMergedGlobalStyles = (\n\tbaseGlobalStyles,\n\tglobalStyle,\n\twrapperPropsStyle,\n\tblockAttributes,\n\tdefaultColors,\n\tblockName,\n\tfontSizes\n) => {\n\t// Current support for general styles and blocks.\n\tconst baseGlobalColors = {\n\t\tbaseColors: {\n\t\t\tcolor: baseGlobalStyles?.color,\n\t\t\ttypography: baseGlobalStyles?.typography,\n\t\t\telements: {\n\t\t\t\tlink: baseGlobalStyles?.elements?.link,\n\t\t\t},\n\t\t\tblocks: {\n\t\t\t\t'core/button': baseGlobalStyles?.blocks?.[ 'core/button' ],\n\t\t\t},\n\t\t},\n\t};\n\n\tconst blockStyleAttributes = Object.fromEntries(\n\t\tObject.entries( blockAttributes ?? {} ).filter( ( [ key ] ) =>\n\t\t\tBLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t)\n\t);\n\n\t// This prevents certain wrapper styles from being applied to blocks that\n\t// don't support them yet.\n\tconst wrapperPropsStyleFiltered = Object.fromEntries(\n\t\tObject.entries( wrapperPropsStyle ?? {} ).filter( ( [ key ] ) =>\n\t\t\tBLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t)\n\t);\n\n\tconst mergedStyle = {\n\t\t...baseGlobalColors,\n\t\t...globalStyle,\n\t\t...wrapperPropsStyleFiltered,\n\t};\n\tconst blockColors = getBlockColors(\n\t\tblockStyleAttributes,\n\t\tdefaultColors,\n\t\tblockName,\n\t\tbaseGlobalStyles\n\t);\n\tconst blockPaddings = getBlockPaddings(\n\t\tmergedStyle,\n\t\twrapperPropsStyle,\n\t\tblockStyleAttributes,\n\t\tblockColors\n\t);\n\tconst blockTypography = getBlockTypography(\n\t\tblockStyleAttributes,\n\t\tfontSizes,\n\t\tblockName,\n\t\tbaseGlobalStyles\n\t);\n\n\treturn {\n\t\t...mergedStyle,\n\t\t...blockPaddings,\n\t\t...blockColors,\n\t\t...blockTypography,\n\t};\n};\n\nexport const useGlobalStyles = () => {\n\tconst globalStyles = useContext( GlobalStylesContext );\n\n\treturn globalStyles;\n};\n\n/**\n * Determine and apply appropriate color scheme based on global styles or device's light/dark mode.\n *\n * The function first attempts to retrieve the editor's background color from global styles.\n * If the detected background color is light, light styles are applied, and dark styles otherwise.\n * If no custom background color is defined, styles are applied using the device's dark/light setting.\n *\n * @param {Object} baseStyle - An object representing the base (light theme) styles for the editor.\n * @param {Object} darkStyle - An object representing the additional styles to apply when the editor is in dark mode.\n *\n * @return {Object} - The combined style object that should be applied to the editor.\n */\nexport const useEditorColorScheme = ( baseStyle, darkStyle ) => {\n\tconst globalStyles = useGlobalStyles();\n\n\tconst deviceColorScheme = usePreferredColorSchemeStyle(\n\t\tbaseStyle,\n\t\tdarkStyle\n\t);\n\n\tconst editorColors = globalStyles?.baseColors?.color;\n\tconst editorBackgroundColor = editorColors?.background;\n\n\tconst isBackgroundColorDefined =\n\t\ttypeof editorBackgroundColor !== 'undefined' &&\n\t\teditorBackgroundColor !== 'undefined';\n\n\tif ( isBackgroundColorDefined ) {\n\t\tconst isEditorBackgroundDark = colord( editorBackgroundColor ).isDark();\n\t\treturn isEditorBackgroundDark\n\t\t\t? { ...baseStyle, ...darkStyle }\n\t\t\t: baseStyle;\n\t}\n\n\treturn deviceColorScheme;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAKA,IAAAM,oCAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AAnBA;AACA;AACA;;AAKA;AACA;AACA;;AAKA;AACA;AACA;;AAKA,MAAMU,sBAAsB,GAAG,CAC9B,WAAW,EACX,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,UAAU,CACV;AAEM,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,sBAAa,EAAE;EAAEC,KAAK,EAAE,CAAC;AAAE,CAAE,CAAC;AACjEH,mBAAmB,CAACD,sBAAsB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AAMC,sBAAsB,GAAG,IAAAC,cAAM,EAAEH,qBAAsB,CAAC,CAACI,MAAM,CAAC,CAAC;IACvE,OAAOF,sBAAsB,GAC1B;MAAE,GAAGP,SAAS;MAAE,GAAGC;IAAU,CAAC,GAC9BD,SAAS;EACb;EAEA,OAAOE,iBAAiB;AACzB,CAAC;AAACzJ,OAAA,CAAAsJ,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_changeCase","require","_reactNative","_colord","_compose","_element","_components","_useMultipleOriginColorsAndGradients","_interopRequireDefault","_useSettings","_defaults","BLOCK_STYLE_ATTRIBUTES","GlobalStylesContext","exports","createContext","style","BLOCK_STYLE_ATTRIBUTES_MAPPING","textColor","text","background","link","placeholder","PADDING","UNKNOWN_VALUE","DEFAULT_FONT_SIZE","getBlockPaddings","mergedStyle","wrapperPropsStyle","blockStyleAttributes","blockColors","blockPaddings","padding","backgroundColor","undefined","getBlockColors","defaultColors","blockName","baseGlobalStyles","blockStyles","customBlockStyles","color","blockGlobalStyles","blocks","Object","entries","forEach","key","value","styleKey","_customBlockStyles$ke","styles","elements","linkColor","isCustomColor","startsWith","mappedColor","values","find","slug","getBlockTypography","fontSizes","typographyStyles","typography","parsedFontSizes","fontSize","lineHeight","parseInt","mappedFontSize","size","getValueFromObjectPath","object","path","fieldName","parseStylesVariables","mappedValues","customValues","stylesBase","variables","variable","regex","RegExp","varRegex","fontSizeRegex","replace","_$1","$2","split","mappedPresetValue","_mappedPresetValue$va","matchedValue","customValuesData","JSON","parse","colorKey","length","reduce","prev","curr","slice","camelCase","width","height","Dimensions","get","parsedFontSize","getPxFromCssUnit","getMappedValues","features","palette","colors","theme","custom","default","normalizeFontSizes","dimensions","normalizedFontSizes","keysToProcess","push","map","fontSizeObject","sizePx","useMobileGlobalStylesColors","type","colorGradientSettings","useMultipleOriginColorsAndGradients","availableThemeColors","origin","concat","defaultPaletteSetting","defaultPaletteValue","useSettings","defaultPalette","SETTINGS_DEFAULTS","getColorsAndGradients","defaultEditorColors","defaultEditorGradients","rawFeatures","__experimentalGlobalStylesBaseStyles","__experimentalFeatures","gradients","defaultGradients","getGlobalStyles","rawStyles","_features$color$text","_features$color$backg","_features$color$defau","_features$color$defau2","stringify","globalStyles","customLineHeight","spacing","getMergedGlobalStyles","globalStyle","blockAttributes","baseGlobalColors","baseColors","fromEntries","filter","includes","wrapperPropsStyleFiltered","blockTypography","useGlobalStyles","useContext","useEditorColorScheme","baseStyle","darkStyle","deviceColorScheme","usePreferredColorSchemeStyle","editorColors","editorBackgroundColor","isBackgroundColorDefined","isEditorBackgroundDark","colord","isDark"],"sources":["@wordpress/block-editor/src/components/global-styles/use-global-styles-context.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { camelCase } from 'change-case';\nimport { Dimensions } from 'react-native';\nimport { colord } from 'colord';\n\n/**\n * WordPress dependencies\n */\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { createContext, useContext } from '@wordpress/element';\nimport { getPxFromCssUnit } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport useMultipleOriginColorsAndGradients from '../colors-gradients/use-multiple-origin-colors-and-gradients';\nimport { useSettings } from '../use-settings';\nimport { SETTINGS_DEFAULTS } from '../../store/defaults';\n\nconst BLOCK_STYLE_ATTRIBUTES = [\n\t'textColor',\n\t'backgroundColor',\n\t'style',\n\t'color',\n\t'fontSize',\n];\n\nexport const GlobalStylesContext = createContext( { style: {} } );\nGlobalStylesContext.BLOCK_STYLE_ATTRIBUTES = BLOCK_STYLE_ATTRIBUTES;\n\n// Mapping style properties name to native.\nconst BLOCK_STYLE_ATTRIBUTES_MAPPING = {\n\ttextColor: 'color',\n\ttext: 'color',\n\tbackground: 'backgroundColor',\n\tlink: 'linkColor',\n\tplaceholder: 'placeholderColor',\n};\n\nconst PADDING = 12; // $solid-border-space\nconst UNKNOWN_VALUE = 'undefined';\nconst DEFAULT_FONT_SIZE = 16;\n\nexport function getBlockPaddings(\n\tmergedStyle,\n\twrapperPropsStyle,\n\tblockStyleAttributes,\n\tblockColors\n) {\n\tconst blockPaddings = {};\n\n\tif (\n\t\t! mergedStyle.padding &&\n\t\t( wrapperPropsStyle?.backgroundColor ||\n\t\t\tblockStyleAttributes?.backgroundColor ||\n\t\t\tblockColors?.backgroundColor )\n\t) {\n\t\tblockPaddings.padding = PADDING;\n\t\treturn blockPaddings;\n\t}\n\n\t// Prevent adding extra paddings to inner blocks without background colors.\n\tif (\n\t\tmergedStyle?.padding &&\n\t\t! wrapperPropsStyle?.backgroundColor &&\n\t\t! blockStyleAttributes?.backgroundColor &&\n\t\t! blockColors?.backgroundColor\n\t) {\n\t\tblockPaddings.padding = undefined;\n\t}\n\n\treturn blockPaddings;\n}\n\nexport function getBlockColors(\n\tblockStyleAttributes,\n\tdefaultColors,\n\tblockName,\n\tbaseGlobalStyles\n) {\n\tconst blockStyles = {};\n\tconst customBlockStyles = blockStyleAttributes?.style?.color || {};\n\tconst blockGlobalStyles = baseGlobalStyles?.blocks?.[ blockName ];\n\n\t// Global styles colors.\n\tif ( blockGlobalStyles?.color ) {\n\t\tObject.entries( blockGlobalStyles.color ).forEach(\n\t\t\t( [ key, value ] ) => {\n\t\t\t\tconst styleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING[ key ];\n\n\t\t\t\tif ( styleKey && value !== UNKNOWN_VALUE ) {\n\t\t\t\t\tconst color = customBlockStyles[ key ] ?? value;\n\t\t\t\t\tblockStyles[ styleKey ] = color;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t} else if ( baseGlobalStyles?.styles?.color?.text ) {\n\t\tblockStyles[ BLOCK_STYLE_ATTRIBUTES_MAPPING.text ] =\n\t\t\tbaseGlobalStyles?.styles?.color?.text;\n\t}\n\n\t// Global styles elements.\n\tif ( blockGlobalStyles?.elements ) {\n\t\tconst linkColor = blockGlobalStyles.elements?.link?.color?.text;\n\t\tconst styleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING.link;\n\n\t\tif ( styleKey && linkColor && linkColor !== UNKNOWN_VALUE ) {\n\t\t\tblockStyles[ styleKey ] = linkColor;\n\t\t}\n\t}\n\n\t// Custom colors.\n\tObject.entries( blockStyleAttributes ).forEach( ( [ key, value ] ) => {\n\t\tconst isCustomColor = value?.startsWith?.( '#' );\n\t\tlet styleKey = key;\n\n\t\tif ( BLOCK_STYLE_ATTRIBUTES_MAPPING[ styleKey ] ) {\n\t\t\tstyleKey = BLOCK_STYLE_ATTRIBUTES_MAPPING[ styleKey ];\n\t\t}\n\n\t\tif ( ! isCustomColor ) {\n\t\t\tconst mappedColor = Object.values( defaultColors ?? {} ).find(\n\t\t\t\t( { slug } ) => slug === value\n\t\t\t);\n\n\t\t\tif ( mappedColor ) {\n\t\t\t\tblockStyles[ styleKey ] = mappedColor.color;\n\t\t\t}\n\t\t} else {\n\t\t\tblockStyles[ styleKey ] = value;\n\t\t}\n\t} );\n\n\t// Color placeholder.\n\tif ( blockStyles?.color ) {\n\t\tblockStyles[ BLOCK_STYLE_ATTRIBUTES_MAPPING.placeholder ] =\n\t\t\tblockStyles.color;\n\t}\n\n\treturn blockStyles;\n}\n\nfunction getBlockTypography(\n\tblockStyleAttributes,\n\tfontSizes,\n\tblockName,\n\tbaseGlobalStyles\n) {\n\tconst typographyStyles = {};\n\tconst customBlockStyles = blockStyleAttributes?.style?.typography || {};\n\tconst blockGlobalStyles = baseGlobalStyles?.blocks?.[ blockName ];\n\tconst parsedFontSizes = Object.values( fontSizes ?? {} );\n\n\t// Global styles.\n\tif ( blockGlobalStyles?.typography ) {\n\t\tconst fontSize = blockGlobalStyles?.typography?.fontSize;\n\t\tconst lineHeight = blockGlobalStyles?.typography?.lineHeight;\n\n\t\tif ( fontSize ) {\n\t\t\tif ( parseInt( fontSize, 10 ) ) {\n\t\t\t\ttypographyStyles.fontSize = fontSize;\n\t\t\t} else {\n\t\t\t\tconst mappedFontSize = parsedFontSizes.find(\n\t\t\t\t\t( { slug } ) => slug === fontSize\n\t\t\t\t);\n\n\t\t\t\tif ( mappedFontSize ) {\n\t\t\t\t\ttypographyStyles.fontSize = mappedFontSize?.size;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( lineHeight ) {\n\t\t\ttypographyStyles.lineHeight = lineHeight;\n\t\t}\n\t}\n\n\tif ( blockStyleAttributes?.fontSize && baseGlobalStyles ) {\n\t\tconst mappedFontSize = parsedFontSizes.find(\n\t\t\t( { slug } ) => slug === blockStyleAttributes?.fontSize\n\t\t);\n\n\t\tif ( mappedFontSize ) {\n\t\t\ttypographyStyles.fontSize = mappedFontSize?.size;\n\t\t}\n\t}\n\n\t// Custom styles.\n\tif ( customBlockStyles?.fontSize ) {\n\t\ttypographyStyles.fontSize = customBlockStyles?.fontSize;\n\t}\n\n\tif ( customBlockStyles?.lineHeight ) {\n\t\ttypographyStyles.lineHeight = customBlockStyles?.lineHeight;\n\t}\n\n\treturn typographyStyles;\n}\n\n/**\n * Return a value from a certain path of the object.\n * Path is specified as an array of properties, like: [ 'parent', 'child' ].\n *\n * @param {Object} object Input object.\n * @param {Array} path Path to the object property.\n * @return {*} Value of the object property at the specified path.\n */\nconst getValueFromObjectPath = ( object, path ) => {\n\tlet value = object;\n\tpath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value;\n};\n\nexport function parseStylesVariables( styles, mappedValues, customValues ) {\n\tlet stylesBase = styles;\n\tconst variables = [ 'preset', 'custom', 'var', 'fontSize' ];\n\n\tif ( ! stylesBase ) {\n\t\treturn styles;\n\t}\n\n\tvariables.forEach( ( variable ) => {\n\t\t// Examples\n\t\t// var(--wp--preset--color--gray)\n\t\t// var(--wp--custom--body--typography--font-family)\n\t\t// var:preset|color|custom-color-2\n\t\tconst regex = new RegExp( `var\\\\(--wp--${ variable }--(.*?)\\\\)`, 'g' );\n\t\tconst varRegex = /\\\"var:preset\\|color\\|(.*?)\\\"/gm;\n\t\tconst fontSizeRegex = /\"fontSize\":\"(.*?)\"/gm;\n\n\t\tif ( variable === 'preset' ) {\n\t\t\tstylesBase = stylesBase.replace( regex, ( _$1, $2 ) => {\n\t\t\t\tconst path = $2.split( '--' );\n\t\t\t\tconst mappedPresetValue = mappedValues[ path[ 0 ] ];\n\t\t\t\tif ( mappedPresetValue && mappedPresetValue.slug ) {\n\t\t\t\t\tconst matchedValue = Object.values(\n\t\t\t\t\t\tmappedPresetValue.values ?? {}\n\t\t\t\t\t).find( ( { slug } ) => slug === path[ 1 ] );\n\t\t\t\t\treturn matchedValue?.[ mappedPresetValue.slug ];\n\t\t\t\t}\n\t\t\t\treturn UNKNOWN_VALUE;\n\t\t\t} );\n\t\t}\n\t\tif ( variable === 'custom' ) {\n\t\t\tconst customValuesData = customValues ?? JSON.parse( stylesBase );\n\t\t\tstylesBase = stylesBase.replace( regex, ( _$1, $2 ) => {\n\t\t\t\tconst path = $2.split( '--' );\n\n\t\t\t\t// Supports cases for variables like var(--wp--custom--color--background)\n\t\t\t\tif ( path[ 0 ] === 'color' ) {\n\t\t\t\t\tconst colorKey = path[ path.length - 1 ];\n\t\t\t\t\tif ( mappedValues?.color ) {\n\t\t\t\t\t\tconst matchedValue = mappedValues.color?.values?.find(\n\t\t\t\t\t\t\t( { slug } ) => slug === colorKey\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( matchedValue ) {\n\t\t\t\t\t\t\treturn `${ matchedValue?.color }`;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tpath.reduce(\n\t\t\t\t\t\t( prev, curr ) => prev && prev[ curr ],\n\t\t\t\t\t\tcustomValuesData\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\treturn getValueFromObjectPath( customValuesData, path );\n\t\t\t\t}\n\n\t\t\t\t// Check for camelcase properties.\n\t\t\t\treturn getValueFromObjectPath( customValuesData, [\n\t\t\t\t\t...path.slice( 0, path.length - 1 ),\n\t\t\t\t\tcamelCase( path[ path.length - 1 ] ),\n\t\t\t\t] );\n\t\t\t} );\n\t\t}\n\n\t\tif ( variable === 'var' ) {\n\t\t\tstylesBase = stylesBase.replace( varRegex, ( _$1, $2 ) => {\n\t\t\t\tif ( mappedValues?.color ) {\n\t\t\t\t\tconst matchedValue = mappedValues.color?.values?.find(\n\t\t\t\t\t\t( { slug } ) => slug === $2\n\t\t\t\t\t);\n\t\t\t\t\treturn `\"${ matchedValue?.color }\"`;\n\t\t\t\t}\n\t\t\t\treturn UNKNOWN_VALUE;\n\t\t\t} );\n\t\t}\n\n\t\tif ( variable === 'fontSize' ) {\n\t\t\tconst { width, height } = Dimensions.get( 'window' );\n\n\t\t\tstylesBase = stylesBase.replace( fontSizeRegex, ( _$1, $2 ) => {\n\t\t\t\tconst parsedFontSize =\n\t\t\t\t\tgetPxFromCssUnit( $2, {\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\theight,\n\t\t\t\t\t\tfontSize: DEFAULT_FONT_SIZE,\n\t\t\t\t\t} ) || `${ DEFAULT_FONT_SIZE }px`;\n\n\t\t\t\treturn `\"fontSize\":\"${ parsedFontSize }\"`;\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn JSON.parse( stylesBase );\n}\n\nfunction getMappedValues( features, palette ) {\n\tconst typography = features?.typography;\n\tconst colors = [\n\t\t...( palette?.theme || [] ),\n\t\t...( palette?.custom || [] ),\n\t\t...( palette?.default || [] ),\n\t];\n\n\tconst fontSizes = {\n\t\t...typography?.fontSizes?.theme,\n\t\t...typography?.fontSizes?.custom,\n\t};\n\tconst mappedValues = {\n\t\tcolor: {\n\t\t\tvalues: colors,\n\t\t\tslug: 'color',\n\t\t},\n\t\t'font-size': {\n\t\t\tvalues: fontSizes,\n\t\t\tslug: 'size',\n\t\t},\n\t};\n\treturn mappedValues;\n}\n\n/**\n * Returns the normalized fontSizes to include the sizePx value for each of the different sizes.\n *\n * @param {Object} fontSizes found in global styles.\n * @return {Object} normalized sizes.\n */\nfunction normalizeFontSizes( fontSizes ) {\n\tif ( ! fontSizes ) {\n\t\treturn fontSizes;\n\t}\n\n\tconst dimensions = Dimensions.get( 'window' );\n\tconst normalizedFontSizes = {};\n\tconst keysToProcess = [];\n\n\t// Check if 'theme' or 'custom' keys exist and add them to keysToProcess array\n\tif ( fontSizes?.theme ) {\n\t\tkeysToProcess.push( 'theme' );\n\t}\n\tif ( fontSizes?.custom ) {\n\t\tkeysToProcess.push( 'custom' );\n\t}\n\n\t// If neither 'theme' nor 'custom' exist, add 'default' if it exists\n\tif ( keysToProcess.length === 0 && fontSizes?.default ) {\n\t\tkeysToProcess.push( 'default' );\n\t}\n\n\tkeysToProcess.forEach( ( key ) => {\n\t\tnormalizedFontSizes[ key ] = fontSizes[ key ].map(\n\t\t\t( fontSizeObject ) => {\n\t\t\t\tfontSizeObject.sizePx = getPxFromCssUnit( fontSizeObject.size, {\n\t\t\t\t\twidth: dimensions.width,\n\t\t\t\t\theight: dimensions.height,\n\t\t\t\t\tfontSize: DEFAULT_FONT_SIZE,\n\t\t\t\t} );\n\t\t\t\treturn fontSizeObject;\n\t\t\t}\n\t\t);\n\t} );\n\n\treturn normalizedFontSizes;\n}\n\nexport function useMobileGlobalStylesColors( type = 'colors' ) {\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\tconst availableThemeColors = colorGradientSettings?.[ type ]?.reduce(\n\t\t( colors, origin ) => colors.concat( origin?.[ type ] ),\n\t\t[]\n\t);\n\t// Default editor colors/gradients if it's not a block-based theme.\n\tconst defaultPaletteSetting =\n\t\ttype === 'colors' ? 'color.palette' : 'color.gradients';\n\tconst [ defaultPaletteValue ] = useSettings( defaultPaletteSetting );\n\t// In edge cases, the default palette might be undefined. To avoid\n\t// exceptions across the editor in that case, we explicitly return\n\t// the default editor colors.\n\tconst defaultPalette = defaultPaletteValue ?? SETTINGS_DEFAULTS.colors;\n\n\treturn availableThemeColors.length >= 1\n\t\t? availableThemeColors\n\t\t: defaultPalette;\n}\n\nexport function getColorsAndGradients(\n\tdefaultEditorColors = [],\n\tdefaultEditorGradients = [],\n\trawFeatures\n) {\n\tconst features = rawFeatures ? JSON.parse( rawFeatures ) : {};\n\n\treturn {\n\t\t__experimentalGlobalStylesBaseStyles: null,\n\t\t__experimentalFeatures: {\n\t\t\t// Set an empty object to avoid errors from shared web components relying\n\t\t\t// upon block settings. E.g., the Gallery block.\n\t\t\tblocks: {},\n\t\t\tcolor: {\n\t\t\t\t...( ! features?.color\n\t\t\t\t\t? {\n\t\t\t\t\t\t\ttext: true,\n\t\t\t\t\t\t\tbackground: true,\n\t\t\t\t\t\t\tpalette: {\n\t\t\t\t\t\t\t\tdefault: defaultEditorColors,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tgradients: {\n\t\t\t\t\t\t\t\tdefault: defaultEditorGradients,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: features?.color ),\n\t\t\t\tdefaultPalette: defaultEditorColors?.length > 0,\n\t\t\t\tdefaultGradients: defaultEditorGradients?.length > 0,\n\t\t\t},\n\t\t},\n\t};\n}\n\nexport function getGlobalStyles( rawStyles, rawFeatures ) {\n\tconst features = rawFeatures ? JSON.parse( rawFeatures ) : {};\n\tconst mappedValues = getMappedValues( features, features?.color?.palette );\n\tconst colors = parseStylesVariables(\n\t\tJSON.stringify( features?.color ),\n\t\tmappedValues\n\t);\n\tconst gradients = parseStylesVariables(\n\t\tJSON.stringify( features?.color?.gradients ),\n\t\tmappedValues\n\t);\n\tconst customValues = parseStylesVariables(\n\t\tJSON.stringify( features?.custom ),\n\t\tmappedValues\n\t);\n\tconst globalStyles = parseStylesVariables(\n\t\trawStyles,\n\t\tmappedValues,\n\t\tcustomValues\n\t);\n\n\tconst fontSizes = normalizeFontSizes( features?.typography?.fontSizes );\n\n\treturn {\n\t\t__experimentalFeatures: {\n\t\t\t// Set an empty object to avoid errors from shared web components relying\n\t\t\t// upon block settings. E.g., the Gallery block.\n\t\t\tblocks: {},\n\t\t\tcolor: {\n\t\t\t\tpalette: colors?.palette,\n\t\t\t\tgradients,\n\t\t\t\ttext: features?.color?.text ?? true,\n\t\t\t\tbackground: features?.color?.background ?? true,\n\t\t\t\tdefaultPalette: features?.color?.defaultPalette ?? true,\n\t\t\t\tdefaultGradients: features?.color?.defaultGradients ?? true,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontSizes,\n\t\t\t\tcustomLineHeight: features?.custom?.[ 'line-height' ],\n\t\t\t},\n\t\t\tspacing: features?.spacing,\n\t\t},\n\t\t__experimentalGlobalStylesBaseStyles: globalStyles,\n\t};\n}\n\nexport const getMergedGlobalStyles = (\n\tbaseGlobalStyles,\n\tglobalStyle,\n\twrapperPropsStyle,\n\tblockAttributes,\n\tdefaultColors,\n\tblockName,\n\tfontSizes\n) => {\n\t// Current support for general styles and blocks.\n\tconst baseGlobalColors = {\n\t\tbaseColors: {\n\t\t\tcolor: baseGlobalStyles?.color,\n\t\t\ttypography: baseGlobalStyles?.typography,\n\t\t\telements: {\n\t\t\t\tlink: baseGlobalStyles?.elements?.link,\n\t\t\t},\n\t\t\tblocks: {\n\t\t\t\t'core/button': baseGlobalStyles?.blocks?.[ 'core/button' ],\n\t\t\t},\n\t\t},\n\t};\n\n\tconst blockStyleAttributes = Object.fromEntries(\n\t\tObject.entries( blockAttributes ?? {} ).filter( ( [ key ] ) =>\n\t\t\tBLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t)\n\t);\n\n\t// This prevents certain wrapper styles from being applied to blocks that\n\t// don't support them yet.\n\tconst wrapperPropsStyleFiltered = Object.fromEntries(\n\t\tObject.entries( wrapperPropsStyle ?? {} ).filter( ( [ key ] ) =>\n\t\t\tBLOCK_STYLE_ATTRIBUTES.includes( key )\n\t\t)\n\t);\n\n\tconst mergedStyle = {\n\t\t...baseGlobalColors,\n\t\t...globalStyle,\n\t\t...wrapperPropsStyleFiltered,\n\t};\n\tconst blockColors = getBlockColors(\n\t\tblockStyleAttributes,\n\t\tdefaultColors,\n\t\tblockName,\n\t\tbaseGlobalStyles\n\t);\n\tconst blockPaddings = getBlockPaddings(\n\t\tmergedStyle,\n\t\twrapperPropsStyle,\n\t\tblockStyleAttributes,\n\t\tblockColors\n\t);\n\tconst blockTypography = getBlockTypography(\n\t\tblockStyleAttributes,\n\t\tfontSizes,\n\t\tblockName,\n\t\tbaseGlobalStyles\n\t);\n\n\treturn {\n\t\t...mergedStyle,\n\t\t...blockPaddings,\n\t\t...blockColors,\n\t\t...blockTypography,\n\t};\n};\n\nexport const useGlobalStyles = () => {\n\tconst globalStyles = useContext( GlobalStylesContext );\n\n\treturn globalStyles;\n};\n\n/**\n * Determine and apply appropriate color scheme based on global styles or device's light/dark mode.\n *\n * The function first attempts to retrieve the editor's background color from global styles.\n * If the detected background color is light, light styles are applied, and dark styles otherwise.\n * If no custom background color is defined, styles are applied using the device's dark/light setting.\n *\n * @param {Object} baseStyle - An object representing the base (light theme) styles for the editor.\n * @param {Object} darkStyle - An object representing the additional styles to apply when the editor is in dark mode.\n *\n * @return {Object} - The combined style object that should be applied to the editor.\n */\nexport const useEditorColorScheme = ( baseStyle, darkStyle ) => {\n\tconst globalStyles = useGlobalStyles();\n\n\tconst deviceColorScheme = usePreferredColorSchemeStyle(\n\t\tbaseStyle,\n\t\tdarkStyle\n\t);\n\n\tconst editorColors = globalStyles?.baseColors?.color;\n\tconst editorBackgroundColor = editorColors?.background;\n\n\tconst isBackgroundColorDefined =\n\t\ttypeof editorBackgroundColor !== 'undefined' &&\n\t\teditorBackgroundColor !== 'undefined';\n\n\tif ( isBackgroundColorDefined ) {\n\t\tconst isEditorBackgroundDark = colord( editorBackgroundColor ).isDark();\n\t\treturn isEditorBackgroundDark\n\t\t\t? { ...baseStyle, ...darkStyle }\n\t\t\t: baseStyle;\n\t}\n\n\treturn deviceColorScheme;\n};\n"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG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BAAoB,CAAC;EAEtD,OAAOwI,YAAY;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXAvI,OAAA,CAAAoJ,eAAA,GAAAA,eAAA;AAYO,MAAME,oBAAoB,GAAGA,CAAEC,SAAS,EAAEC,SAAS,KAAM;EAC/D,MAAMjB,YAAY,GAAGa,eAAe,CAAC,CAAC;EAEtC,MAAMK,iBAAiB,GAAG,IAAAC,qCAA4B,EACrDH,SAAS,EACTC,SACD,CAAC;EAED,MAAMG,YAAY,GAAGpB,YAAY,EAAEO,UAAU,EAAEnH,KAAK;EACpD,MAAMiI,qBAAqB,GAAGD,YAAY,EAAErJ,UAAU;EAEtD,MAAMuJ,wBAAwB,GAC7B,OAAOD,qBAAqB,KAAK,WAAW,IAC5CA,qBAAqB,KAAK,WAAW;EAEtC,IAAKC,wBAAwB,EAAG;IAC/B,MAAMC,sBAAsB,GAAG,IAAAC,cAAM,EAAEH,qBAAsB,CAAC,CAACI,MAAM,CAAC,CAAC;IACvE,OAAOF,sBAAsB,GAC1B;MAAE,GAAGP,SAAS;MAAE,GAAGC;IAAU,CAAC,GAC9BD,SAAS;EACb;EAEA,OAAOE,iBAAiB;AACzB,CAAC;AAACzJ,OAAA,CAAAsJ,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -43,10 +43,10 @@ function getCompatibilityStyles() {
|
|
|
43
43
|
return accumulator;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// Don't try to add
|
|
47
|
-
//
|
|
48
|
-
//
|
|
49
|
-
if (
|
|
46
|
+
// Don't try to add core WP styles. We are responsible for adding
|
|
47
|
+
// them. This compatibility layer is only meant to add styles added
|
|
48
|
+
// by plugins or themes.
|
|
49
|
+
if (ownerNode.id.startsWith('wp-')) {
|
|
50
50
|
return accumulator;
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["compatibilityStyles","getCompatibilityStyles","Array","from","document","styleSheets","reduce","accumulator","styleSheet","cssRules","e","ownerNode","
|
|
1
|
+
{"version":3,"names":["compatibilityStyles","getCompatibilityStyles","Array","from","document","styleSheets","reduce","accumulator","styleSheet","cssRules","e","ownerNode","id","startsWith","matchFromRules","_cssRules","find","selectorText","conditionText","__cssRules","includes","isInline","tagName","mainStylesCssId","replace","mainStylesElement","getElementById","push","cloneNode","inlineStylesCssId","inlineStylesElement"],"sources":["@wordpress/block-editor/src/components/iframe/get-compatibility-styles.js"],"sourcesContent":["let compatibilityStyles = null;\n\n/**\n * Returns a list of stylesheets that target the editor canvas. A stylesheet is\n * considered targetting the editor a canvas if it contains the\n * `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors.\n *\n * Ideally, this hook should be removed in the future and styles should be added\n * explicitly as editor styles.\n */\nexport function getCompatibilityStyles() {\n\tif ( compatibilityStyles ) {\n\t\treturn compatibilityStyles;\n\t}\n\n\t// Only memoize the result once on load, since these stylesheets should not\n\t// change.\n\tcompatibilityStyles = Array.from( document.styleSheets ).reduce(\n\t\t( accumulator, styleSheet ) => {\n\t\t\ttry {\n\t\t\t\t// May fail for external styles.\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\tstyleSheet.cssRules;\n\t\t\t} catch ( e ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\tconst { ownerNode, cssRules } = styleSheet;\n\n\t\t\t// Stylesheet is added by another stylesheet. See\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/ownerNode#notes.\n\t\t\tif ( ownerNode === null ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\tif ( ! cssRules ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\t// Don't try to add core WP styles. We are responsible for adding\n\t\t\t// them. This compatibility layer is only meant to add styles added\n\t\t\t// by plugins or themes.\n\t\t\tif ( ownerNode.id.startsWith( 'wp-' ) ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\t// Don't try to add styles without ID. Styles enqueued via the WP dependency system will always have IDs.\n\t\t\tif ( ! ownerNode.id ) {\n\t\t\t\treturn accumulator;\n\t\t\t}\n\n\t\t\tfunction matchFromRules( _cssRules ) {\n\t\t\t\treturn Array.from( _cssRules ).find(\n\t\t\t\t\t( {\n\t\t\t\t\t\tselectorText,\n\t\t\t\t\t\tconditionText,\n\t\t\t\t\t\tcssRules: __cssRules,\n\t\t\t\t\t} ) => {\n\t\t\t\t\t\t// If the rule is conditional then it will not have selector text.\n\t\t\t\t\t\t// Recurse into child CSS ruleset to determine selector eligibility.\n\t\t\t\t\t\tif ( conditionText ) {\n\t\t\t\t\t\t\treturn matchFromRules( __cssRules );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\tselectorText &&\n\t\t\t\t\t\t\t( selectorText.includes(\n\t\t\t\t\t\t\t\t'.editor-styles-wrapper'\n\t\t\t\t\t\t\t) ||\n\t\t\t\t\t\t\t\tselectorText.includes( '.wp-block' ) )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( matchFromRules( cssRules ) ) {\n\t\t\t\tconst isInline = ownerNode.tagName === 'STYLE';\n\n\t\t\t\tif ( isInline ) {\n\t\t\t\t\t// If the current target is inline,\n\t\t\t\t\t// it could be a dependency of an existing stylesheet.\n\t\t\t\t\t// Look for that dependency and add it BEFORE the current target.\n\t\t\t\t\tconst mainStylesCssId = ownerNode.id.replace(\n\t\t\t\t\t\t'-inline-css',\n\t\t\t\t\t\t'-css'\n\t\t\t\t\t);\n\t\t\t\t\tconst mainStylesElement =\n\t\t\t\t\t\tdocument.getElementById( mainStylesCssId );\n\t\t\t\t\tif ( mainStylesElement ) {\n\t\t\t\t\t\taccumulator.push( mainStylesElement.cloneNode( true ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\taccumulator.push( ownerNode.cloneNode( true ) );\n\n\t\t\t\tif ( ! isInline ) {\n\t\t\t\t\t// If the current target is not inline,\n\t\t\t\t\t// we still look for inline styles that could be relevant for the current target.\n\t\t\t\t\t// If they exist, add them AFTER the current target.\n\t\t\t\t\tconst inlineStylesCssId = ownerNode.id.replace(\n\t\t\t\t\t\t'-css',\n\t\t\t\t\t\t'-inline-css'\n\t\t\t\t\t);\n\t\t\t\t\tconst inlineStylesElement =\n\t\t\t\t\t\tdocument.getElementById( inlineStylesCssId );\n\t\t\t\t\tif ( inlineStylesElement ) {\n\t\t\t\t\t\taccumulator.push(\n\t\t\t\t\t\t\tinlineStylesElement.cloneNode( true )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn accumulator;\n\t\t},\n\t\t[]\n\t);\n\n\treturn compatibilityStyles;\n}\n"],"mappings":";;;;;;AAAA,IAAIA,mBAAmB,GAAG,IAAI;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,sBAAsBA,CAAA,EAAG;EACxC,IAAKD,mBAAmB,EAAG;IAC1B,OAAOA,mBAAmB;EAC3B;;EAEA;EACA;EACAA,mBAAmB,GAAGE,KAAK,CAACC,IAAI,CAAEC,QAAQ,CAACC,WAAY,CAAC,CAACC,MAAM,CAC9D,CAAEC,WAAW,EAAEC,UAAU,KAAM;IAC9B,IAAI;MACH;MACA;MACAA,UAAU,CAACC,QAAQ;IACpB,CAAC,CAAC,OAAQC,CAAC,EAAG;MACb,OAAOH,WAAW;IACnB;IAEA,MAAM;MAAEI,SAAS;MAAEF;IAAS,CAAC,GAAGD,UAAU;;IAE1C;IACA;IACA,IAAKG,SAAS,KAAK,IAAI,EAAG;MACzB,OAAOJ,WAAW;IACnB;IAEA,IAAK,CAAEE,QAAQ,EAAG;MACjB,OAAOF,WAAW;IACnB;;IAEA;IACA;IACA;IACA,IAAKI,SAAS,CAACC,EAAE,CAACC,UAAU,CAAE,KAAM,CAAC,EAAG;MACvC,OAAON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IAAI,CACfG,mBAAmB,CAACF,SAAS,CAAE,IAAK,CACrC,CAAC;QACF;MACD;IACD;IAEA,OAAOrB,WAAW;EACnB,CAAC,EACD,EACD,CAAC;EAED,OAAOP,mBAAmB;AAC3B","ignoreList":[]}
|
|
@@ -118,7 +118,7 @@ function Iframe({
|
|
|
118
118
|
const settings = getSettings();
|
|
119
119
|
return {
|
|
120
120
|
resolvedAssets: settings.__unstableResolvedAssets,
|
|
121
|
-
isPreviewMode: settings.
|
|
121
|
+
isPreviewMode: settings.isPreviewMode
|
|
122
122
|
};
|
|
123
123
|
}, []);
|
|
124
124
|
const {
|
|
@@ -126,7 +126,7 @@ function Iframe({
|
|
|
126
126
|
scripts = ''
|
|
127
127
|
} = resolvedAssets;
|
|
128
128
|
const [iframeDocument, setIframeDocument] = (0, _element.useState)();
|
|
129
|
-
const
|
|
129
|
+
const initialContainerWidthRef = (0, _element.useRef)(0);
|
|
130
130
|
const [bodyClasses, setBodyClasses] = (0, _element.useState)([]);
|
|
131
131
|
const clearerRef = (0, _blockSelectionClearer.useBlockSelectionClearer)();
|
|
132
132
|
const [before, writingFlowRef, after] = (0, _writingFlow.useWritingFlow)();
|
|
@@ -174,6 +174,21 @@ function Iframe({
|
|
|
174
174
|
}
|
|
175
175
|
iFrameDocument.addEventListener('dragover', preventFileDropDefault, false);
|
|
176
176
|
iFrameDocument.addEventListener('drop', preventFileDropDefault, false);
|
|
177
|
+
// Prevent clicks on links from navigating away. Note that links
|
|
178
|
+
// inside `contenteditable` are already disabled by the browser, so
|
|
179
|
+
// this is for links in blocks outside of `contenteditable`.
|
|
180
|
+
iFrameDocument.addEventListener('click', event => {
|
|
181
|
+
if (event.target.tagName === 'A') {
|
|
182
|
+
event.preventDefault();
|
|
183
|
+
|
|
184
|
+
// Appending a hash to the current URL will not reload the
|
|
185
|
+
// page. This is useful for e.g. footnotes.
|
|
186
|
+
const href = event.target.getAttribute('href');
|
|
187
|
+
if (href.startsWith('#')) {
|
|
188
|
+
iFrameDocument.defaultView.location.hash = href.slice(1);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
});
|
|
177
192
|
}
|
|
178
193
|
node.addEventListener('load', onLoad);
|
|
179
194
|
return () => {
|
|
@@ -210,9 +225,10 @@ function Iframe({
|
|
|
210
225
|
const isZoomedOut = scale !== 1;
|
|
211
226
|
(0, _element.useEffect)(() => {
|
|
212
227
|
if (!isZoomedOut) {
|
|
213
|
-
|
|
228
|
+
initialContainerWidthRef.current = containerWidth;
|
|
214
229
|
}
|
|
215
230
|
}, [containerWidth, isZoomedOut]);
|
|
231
|
+
const scaleContainerWidth = Math.max(initialContainerWidthRef.current, containerWidth);
|
|
216
232
|
const disabledRef = (0, _compose.useDisabled)({
|
|
217
233
|
isDisabled: !readonly
|
|
218
234
|
});
|
|
@@ -229,6 +245,7 @@ function Iframe({
|
|
|
229
245
|
<html>
|
|
230
246
|
<head>
|
|
231
247
|
<meta charset="utf-8">
|
|
248
|
+
<base href="${window.location.origin}">
|
|
232
249
|
<script>window.frameElement._load()</script>
|
|
233
250
|
<style>
|
|
234
251
|
html{
|
|
@@ -258,13 +275,6 @@ function Iframe({
|
|
|
258
275
|
}, [html]);
|
|
259
276
|
(0, _element.useEffect)(() => cleanup, [cleanup]);
|
|
260
277
|
const zoomOutAnimationClassnameRef = (0, _element.useRef)(null);
|
|
261
|
-
const handleZoomOutAnimationClassname = () => {
|
|
262
|
-
clearTimeout(zoomOutAnimationClassnameRef.current);
|
|
263
|
-
iframeDocument.documentElement.classList.add('zoom-out-animation');
|
|
264
|
-
zoomOutAnimationClassnameRef.current = setTimeout(() => {
|
|
265
|
-
iframeDocument.documentElement.classList.remove('zoom-out-animation');
|
|
266
|
-
}, 400); // 400ms should match the animation speed used in components/iframe/content.scss
|
|
267
|
-
};
|
|
268
278
|
|
|
269
279
|
// Toggle zoom out CSS Classes only when zoom out mode changes. We could add these into the useEffect
|
|
270
280
|
// that controls settings the CSS variables, but then we would need to do more work to ensure we're
|
|
@@ -274,6 +284,13 @@ function Iframe({
|
|
|
274
284
|
if (!iframeDocument || !isZoomedOut) {
|
|
275
285
|
return;
|
|
276
286
|
}
|
|
287
|
+
const handleZoomOutAnimationClassname = () => {
|
|
288
|
+
clearTimeout(zoomOutAnimationClassnameRef.current);
|
|
289
|
+
iframeDocument.documentElement.classList.add('zoom-out-animation');
|
|
290
|
+
zoomOutAnimationClassnameRef.current = setTimeout(() => {
|
|
291
|
+
iframeDocument.documentElement.classList.remove('zoom-out-animation');
|
|
292
|
+
}, 400); // 400ms should match the animation speed used in components/iframe/content.scss
|
|
293
|
+
};
|
|
277
294
|
handleZoomOutAnimationClassname();
|
|
278
295
|
iframeDocument.documentElement.classList.add('is-zoomed-out');
|
|
279
296
|
return () => {
|
|
@@ -289,36 +306,30 @@ function Iframe({
|
|
|
289
306
|
}
|
|
290
307
|
const maxWidth = 750;
|
|
291
308
|
// Note: When we initialize the zoom out when the canvas is smaller (sidebars open),
|
|
292
|
-
//
|
|
309
|
+
// initialContainerWidthRef will be smaller than the full page, and reflow will happen
|
|
293
310
|
// when the canvas area becomes larger due to sidebars closing. This is a known but
|
|
294
311
|
// minor divergence for now.
|
|
295
312
|
|
|
296
313
|
// This scaling calculation has to happen within the JS because CSS calc() can
|
|
297
314
|
// only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid
|
|
298
315
|
// but calc( 100px / 2px ) is not.
|
|
299
|
-
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale', scale === '
|
|
316
|
+
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale', scale === 'auto-scaled' ? (Math.min(containerWidth, maxWidth) - parseInt(frameSize) * 2) / scaleContainerWidth : scale);
|
|
300
317
|
|
|
301
318
|
// frameSize has to be a px value for the scaling and frame size to be computed correctly.
|
|
302
319
|
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-frame-size', typeof frameSize === 'number' ? `${frameSize}px` : frameSize);
|
|
303
320
|
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-content-height', `${contentHeight}px`);
|
|
304
321
|
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-inner-height', `${iframeWindowInnerHeight}px`);
|
|
305
322
|
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-container-width', `${containerWidth}px`);
|
|
306
|
-
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-
|
|
307
|
-
|
|
308
|
-
// iframeDocument.documentElement.style.setProperty(
|
|
309
|
-
// '--wp-block-editor-iframe-zoom-out-outer-container-width',
|
|
310
|
-
// `${ Math.max( initialContainerWidth.current, containerWidth ) }px`
|
|
311
|
-
// );
|
|
312
|
-
|
|
323
|
+
iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale-container-width', `${scaleContainerWidth}px`);
|
|
313
324
|
return () => {
|
|
314
325
|
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-scale');
|
|
315
326
|
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-frame-size');
|
|
316
327
|
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-content-height');
|
|
317
328
|
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-inner-height');
|
|
318
329
|
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-container-width');
|
|
319
|
-
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-
|
|
330
|
+
iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-scale-container-width');
|
|
320
331
|
};
|
|
321
|
-
}, [scale, frameSize, iframeDocument, iframeWindowInnerHeight, contentHeight, containerWidth, windowInnerWidth, isZoomedOut]);
|
|
332
|
+
}, [scale, frameSize, iframeDocument, iframeWindowInnerHeight, contentHeight, containerWidth, windowInnerWidth, isZoomedOut, scaleContainerWidth]);
|
|
322
333
|
|
|
323
334
|
// Make sure to not render the before and after focusable div elements in view
|
|
324
335
|
// mode. They're only needed to capture focus in edit mode.
|
|
@@ -385,7 +396,7 @@ function Iframe({
|
|
|
385
396
|
children: [containerResizeListener, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
386
397
|
className: (0, _clsx.default)('block-editor-iframe__scale-container', isZoomedOut && 'is-zoomed-out'),
|
|
387
398
|
style: {
|
|
388
|
-
'--wp-block-editor-iframe-zoom-out-
|
|
399
|
+
'--wp-block-editor-iframe-zoom-out-scale-container-width': isZoomedOut && `${scaleContainerWidth}px`
|
|
389
400
|
},
|
|
390
401
|
children: iframe
|
|
391
402
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_compose","_components","_data","_blockSelectionClearer","_writingFlow","_getCompatibilityStyles","_store","_jsxRuntime","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","useRefEffect","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","__","props","resolvedAssets","isPreviewMode","useSelect","select","getSettings","blockEditorStore","settings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","setIframeDocument","useState","initialContainerWidth","useRef","bodyClasses","setBodyClasses","clearerRef","useBlockSelectionClearer","before","writingFlowRef","after","useWritingFlow","contentResizeListener","height","contentHeight","useResizeObserver","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getCompatibilityStyles","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","useEffect","current","disabledRef","useDisabled","isDisabled","bodyRef","useMergeRefs","src","cleanup","useMemo","_src","URL","createObjectURL","Blob","revokeObjectURL","zoomOutAnimationClassnameRef","handleZoomOutAnimationClassname","clearTimeout","setTimeout","remove","maxWidth","style","setProperty","Math","min","parseInt","max","removeProperty","shouldRenderFocusCaptureElements","iframe","jsxs","Fragment","jsx","border","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","createPortal","className","clsx","__experimentalStyleProvider","document","IframeIfReady","isInitialised","__internalIsInitialized","_default","exports","default","forwardRef"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst initialContainerWidth = useRef();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\tconst [ iframeWindowInnerHeight, setIframeWindowInnerHeight ] = useState();\n\n\tconst iframeResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\tconst onResize = () => {\n\t\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst [ windowInnerWidth, setWindowInnerWidth ] = useState();\n\n\tconst windowResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\tconst onResize = () => {\n\t\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst isZoomedOut = scale !== 1;\n\n\tuseEffect( () => {\n\t\tif ( ! isZoomedOut ) {\n\t\t\tinitialContainerWidth.current = containerWidth;\n\t\t}\n\t}, [ containerWidth, isZoomedOut ] );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width, or when\n\t\t// expanding preview iframes.\n\t\tisZoomedOut ? iframeResizeRef : null,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<script>window.frameElement._load()</script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\tconst zoomOutAnimationClassnameRef = useRef( null );\n\tconst handleZoomOutAnimationClassname = () => {\n\t\tclearTimeout( zoomOutAnimationClassnameRef.current );\n\n\t\tiframeDocument.documentElement.classList.add( 'zoom-out-animation' );\n\n\t\tzoomOutAnimationClassnameRef.current = setTimeout( () => {\n\t\t\tiframeDocument.documentElement.classList.remove(\n\t\t\t\t'zoom-out-animation'\n\t\t\t);\n\t\t}, 400 ); // 400ms should match the animation speed used in components/iframe/content.scss\n\t};\n\n\t// Toggle zoom out CSS Classes only when zoom out mode changes. We could add these into the useEffect\n\t// that controls settings the CSS variables, but then we would need to do more work to ensure we're\n\t// only toggling these when the zoom out mode changes, as that useEffect is also triggered by a large\n\t// number of dependencies.\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\thandleZoomOutAnimationClassname();\n\t\tiframeDocument.documentElement.classList.add( 'is-zoomed-out' );\n\n\t\treturn () => {\n\t\t\thandleZoomOutAnimationClassname();\n\t\t\tiframeDocument.documentElement.classList.remove( 'is-zoomed-out' );\n\t\t};\n\t}, [ iframeDocument, isZoomedOut ] );\n\n\t// Calculate the scaling and CSS variables for the zoom out canvas\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxWidth = 750;\n\t\t// Note: When we initialize the zoom out when the canvas is smaller (sidebars open),\n\t\t// initialContainerWidth will be smaller than the full page, and reflow will happen\n\t\t// when the canvas area becomes larger due to sidebars closing. This is a known but\n\t\t// minor divergence for now.\n\n\t\t// This scaling calculation has to happen within the JS because CSS calc() can\n\t\t// only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid\n\t\t// but calc( 100px / 2px ) is not.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale',\n\t\t\tscale === 'default'\n\t\t\t\t? ( Math.min( containerWidth, maxWidth ) -\n\t\t\t\t\t\tparseInt( frameSize ) * 2 ) /\n\t\t\t\t\t\tMath.max(\n\t\t\t\t\t\t\tinitialContainerWidth.current,\n\t\t\t\t\t\t\tcontainerWidth\n\t\t\t\t\t\t)\n\t\t\t\t: scale\n\t\t);\n\n\t\t// frameSize has to be a px value for the scaling and frame size to be computed correctly.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size',\n\t\t\ttypeof frameSize === 'number' ? `${ frameSize }px` : frameSize\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-content-height',\n\t\t\t`${ contentHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height',\n\t\t\t`${ iframeWindowInnerHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-container-width',\n\t\t\t`${ containerWidth }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-outer-container-width',\n\t\t\t`${ Math.max( initialContainerWidth.current, containerWidth ) }px`\n\t\t);\n\n\t\t// iframeDocument.documentElement.style.setProperty(\n\t\t// \t'--wp-block-editor-iframe-zoom-out-outer-container-width',\n\t\t// \t`${ Math.max( initialContainerWidth.current, containerWidth ) }px`\n\t\t// );\n\n\t\treturn () => {\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-content-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-outer-container-width'\n\t\t\t);\n\t\t};\n\t}, [\n\t\tscale,\n\t\tframeSize,\n\t\tiframeDocument,\n\t\tiframeWindowInnerHeight,\n\t\tcontentHeight,\n\t\tcontainerWidth,\n\t\twindowInnerWidth,\n\t\tisZoomedOut,\n\t] );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t\tborder: 0,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t// We want to prevent React events from bubbling throught the iframe\n\t\t\t\t\t\t// we bubble these manually.\n\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ windowResizeRef }>\n\t\t\t{ containerResizeListener }\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-outer-container-width':\n\t\t\t\t\t\tisZoomedOut &&\n\t\t\t\t\t\t`${ Math.max(\n\t\t\t\t\t\t\tinitialContainerWidth.current,\n\t\t\t\t\t\t\tcontainerWidth\n\t\t\t\t\t\t) }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAQA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAMA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,sBAAA,GAAAN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c,IAAAC,mBAAU,EAAEN,aAAc,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_compose","_components","_data","_blockSelectionClearer","_writingFlow","_getCompatibilityStyles","_store","_jsxRuntime","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","useRefEffect","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","__","props","resolvedAssets","isPreviewMode","useSelect","select","getSettings","blockEditorStore","settings","__unstableResolvedAssets","styles","scripts","setIframeDocument","useState","initialContainerWidthRef","useRef","bodyClasses","setBodyClasses","clearerRef","useBlockSelectionClearer","before","writingFlowRef","after","useWritingFlow","contentResizeListener","height","contentHeight","useResizeObserver","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getCompatibilityStyles","getElementById","id","head","appendChild","cloneNode","console","warn","target","tagName","href","getAttribute","location","hash","slice","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","useEffect","current","scaleContainerWidth","Math","max","disabledRef","useDisabled","isDisabled","bodyRef","useMergeRefs","origin","src","cleanup","useMemo","_src","URL","createObjectURL","Blob","revokeObjectURL","zoomOutAnimationClassnameRef","handleZoomOutAnimationClassname","clearTimeout","setTimeout","remove","maxWidth","style","setProperty","min","parseInt","removeProperty","shouldRenderFocusCaptureElements","iframe","jsxs","Fragment","jsx","border","onKeyDown","currentTarget","stopPropagation","nativeEvent","KeyboardEvent","createPortal","className","clsx","__experimentalStyleProvider","document","IframeIfReady","isInitialised","__internalIsInitialized","_default","exports","default","forwardRef"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.isPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst initialContainerWidthRef = useRef( 0 );\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\t// Prevent clicks on links from navigating away. Note that links\n\t\t\t// inside `contenteditable` are already disabled by the browser, so\n\t\t\t// this is for links in blocks outside of `contenteditable`.\n\t\t\tiFrameDocument.addEventListener( 'click', ( event ) => {\n\t\t\t\tif ( event.target.tagName === 'A' ) {\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// Appending a hash to the current URL will not reload the\n\t\t\t\t\t// page. This is useful for e.g. footnotes.\n\t\t\t\t\tconst href = event.target.getAttribute( 'href' );\n\t\t\t\t\tif ( href.startsWith( '#' ) ) {\n\t\t\t\t\t\tiFrameDocument.defaultView.location.hash =\n\t\t\t\t\t\t\thref.slice( 1 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\tconst [ iframeWindowInnerHeight, setIframeWindowInnerHeight ] = useState();\n\n\tconst iframeResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\tconst onResize = () => {\n\t\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst [ windowInnerWidth, setWindowInnerWidth ] = useState();\n\n\tconst windowResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\tconst onResize = () => {\n\t\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst isZoomedOut = scale !== 1;\n\n\tuseEffect( () => {\n\t\tif ( ! isZoomedOut ) {\n\t\t\tinitialContainerWidthRef.current = containerWidth;\n\t\t}\n\t}, [ containerWidth, isZoomedOut ] );\n\n\tconst scaleContainerWidth = Math.max(\n\t\tinitialContainerWidthRef.current,\n\t\tcontainerWidth\n\t);\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width, or when\n\t\t// expanding preview iframes.\n\t\tisZoomedOut ? iframeResizeRef : null,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<base href=\"${ window.location.origin }\">\n\t\t<script>window.frameElement._load()</script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\tconst zoomOutAnimationClassnameRef = useRef( null );\n\n\t// Toggle zoom out CSS Classes only when zoom out mode changes. We could add these into the useEffect\n\t// that controls settings the CSS variables, but then we would need to do more work to ensure we're\n\t// only toggling these when the zoom out mode changes, as that useEffect is also triggered by a large\n\t// number of dependencies.\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst handleZoomOutAnimationClassname = () => {\n\t\t\tclearTimeout( zoomOutAnimationClassnameRef.current );\n\n\t\t\tiframeDocument.documentElement.classList.add(\n\t\t\t\t'zoom-out-animation'\n\t\t\t);\n\n\t\t\tzoomOutAnimationClassnameRef.current = setTimeout( () => {\n\t\t\t\tiframeDocument.documentElement.classList.remove(\n\t\t\t\t\t'zoom-out-animation'\n\t\t\t\t);\n\t\t\t}, 400 ); // 400ms should match the animation speed used in components/iframe/content.scss\n\t\t};\n\n\t\thandleZoomOutAnimationClassname();\n\t\tiframeDocument.documentElement.classList.add( 'is-zoomed-out' );\n\n\t\treturn () => {\n\t\t\thandleZoomOutAnimationClassname();\n\t\t\tiframeDocument.documentElement.classList.remove( 'is-zoomed-out' );\n\t\t};\n\t}, [ iframeDocument, isZoomedOut ] );\n\n\t// Calculate the scaling and CSS variables for the zoom out canvas\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst maxWidth = 750;\n\t\t// Note: When we initialize the zoom out when the canvas is smaller (sidebars open),\n\t\t// initialContainerWidthRef will be smaller than the full page, and reflow will happen\n\t\t// when the canvas area becomes larger due to sidebars closing. This is a known but\n\t\t// minor divergence for now.\n\n\t\t// This scaling calculation has to happen within the JS because CSS calc() can\n\t\t// only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid\n\t\t// but calc( 100px / 2px ) is not.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale',\n\t\t\tscale === 'auto-scaled'\n\t\t\t\t? ( Math.min( containerWidth, maxWidth ) -\n\t\t\t\t\t\tparseInt( frameSize ) * 2 ) /\n\t\t\t\t\t\tscaleContainerWidth\n\t\t\t\t: scale\n\t\t);\n\n\t\t// frameSize has to be a px value for the scaling and frame size to be computed correctly.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size',\n\t\t\ttypeof frameSize === 'number' ? `${ frameSize }px` : frameSize\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-content-height',\n\t\t\t`${ contentHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height',\n\t\t\t`${ iframeWindowInnerHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-container-width',\n\t\t\t`${ containerWidth }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width',\n\t\t\t`${ scaleContainerWidth }px`\n\t\t);\n\n\t\treturn () => {\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-content-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width'\n\t\t\t);\n\t\t};\n\t}, [\n\t\tscale,\n\t\tframeSize,\n\t\tiframeDocument,\n\t\tiframeWindowInnerHeight,\n\t\tcontentHeight,\n\t\tcontainerWidth,\n\t\twindowInnerWidth,\n\t\tisZoomedOut,\n\t\tscaleContainerWidth,\n\t] );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t\tborder: 0,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t// We want to prevent React events from bubbling throught the iframe\n\t\t\t\t\t\t// we bubble these manually.\n\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ windowResizeRef }>\n\t\t\t{ containerResizeListener }\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ scaleContainerWidth }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAQA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAMA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAKA,IAAAM,sBAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ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