@wordpress/block-editor 14.8.1-next.cd6172eb0.0 → 14.10.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/LICENSE.md +1 -1
- package/README.md +48 -0
- package/build/autocompleters/block.js +1 -0
- package/build/autocompleters/block.js.map +1 -1
- package/build/autocompleters/link.js +1 -0
- package/build/autocompleters/link.js.map +1 -1
- package/build/components/alignment-control/ui.js +1 -0
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/audio-player/index.native.js +1 -1
- package/build/components/audio-player/index.native.js.map +1 -1
- package/build/components/autocomplete/index.js +1 -0
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/background-image-control/index.js +5 -0
- package/build/components/background-image-control/index.js.map +1 -1
- package/build/components/block-actions/index.js +1 -0
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +1 -0
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +1 -0
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +1 -0
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +32 -0
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +1 -0
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-card/index.js +45 -8
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-compare/index.js +1 -0
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-controls/fill.js +1 -0
- package/build/components/block-controls/fill.js.map +1 -1
- package/build/components/block-edit/edit.js +148 -10
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-edit/edit.native.js +1 -0
- package/build/components/block-edit/edit.native.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.js +1 -0
- package/build/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/index.native.js +1 -0
- package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build/components/block-inspector/index.js +1 -0
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.js +1 -0
- package/build/components/block-list/block-invalid-warning.js.map +1 -1
- package/build/components/block-list/block-list-context.native.js +1 -0
- package/build/components/block-list/block-list-context.native.js.map +1 -1
- package/build/components/block-list/block.js +1 -0
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +1 -0
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +2 -2
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +1 -0
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +4 -5
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +61 -8
- package/build/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -1
- package/build/components/block-list/use-block-props/use-focus-first-element.js +1 -0
- package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +1 -0
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list/zoom-out-separator.js +20 -3
- package/build/components/block-list/zoom-out-separator.js.map +1 -1
- package/build/components/block-lock/modal.js +5 -4
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-manager/category.js +1 -0
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/checklist.js +1 -0
- package/build/components/block-manager/checklist.js.map +1 -1
- package/build/components/block-manager/index.js +1 -0
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/block-media-update-progress/index.native.js +1 -0
- package/build/components/block-media-update-progress/index.native.js.map +1 -1
- package/build/components/block-mover/index.native.js +1 -0
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-mover/mover-description.native.js +1 -0
- package/build/components/block-mover/mover-description.native.js.map +1 -1
- package/build/components/block-parent-selector/index.js +2 -15
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +1 -0
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/use-patterns-setup.js +1 -0
- package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build/components/block-patterns-list/index.js +1 -0
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +1 -0
- package/build/components/block-quick-navigation/index.js.map +1 -1
- package/build/components/block-rename/rename-control.js +1 -0
- package/build/components/block-rename/rename-control.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +6 -8
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-styles/index.js +1 -0
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +1 -0
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/menu-items.js +1 -0
- package/build/components/block-styles/menu-items.js.map +1 -1
- package/build/components/block-styles/preview.native.js +1 -0
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-styles/utils.js +3 -3
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +1 -0
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js +1 -0
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +1 -0
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +1 -0
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +1 -0
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/use-transformed-patterns.js +1 -0
- package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build/components/block-switcher/utils.js +1 -0
- package/build/components/block-switcher/utils.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -0
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/block-toolbar/change-design.js +1 -0
- package/build/components/block-toolbar/change-design.js.map +1 -1
- package/build/components/block-toolbar/index.js +2 -1
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-tools/use-selected-block-tool-props.js +1 -0
- package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +19 -6
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-types-list/index.js +1 -0
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-variation-picker/index.js +1 -0
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +1 -0
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +1 -0
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +1 -0
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/index.js +1 -0
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +1 -0
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/border-radius-control/utils.js +1 -0
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/button-block-appender/index.js +1 -5
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/child-layout-control/index.js +6 -0
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/colors/utils.js +1 -0
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +1 -0
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +52 -11
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +1 -0
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js +1 -0
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build/components/contrast-checker/index.native.js +1 -1
- package/build/components/contrast-checker/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +1 -0
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/date-format-picker/index.js +8 -16
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/dimensions-tool/scale-tool.js +1 -0
- package/build/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build/components/duotone/utils.js +1 -0
- package/build/components/duotone/utils.js.map +1 -1
- package/build/components/editor-styles/index.js +1 -0
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/font-appearance-control/index.js +10 -0
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +11 -1
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +1 -0
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/border-panel.js +1 -0
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +28 -8
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.native.js +1 -0
- package/build/components/global-styles/color-panel.native.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +1 -0
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +3 -2
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-global-styles-changes.js +1 -0
- package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build/components/global-styles/shadow-panel-components.js +1 -0
- package/build/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +2 -1
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-context.native.js +1 -0
- package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +2 -1
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +10 -0
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +1 -0
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/grid/utils.js +13 -1
- package/build/components/grid/utils.js.map +1 -1
- package/build/components/iframe/get-compatibility-styles.js +1 -0
- package/build/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build/components/iframe/index.js +1 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +1 -0
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/index.js +15 -8
- package/build/components/index.js.map +1 -1
- package/build/components/inner-blocks/use-block-context.js +1 -0
- package/build/components/inner-blocks/use-block-context.js.map +1 -1
- package/build/components/inner-blocks/use-inner-block-template-sync.js +11 -11
- package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js +1 -1
- package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -0
- package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -0
- package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/index.js +1 -1
- package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -4
- package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
- package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -0
- package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +2 -1
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +1 -0
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +2 -2
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +1 -0
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/hooks/use-patterns-state.js +1 -0
- package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build/components/inserter/index.js +7 -15
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +1 -0
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +1 -0
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +1 -0
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +1 -0
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/menu.js +1 -0
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +1 -0
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +2 -13
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/search-items.js +1 -0
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +1 -0
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/tabs.native.js +1 -0
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/utils.native.js +1 -0
- package/build/components/inserter/utils.native.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +1 -0
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +1 -0
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/slot.js +2 -13
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +1 -0
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -0
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +1 -0
- package/build/components/inspector-popover-header/index.js.map +1 -1
- package/build/components/justify-content-control/ui.js +1 -0
- package/build/components/justify-content-control/ui.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +2 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/line-height-control/index.js +9 -0
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/index.js +13 -1
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +11 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-item.js +12 -1
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +13 -1
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/settings.js +1 -0
- package/build/components/link-control/settings.js.map +1 -1
- package/build/components/link-control/use-internal-value.js +1 -0
- package/build/components/link-control/use-internal-value.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +1 -0
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/block-select-button.js +1 -0
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +1 -0
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +1 -0
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/index.js +1 -0
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +1 -0
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/list-view/use-clipboard-handler.js +1 -0
- package/build/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build/components/list-view/use-list-view-block-indexes.js +1 -0
- package/build/components/list-view/use-list-view-block-indexes.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +1 -0
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/utils.js +1 -0
- package/build/components/list-view/utils.js.map +1 -1
- package/build/components/media-placeholder/index.js +3 -2
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +1 -0
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +27 -26
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/index.native.js +1 -0
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +9 -25
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +1 -0
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/panel-color-settings/index.js +1 -0
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/plain-text/index.js +34 -0
- package/build/components/plain-text/index.js.map +1 -1
- package/build/components/provider/index.js +61 -5
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +1 -0
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/provider/use-media-upload-settings.js +28 -0
- package/build/components/provider/use-media-upload-settings.js.map +1 -0
- package/build/components/resolution-tool/index.js +3 -1
- package/build/components/resolution-tool/index.js.map +1 -1
- package/build/components/responsive-block-control/index.js +2 -1
- package/build/components/responsive-block-control/index.js.map +1 -1
- package/build/components/rich-text/embed-handler-picker.native.js +1 -0
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build/components/rich-text/event-listeners/before-input-rules.js +1 -0
- package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
- package/build/components/rich-text/event-listeners/delete.js +7 -1
- package/build/components/rich-text/event-listeners/delete.js.map +1 -1
- package/build/components/rich-text/event-listeners/index.js +1 -0
- package/build/components/rich-text/event-listeners/index.js.map +1 -1
- package/build/components/rich-text/event-listeners/input-rules.js +1 -0
- package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build/components/rich-text/event-listeners/paste-handler.js +1 -0
- package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
- package/build/components/rich-text/file-paste-handler.native.js +1 -0
- package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build/components/rich-text/format-edit.js +1 -0
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +1 -0
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/index.js +3 -2
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +1 -0
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/multiline.js +1 -0
- package/build/components/rich-text/multiline.js.map +1 -1
- package/build/components/rich-text/native/format-edit.js +1 -0
- package/build/components/rich-text/native/format-edit.js.map +1 -1
- package/build/components/rich-text/native/get-format-colors.native.js +1 -0
- package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build/components/rich-text/native/index.native.js +1 -0
- package/build/components/rich-text/native/index.native.js.map +1 -1
- package/build/components/rich-text/native/toolbar-button-with-options.native.js +1 -0
- package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
- package/build/components/rich-text/native/use-format-types.js +1 -0
- package/build/components/rich-text/native/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +1 -0
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -0
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/axial.js +1 -0
- package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/separated.js +1 -0
- package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/single.js +1 -0
- package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -0
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/spacing-sizes-control/utils.js +1 -0
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/tabbed-sidebar/index.js +1 -0
- package/build/components/tabbed-sidebar/index.js.map +1 -1
- package/build/components/text-alignment-control/index.js +1 -0
- package/build/components/text-alignment-control/index.js.map +1 -1
- package/build/components/text-decoration-control/index.js +1 -0
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +1 -0
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/unsupported-block-details/index.native.js +1 -0
- package/build/components/unsupported-block-details/index.native.js.map +1 -1
- package/build/components/url-input/index.js +1 -0
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +1 -0
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/use-block-commands/index.js +1 -0
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +3 -1
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +1 -0
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-flash-editable-blocks/index.js +1 -0
- package/build/components/use-flash-editable-blocks/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +1 -0
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.native.js +1 -0
- package/build/components/use-on-block-drop/index.native.js.map +1 -1
- package/build/components/use-paste-styles/index.js +1 -0
- package/build/components/use-paste-styles/index.js.map +1 -1
- package/build/components/warning/index.js +3 -3
- package/build/components/warning/index.js.map +1 -1
- package/build/components/writing-flow/use-arrow-nav.js +1 -0
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/components/writing-flow/use-clipboard-handler.js +1 -0
- package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build/components/writing-flow/use-input.js +1 -0
- package/build/components/writing-flow/use-input.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +1 -0
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/components/writing-flow/utils.js +1 -0
- package/build/components/writing-flow/utils.js.map +1 -1
- package/build/components/writing-mode-control/index.js +1 -0
- package/build/components/writing-mode-control/index.js.map +1 -1
- package/build/hooks/align.js +1 -0
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/align.native.js +1 -0
- package/build/hooks/align.native.js.map +1 -1
- package/build/hooks/background.js +2 -0
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-bindings.js +16 -14
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/block-hooks.js +1 -0
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js +1 -0
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/border.js +4 -3
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +1 -1
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/dimensions.js +2 -2
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +1 -0
- 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/gap.js +2 -2
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/index.native.js +7 -0
- package/build/hooks/index.native.js.map +1 -1
- package/build/hooks/layout.js +1 -0
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/position.js +1 -0
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/style.js +7 -6
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +8 -7
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/text-align.js +1 -0
- package/build/hooks/text-align.js.map +1 -1
- package/build/hooks/typography.js +7 -6
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/use-zoom-out.js +58 -14
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/hooks/utils.js +2 -1
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +1 -0
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/flex.js +1 -0
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +1 -0
- package/build/layouts/flow.js.map +1 -1
- package/build/layouts/index.js +1 -0
- package/build/layouts/index.js.map +1 -1
- package/build/layouts/utils.js +1 -0
- package/build/layouts/utils.js.map +1 -1
- package/build/store/actions.js +1 -0
- package/build/store/actions.js.map +1 -1
- package/build/store/get-block-settings.js +1 -0
- package/build/store/get-block-settings.js.map +1 -1
- package/build/store/private-actions.js +2 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +12 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +94 -12
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +19 -23
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +1 -0
- package/build/store/utils.js.map +1 -1
- package/build/utils/block-bindings.js +96 -0
- package/build/utils/block-bindings.js.map +1 -1
- package/build/utils/get-editor-region.js +1 -0
- package/build/utils/get-editor-region.js.map +1 -1
- package/build/utils/get-font-styles-and-weights.js +1 -0
- package/build/utils/get-font-styles-and-weights.js.map +1 -1
- package/build/utils/math.js +1 -0
- package/build/utils/math.js.map +1 -1
- package/build/utils/object.js +1 -0
- package/build/utils/object.js.map +1 -1
- package/build/utils/selection.js +1 -0
- package/build/utils/selection.js.map +1 -1
- package/build/utils/transform-styles/index.js +1 -0
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/autocompleters/block.js +1 -0
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/autocompleters/link.js +1 -0
- package/build-module/autocompleters/link.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +1 -0
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/audio-player/index.native.js +2 -2
- package/build-module/components/audio-player/index.native.js.map +1 -1
- package/build-module/components/autocomplete/index.js +1 -0
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/background-image-control/index.js +6 -1
- package/build-module/components/background-image-control/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +1 -0
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +1 -0
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +1 -0
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +1 -0
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +32 -0
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +1 -0
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-card/index.js +45 -8
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-compare/index.js +1 -0
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-controls/fill.js +1 -0
- package/build-module/components/block-controls/fill.js.map +1 -1
- package/build-module/components/block-edit/edit.js +149 -11
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-edit/edit.native.js +1 -0
- package/build-module/components/block-edit/edit.native.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.js +1 -0
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/index.native.js +1 -0
- package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
- package/build-module/components/block-inspector/index.js +1 -0
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.js +1 -0
- package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
- package/build-module/components/block-list/block-list-context.native.js +1 -0
- package/build-module/components/block-list/block-list-context.native.js.map +1 -1
- package/build-module/components/block-list/block.js +1 -0
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +1 -0
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +3 -3
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +1 -0
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +3 -4
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +60 -8
- package/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js +1 -0
- package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +1 -0
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list/zoom-out-separator.js +20 -3
- package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
- package/build-module/components/block-lock/modal.js +5 -4
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-manager/category.js +1 -0
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/checklist.js +1 -0
- package/build-module/components/block-manager/checklist.js.map +1 -1
- package/build-module/components/block-manager/index.js +1 -0
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/block-media-update-progress/index.native.js +1 -0
- package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +1 -0
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-mover/mover-description.native.js +1 -0
- package/build-module/components/block-mover/mover-description.native.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +2 -15
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +1 -0
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/use-patterns-setup.js +1 -0
- package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +1 -0
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +1 -0
- package/build-module/components/block-quick-navigation/index.js.map +1 -1
- package/build-module/components/block-rename/rename-control.js +1 -0
- package/build-module/components/block-rename/rename-control.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +6 -8
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -0
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +1 -0
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-styles/menu-items.js +1 -0
- package/build-module/components/block-styles/menu-items.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +1 -0
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-styles/utils.js +3 -3
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +1 -0
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -0
- package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +1 -0
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build-module/components/block-switcher/index.js +1 -0
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -0
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/use-transformed-patterns.js +1 -0
- package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
- package/build-module/components/block-switcher/utils.js +1 -0
- package/build-module/components/block-switcher/utils.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -0
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/block-toolbar/change-design.js +1 -0
- package/build-module/components/block-toolbar/change-design.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +2 -1
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-tools/use-selected-block-tool-props.js +1 -0
- package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +19 -6
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-types-list/index.js +1 -0
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +1 -0
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +1 -0
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +1 -0
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +1 -0
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +1 -0
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +1 -0
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +1 -0
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +2 -6
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +7 -1
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/colors/utils.js +1 -0
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +1 -0
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +52 -11
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -0
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -0
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build-module/components/contrast-checker/index.native.js +2 -2
- package/build-module/components/contrast-checker/index.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +1 -0
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +8 -16
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js +1 -0
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build-module/components/duotone/utils.js +1 -0
- package/build-module/components/duotone/utils.js.map +1 -1
- package/build-module/components/editor-styles/index.js +1 -0
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +9 -0
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +11 -1
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +1 -0
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +1 -0
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +30 -10
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.native.js +1 -0
- package/build-module/components/global-styles/color-panel.native.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -0
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +4 -3
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-global-styles-changes.js +1 -0
- package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
- package/build-module/components/global-styles/shadow-panel-components.js +1 -0
- package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +2 -1
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-context.native.js +1 -0
- package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +2 -1
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +1 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +10 -0
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +1 -0
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/grid/utils.js +13 -1
- package/build-module/components/grid/utils.js.map +1 -1
- package/build-module/components/iframe/get-compatibility-styles.js +1 -0
- package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
- package/build-module/components/iframe/index.js +1 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -0
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/index.js +4 -4
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/inner-blocks/use-block-context.js +1 -0
- package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js +12 -12
- package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js +1 -1
- package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -0
- package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +1 -0
- 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 -1
- 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 +5 -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 +2 -2
- 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 +1 -0
- package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +2 -1
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +1 -0
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +2 -2
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +1 -0
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-patterns-state.js +1 -0
- package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
- package/build-module/components/inserter/index.js +7 -15
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +1 -0
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +1 -0
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +1 -0
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +1 -0
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/menu.js +1 -0
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +1 -0
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +2 -13
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/search-items.js +1 -0
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +1 -0
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +1 -0
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter/utils.native.js +1 -0
- package/build-module/components/inserter/utils.native.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +1 -0
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +1 -0
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +3 -14
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +1 -0
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -0
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +1 -0
- package/build-module/components/inspector-popover-header/index.js.map +1 -1
- package/build-module/components/justify-content-control/ui.js +1 -0
- package/build-module/components/justify-content-control/ui.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +2 -2
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +8 -0
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/index.js +11 -0
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +9 -0
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/search-item.js +9 -0
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +12 -1
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/settings.js +1 -0
- package/build-module/components/link-control/settings.js.map +1 -1
- package/build-module/components/link-control/use-internal-value.js +1 -0
- package/build-module/components/link-control/use-internal-value.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +1 -0
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +1 -0
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +1 -0
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +1 -0
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/index.js +1 -0
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +1 -0
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/list-view/use-clipboard-handler.js +1 -0
- package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
- package/build-module/components/list-view/use-list-view-block-indexes.js +1 -0
- package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +1 -0
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/utils.js +1 -0
- package/build-module/components/list-view/utils.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +4 -3
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +1 -0
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +29 -28
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +1 -0
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +9 -25
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +1 -0
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/panel-color-settings/index.js +1 -0
- package/build-module/components/panel-color-settings/index.js.map +1 -1
- package/build-module/components/plain-text/index.js +34 -0
- package/build-module/components/plain-text/index.js.map +1 -1
- package/build-module/components/provider/index.js +62 -5
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +1 -0
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/provider/use-media-upload-settings.js +22 -0
- package/build-module/components/provider/use-media-upload-settings.js.map +1 -0
- package/build-module/components/resolution-tool/index.js +3 -1
- package/build-module/components/resolution-tool/index.js.map +1 -1
- package/build-module/components/responsive-block-control/index.js +2 -1
- package/build-module/components/responsive-block-control/index.js.map +1 -1
- package/build-module/components/rich-text/embed-handler-picker.native.js +1 -0
- package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/before-input-rules.js +1 -0
- package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/delete.js +7 -1
- package/build-module/components/rich-text/event-listeners/delete.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/index.js +1 -0
- package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/input-rules.js +1 -0
- package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
- package/build-module/components/rich-text/event-listeners/paste-handler.js +1 -0
- package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
- package/build-module/components/rich-text/file-paste-handler.native.js +1 -0
- package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +1 -0
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +1 -0
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/index.js +2 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +1 -0
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/multiline.js +1 -0
- package/build-module/components/rich-text/multiline.js.map +1 -1
- package/build-module/components/rich-text/native/format-edit.js +1 -0
- package/build-module/components/rich-text/native/format-edit.js.map +1 -1
- package/build-module/components/rich-text/native/get-format-colors.native.js +1 -0
- package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
- package/build-module/components/rich-text/native/index.native.js +1 -0
- package/build-module/components/rich-text/native/index.native.js.map +1 -1
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +1 -0
- package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
- package/build-module/components/rich-text/native/use-format-types.js +1 -0
- package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +1 -0
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -0
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/single.js +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/spacing-sizes-control/utils.js +1 -0
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/tabbed-sidebar/index.js +1 -0
- package/build-module/components/tabbed-sidebar/index.js.map +1 -1
- package/build-module/components/text-alignment-control/index.js +1 -0
- package/build-module/components/text-alignment-control/index.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +1 -0
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +1 -0
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/unsupported-block-details/index.native.js +1 -0
- package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -0
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +1 -0
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +1 -0
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +3 -1
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +1 -0
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-flash-editable-blocks/index.js +1 -0
- package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +1 -0
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.native.js +1 -0
- package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
- package/build-module/components/use-paste-styles/index.js +1 -0
- package/build-module/components/use-paste-styles/index.js.map +1 -1
- package/build-module/components/warning/index.js +3 -3
- package/build-module/components/warning/index.js.map +1 -1
- package/build-module/components/writing-flow/use-arrow-nav.js +1 -0
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/components/writing-flow/use-clipboard-handler.js +1 -0
- package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
- package/build-module/components/writing-flow/use-input.js +1 -0
- package/build-module/components/writing-flow/use-input.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +1 -0
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/components/writing-flow/utils.js +1 -0
- package/build-module/components/writing-flow/utils.js.map +1 -1
- package/build-module/components/writing-mode-control/index.js +1 -0
- package/build-module/components/writing-mode-control/index.js.map +1 -1
- package/build-module/hooks/align.js +1 -0
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/align.native.js +1 -0
- package/build-module/hooks/align.native.js.map +1 -1
- package/build-module/hooks/background.js +2 -0
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-bindings.js +14 -12
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/block-hooks.js +1 -0
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +1 -0
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/border.js +4 -3
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +1 -1
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/dimensions.js +2 -2
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +1 -0
- 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/gap.js +2 -2
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/index.js +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/index.native.js +1 -0
- package/build-module/hooks/index.native.js.map +1 -1
- package/build-module/hooks/layout.js +1 -0
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/position.js +1 -0
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/style.js +7 -6
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +8 -7
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/text-align.js +1 -0
- package/build-module/hooks/text-align.js.map +1 -1
- package/build-module/hooks/typography.js +7 -6
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +58 -15
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/hooks/utils.js +2 -1
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +1 -0
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/flex.js +1 -0
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +1 -0
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/layouts/index.js +1 -0
- package/build-module/layouts/index.js.map +1 -1
- package/build-module/layouts/utils.js +1 -0
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/store/actions.js +1 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/get-block-settings.js +1 -0
- package/build-module/store/get-block-settings.js.map +1 -1
- package/build-module/store/private-actions.js +2 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +12 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +94 -12
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +19 -23
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +1 -0
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/block-bindings.js +91 -0
- package/build-module/utils/block-bindings.js.map +1 -1
- package/build-module/utils/get-editor-region.js +1 -0
- package/build-module/utils/get-editor-region.js.map +1 -1
- package/build-module/utils/get-font-styles-and-weights.js +1 -0
- package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
- package/build-module/utils/math.js +1 -0
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/object.js +1 -0
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/selection.js +1 -0
- package/build-module/utils/selection.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +1 -0
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/content-rtl.css +1 -1
- package/build-style/content.css +1 -1
- package/build-style/style-rtl.css +53 -57
- package/build-style/style.css +53 -57
- package/package.json +33 -33
- package/src/components/alignment-control/stories/aliginment-toolbar.story.js +2 -2
- package/src/components/alignment-control/stories/index.story.js +2 -2
- package/src/components/audio-player/index.native.js +2 -2
- package/src/components/background-image-control/index.js +4 -0
- package/src/components/background-image-control/style.scss +4 -2
- package/src/components/block-alignment-matrix-control/README.md +29 -6
- package/src/components/block-alignment-matrix-control/index.js +31 -0
- package/src/components/block-alignment-matrix-control/stories/index.story.js +78 -0
- package/src/components/block-card/README.md +7 -0
- package/src/components/block-card/index.js +41 -12
- package/src/components/block-card/stories/index.story.js +79 -0
- package/src/components/block-card/style.scss +9 -1
- package/src/components/block-edit/edit.js +218 -11
- package/src/components/block-heading-level-dropdown/stories/index.story.js +61 -0
- package/src/components/block-list/index.js +2 -7
- package/src/components/block-list/use-block-props/index.js +3 -5
- package/src/components/block-list/use-block-props/use-firefox-draggable-compatibility.js +64 -6
- package/src/components/block-list/zoom-out-separator.js +30 -0
- package/src/components/block-lock/modal.js +4 -6
- package/src/components/block-parent-selector/index.js +1 -19
- package/src/components/block-patterns-list/stories/fixtures.js +1 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +17 -20
- package/src/components/block-styles/utils.js +3 -3
- package/src/components/block-title/stories/index.story.js +76 -0
- package/src/components/block-toolbar/index.js +1 -0
- package/src/components/block-tools/style.scss +1 -0
- package/src/components/block-tools/zoom-out-mode-inserters.js +21 -3
- package/src/components/border-radius-control/README.md +59 -0
- package/src/components/border-radius-control/stories/index.story.js +58 -0
- package/src/components/button-block-appender/index.js +2 -7
- package/src/components/child-layout-control/index.js +14 -0
- package/src/components/colors-gradients/dropdown.js +57 -8
- package/src/components/colors-gradients/style.scss +26 -0
- package/src/components/contrast-checker/index.native.js +2 -2
- package/src/components/contrast-checker/stories/index.story.js +117 -0
- package/src/components/date-format-picker/README.md +6 -13
- package/src/components/date-format-picker/index.js +10 -17
- package/src/components/date-format-picker/stories/index.story.js +69 -0
- package/src/components/date-format-picker/style.scss +3 -1
- package/src/components/default-block-appender/content.scss +1 -0
- package/src/components/dimensions-tool/stories/aspect-ratio-tool.story.js +3 -2
- package/src/components/dimensions-tool/stories/index.story.js +3 -2
- package/src/components/dimensions-tool/stories/scale-tool.story.js +3 -2
- package/src/components/dimensions-tool/stories/width-height-tool.story.js +3 -2
- package/src/components/font-appearance-control/index.js +15 -0
- package/src/components/font-family/README.md +1 -0
- package/src/components/font-family/index.js +17 -1
- package/src/components/font-family/stories/index.story.js +1 -0
- package/src/components/global-styles/color-panel.js +29 -7
- package/src/components/global-styles/filters-panel.js +3 -6
- package/src/components/global-styles/test/use-global-styles-output.js +1 -1
- package/src/components/global-styles/typography-utils.js +1 -1
- package/src/components/global-styles/use-global-styles-output.js +1 -1
- package/src/components/grid/grid-visualizer.js +11 -0
- package/src/components/grid/utils.js +19 -1
- package/src/components/iframe/index.js +1 -1
- package/src/components/index.js +7 -4
- package/src/components/inner-blocks/use-inner-block-template-sync.js +17 -10
- package/src/components/inserter/block-patterns-explorer/index.js +2 -3
- package/src/components/inserter/block-patterns-tab/index.js +3 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -4
- package/src/components/inserter/block-patterns-tab/patterns-filter.js +2 -2
- package/src/components/inserter/block-types-tab.js +1 -1
- package/src/components/inserter/category-tabs/index.js +3 -2
- package/src/components/inserter/index.js +1 -13
- package/src/components/inserter/menu.js +2 -0
- package/src/components/inserter/quick-inserter.js +2 -25
- package/src/components/inspector-controls/slot.js +3 -22
- package/src/components/keyboard-shortcuts/index.js +2 -2
- package/src/components/line-height-control/README.md +1 -0
- package/src/components/line-height-control/index.js +12 -0
- package/src/components/line-height-control/stories/index.story.js +1 -0
- package/src/components/line-height-control/test/index.js +7 -1
- package/src/components/link-control/index.js +10 -0
- package/src/components/link-control/search-input.js +9 -0
- package/src/components/link-control/search-item.js +9 -0
- package/src/components/link-control/search-results.js +12 -1
- package/src/components/list-view/style.scss +10 -5
- package/src/components/media-placeholder/index.js +3 -3
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +28 -36
- package/src/components/media-replace-flow/style.scss +6 -6
- package/src/components/multi-selection-inspector/index.js +17 -27
- package/src/components/multi-selection-inspector/style.scss +0 -12
- package/src/components/plain-text/README.md +2 -2
- package/src/components/plain-text/index.js +34 -0
- package/src/components/plain-text/stories/index.story.js +75 -0
- package/src/components/provider/index.js +81 -4
- package/src/components/provider/use-media-upload-settings.js +25 -0
- package/src/components/resolution-tool/index.js +2 -0
- package/src/components/resolution-tool/stories/index.story.js +37 -9
- package/src/components/responsive-block-control/index.js +1 -1
- package/src/components/rich-text/event-listeners/delete.js +6 -1
- package/src/components/rich-text/index.js +1 -1
- package/src/components/spacing-sizes-control/style.scss +0 -29
- package/src/components/text-alignment-control/README.md +49 -0
- package/src/components/text-alignment-control/stories/index.story.js +56 -18
- package/src/components/text-decoration-control/README.md +0 -1
- package/src/components/text-decoration-control/stories/index.story.js +51 -16
- package/src/components/text-transform-control/README.md +3 -4
- package/src/components/text-transform-control/stories/index.story.js +53 -16
- package/src/components/use-block-drop-zone/index.js +8 -1
- package/src/components/warning/index.js +3 -4
- package/src/components/warning/stories/index.story.js +86 -0
- package/src/components/warning/test/index.js +3 -1
- package/src/components/writing-mode-control/stories/index.story.js +56 -0
- package/src/hooks/background.js +6 -0
- package/src/hooks/block-bindings.js +17 -18
- package/src/hooks/border.js +9 -3
- package/src/hooks/color.js +1 -1
- package/src/hooks/dimensions.js +2 -2
- package/src/hooks/font-family.js +1 -1
- package/src/hooks/gap.js +2 -2
- package/src/hooks/index.js +0 -1
- package/src/hooks/index.native.js +1 -0
- package/src/hooks/style.js +12 -6
- package/src/hooks/supports.js +7 -7
- package/src/hooks/test/font-size.js +15 -12
- package/src/hooks/test/style.js +2 -1
- package/src/hooks/typography.js +6 -6
- package/src/hooks/use-zoom-out.js +56 -16
- package/src/hooks/utils.js +1 -1
- package/src/store/private-actions.js +1 -0
- package/src/store/private-selectors.js +15 -5
- package/src/store/reducer.js +112 -19
- package/src/store/selectors.js +32 -32
- package/src/store/test/private-selectors.js +53 -9
- package/src/store/test/reducer.js +172 -166
- package/src/store/test/selectors.js +24 -1
- package/src/utils/block-bindings.js +95 -0
- package/tsconfig.json +2 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/build/hooks/use-bindings-attributes.js +0 -261
- package/build/hooks/use-bindings-attributes.js.map +0 -1
- package/build-module/hooks/use-bindings-attributes.js +0 -252
- package/build-module/hooks/use-bindings-attributes.js.map +0 -1
- package/src/hooks/use-bindings-attributes.js +0 -322
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["parse","grammarParse","selectBlockPatternsKey","unlock","STORE_NAME","getSectionRootClientId","isFiltered","Symbol","parsedPatternCache","WeakMap","grammarMapCache","parsePattern","pattern","blocks","content","__unstableSkipMigrationLogs","length","attributes","metadata","categories","patternName","name","title","getParsedPattern","parsedPattern","get","set","getGrammar","grammarMap","filter","block","blockName","checkAllowList","list","item","defaultResult","Array","isArray","includes","checkAllowListRecursive","allowedBlockTypes","blocksQueue","shift","isAllowed","innerBlocks","forEach","innerBlock","push","getAllPatternsDependants","select","state","settings","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","blockPatterns","getReusableBlocks","getInsertBlockTypeDependants","rootClientId","blockListSettings","byClientId","templateLock","blockEditingModes","__unstableGetEditorMode"],"sources":["@wordpress/block-editor/src/store/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport { parse as grammarParse } from '@wordpress/block-serialization-default-parser';\n\n/**\n * Internal dependencies\n */\nimport { selectBlockPatternsKey } from './private-keys';\nimport { unlock } from '../lock-unlock';\nimport { STORE_NAME } from './constants';\nimport { getSectionRootClientId } from './private-selectors';\n\nexport const isFiltered = Symbol( 'isFiltered' );\nconst parsedPatternCache = new WeakMap();\nconst grammarMapCache = new WeakMap();\n\nfunction parsePattern( pattern ) {\n\tconst blocks = parse( pattern.content, {\n\t\t__unstableSkipMigrationLogs: true,\n\t} );\n\tif ( blocks.length === 1 ) {\n\t\tblocks[ 0 ].attributes = {\n\t\t\t...blocks[ 0 ].attributes,\n\t\t\tmetadata: {\n\t\t\t\t...( blocks[ 0 ].attributes.metadata || {} ),\n\t\t\t\tcategories: pattern.categories,\n\t\t\t\tpatternName: pattern.name,\n\t\t\t\tname: blocks[ 0 ].attributes.metadata?.name || pattern.title,\n\t\t\t},\n\t\t};\n\t}\n\treturn {\n\t\t...pattern,\n\t\tblocks,\n\t};\n}\n\nexport function getParsedPattern( pattern ) {\n\tlet parsedPattern = parsedPatternCache.get( pattern );\n\tif ( ! parsedPattern ) {\n\t\tparsedPattern = parsePattern( pattern );\n\t\tparsedPatternCache.set( pattern, parsedPattern );\n\t}\n\treturn parsedPattern;\n}\n\nexport function getGrammar( pattern ) {\n\tlet grammarMap = grammarMapCache.get( pattern );\n\tif ( ! grammarMap ) {\n\t\tgrammarMap = grammarParse( pattern.content );\n\t\t// Block names are null only at the top level for whitespace.\n\t\tgrammarMap = grammarMap.filter( ( block ) => block.blockName !== null );\n\t\tgrammarMapCache.set( pattern, grammarMap );\n\t}\n\treturn grammarMap;\n}\n\nexport const checkAllowList = ( list, item, defaultResult = null ) => {\n\tif ( typeof list === 'boolean' ) {\n\t\treturn list;\n\t}\n\tif ( Array.isArray( list ) ) {\n\t\t// TODO: when there is a canonical way to detect that we are editing a post\n\t\t// the following check should be changed to something like:\n\t\t// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )\n\t\tif ( list.includes( 'core/post-content' ) && item === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn list.includes( item );\n\t}\n\treturn defaultResult;\n};\n\nexport const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {\n\tif ( typeof allowedBlockTypes === 'boolean' ) {\n\t\treturn allowedBlockTypes;\n\t}\n\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\n\t\tconst isAllowed = checkAllowList(\n\t\t\tallowedBlockTypes,\n\t\t\tblock.name || block.blockName,\n\t\t\ttrue\n\t\t);\n\t\tif ( ! isAllowed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\n\treturn true;\n};\n\nexport const getAllPatternsDependants = ( select ) => ( state ) => {\n\treturn [\n\t\tstate.settings.__experimentalBlockPatterns,\n\t\tstate.settings.__experimentalUserPatternCategories,\n\t\tstate.settings.__experimentalReusableBlocks,\n\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\tstate.blockPatterns,\n\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t];\n};\n\nexport const getInsertBlockTypeDependants =\n\t( select ) => ( state, rootClientId ) => {\n\t\treturn [\n\t\t\tstate.blockListSettings[ rootClientId ],\n\t\t\tstate.blocks.byClientId.get( rootClientId ),\n\t\t\tstate.settings.allowedBlockTypes,\n\t\t\tstate.settings.templateLock,\n\t\t\tstate.blockEditingModes,\n\t\t\tselect( STORE_NAME ).__unstableGetEditorMode( state ),\n\t\t\tgetSectionRootClientId( state ),\n\t\t];\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;AACzC,SAASA,KAAK,IAAIC,YAAY,QAAQ,+CAA+C;;AAErF;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,gBAAgB;AACvD,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,sBAAsB,QAAQ,qBAAqB;AAE5D,OAAO,MAAMC,UAAU,GAAGC,MAAM,CAAE,YAAa,CAAC;AAChD,MAAMC,kBAAkB,GAAG,IAAIC,OAAO,CAAC,CAAC;AACxC,MAAMC,eAAe,GAAG,IAAID,OAAO,CAAC,CAAC;AAErC,SAASE,YAAYA,CAAEC,OAAO,EAAG;EAChC,MAAMC,MAAM,GAAGb,KAAK,CAAEY,OAAO,CAACE,OAAO,EAAE;IACtCC,2BAA2B,EAAE;EAC9B,CAAE,CAAC;EACH,IAAKF,MAAM,CAACG,MAAM,KAAK,CAAC,EAAG;IAC1BH,MAAM,CAAE,CAAC,CAAE,CAACI,UAAU,GAAG;MACxB,GAAGJ,MAAM,CAAE,CAAC,CA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AE,CAAC,CAACoD,iBAAiB,CAAC,CAAC,CAClD;AACF,CAAC;AAED,OAAO,MAAMC,4BAA4B,GACtCR,MAAM,IAAM,CAAEC,KAAK,EAAEQ,YAAY,KAAM;EACxC,OAAO,CACNR,KAAK,CAACS,iBAAiB,CAAED,YAAY,CAAE,EACvCR,KAAK,CAACrC,MAAM,CAAC+C,UAAU,CAACnC,GAAG,CAAEiC,YAAa,CAAC,EAC3CR,KAAK,CAACC,QAAQ,CAACX,iBAAiB,EAChCU,KAAK,CAACC,QAAQ,CAACU,YAAY,EAC3BX,KAAK,CAACY,iBAAiB,EACvBb,MAAM,CAAE7C,UAAW,CAAC,CAAC2D,uBAAuB,CAAEb,KAAM,CAAC,EACrD7C,sBAAsB,CAAE6C,KAAM,CAAC,CAC/B;AACF,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["parse","grammarParse","selectBlockPatternsKey","unlock","STORE_NAME","getSectionRootClientId","isFiltered","Symbol","parsedPatternCache","WeakMap","grammarMapCache","parsePattern","pattern","blocks","content","__unstableSkipMigrationLogs","length","attributes","metadata","categories","patternName","name","title","getParsedPattern","parsedPattern","get","set","getGrammar","grammarMap","filter","block","blockName","checkAllowList","list","item","defaultResult","Array","isArray","includes","checkAllowListRecursive","allowedBlockTypes","blocksQueue","shift","isAllowed","innerBlocks","forEach","innerBlock","push","getAllPatternsDependants","select","state","settings","__experimentalBlockPatterns","__experimentalUserPatternCategories","__experimentalReusableBlocks","blockPatterns","getReusableBlocks","getInsertBlockTypeDependants","rootClientId","blockListSettings","byClientId","templateLock","blockEditingModes","__unstableGetEditorMode"],"sources":["@wordpress/block-editor/src/store/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport { parse as grammarParse } from '@wordpress/block-serialization-default-parser';\n\n/**\n * Internal dependencies\n */\nimport { selectBlockPatternsKey } from './private-keys';\nimport { unlock } from '../lock-unlock';\nimport { STORE_NAME } from './constants';\nimport { getSectionRootClientId } from './private-selectors';\n\nexport const isFiltered = Symbol( 'isFiltered' );\nconst parsedPatternCache = new WeakMap();\nconst grammarMapCache = new WeakMap();\n\nfunction parsePattern( pattern ) {\n\tconst blocks = parse( pattern.content, {\n\t\t__unstableSkipMigrationLogs: true,\n\t} );\n\tif ( blocks.length === 1 ) {\n\t\tblocks[ 0 ].attributes = {\n\t\t\t...blocks[ 0 ].attributes,\n\t\t\tmetadata: {\n\t\t\t\t...( blocks[ 0 ].attributes.metadata || {} ),\n\t\t\t\tcategories: pattern.categories,\n\t\t\t\tpatternName: pattern.name,\n\t\t\t\tname: blocks[ 0 ].attributes.metadata?.name || pattern.title,\n\t\t\t},\n\t\t};\n\t}\n\treturn {\n\t\t...pattern,\n\t\tblocks,\n\t};\n}\n\nexport function getParsedPattern( pattern ) {\n\tlet parsedPattern = parsedPatternCache.get( pattern );\n\tif ( ! parsedPattern ) {\n\t\tparsedPattern = parsePattern( pattern );\n\t\tparsedPatternCache.set( pattern, parsedPattern );\n\t}\n\treturn parsedPattern;\n}\n\nexport function getGrammar( pattern ) {\n\tlet grammarMap = grammarMapCache.get( pattern );\n\tif ( ! grammarMap ) {\n\t\tgrammarMap = grammarParse( pattern.content );\n\t\t// Block names are null only at the top level for whitespace.\n\t\tgrammarMap = grammarMap.filter( ( block ) => block.blockName !== null );\n\t\tgrammarMapCache.set( pattern, grammarMap );\n\t}\n\treturn grammarMap;\n}\n\nexport const checkAllowList = ( list, item, defaultResult = null ) => {\n\tif ( typeof list === 'boolean' ) {\n\t\treturn list;\n\t}\n\tif ( Array.isArray( list ) ) {\n\t\t// TODO: when there is a canonical way to detect that we are editing a post\n\t\t// the following check should be changed to something like:\n\t\t// if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null )\n\t\tif ( list.includes( 'core/post-content' ) && item === null ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn list.includes( item );\n\t}\n\treturn defaultResult;\n};\n\nexport const checkAllowListRecursive = ( blocks, allowedBlockTypes ) => {\n\tif ( typeof allowedBlockTypes === 'boolean' ) {\n\t\treturn allowedBlockTypes;\n\t}\n\n\tconst blocksQueue = [ ...blocks ];\n\twhile ( blocksQueue.length > 0 ) {\n\t\tconst block = blocksQueue.shift();\n\n\t\tconst isAllowed = checkAllowList(\n\t\t\tallowedBlockTypes,\n\t\t\tblock.name || block.blockName,\n\t\t\ttrue\n\t\t);\n\t\tif ( ! isAllowed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tblock.innerBlocks?.forEach( ( innerBlock ) => {\n\t\t\tblocksQueue.push( innerBlock );\n\t\t} );\n\t}\n\n\treturn true;\n};\n\nexport const getAllPatternsDependants = ( select ) => ( state ) => {\n\treturn [\n\t\tstate.settings.__experimentalBlockPatterns,\n\t\tstate.settings.__experimentalUserPatternCategories,\n\t\tstate.settings.__experimentalReusableBlocks,\n\t\tstate.settings[ selectBlockPatternsKey ]?.( select ),\n\t\tstate.blockPatterns,\n\t\tunlock( select( STORE_NAME ) ).getReusableBlocks(),\n\t];\n};\n\nexport const getInsertBlockTypeDependants =\n\t( select ) => ( state, rootClientId ) => {\n\t\treturn [\n\t\t\tstate.blockListSettings[ rootClientId ],\n\t\t\tstate.blocks.byClientId.get( rootClientId ),\n\t\t\tstate.settings.allowedBlockTypes,\n\t\t\tstate.settings.templateLock,\n\t\t\tstate.blockEditingModes,\n\t\t\tselect( STORE_NAME ).__unstableGetEditorMode( state ),\n\t\t\tgetSectionRootClientId( state ),\n\t\t];\n\t};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;AACzC,SAASA,KAAK,IAAIC,YAAY,QAAQ,+CAA+C;;AAErF;AACA;AACA;AACA,SAASC,sBAAsB,QAAQ,gBAAgB;AACvD,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,UAAU,QAAQ,aAAa;AACxC,SAASC,sBAAsB,QAAQ,qBAAqB;AAE5D,OAAO,MAAMC,UAAU,GAAGC,MAAM,CAAE,YAAa,C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CAAE,CAAC;EACJ;EAEA,OAAO,IAAI;AACZ,CAAC;AAED,OAAO,MAAME,wBAAwB,GAAKC,MAAM,IAAQC,KAAK,IAAM;EAClE,OAAO,CACNA,KAAK,CAACC,QAAQ,CAACC,2BAA2B,EAC1CF,KAAK,CAACC,QAAQ,CAACE,mCAAmC,EAClDH,KAAK,CAACC,QAAQ,CAACG,4BAA4B,EAC3CJ,KAAK,CAACC,QAAQ,CAAEjD,sBAAsB,CAAE,GAAI+C,MAAO,CAAC,EACpDC,KAAK,CAACK,aAAa,EACnBpD,MAAM,CAAE8C,MAAM,CAAE7C,UAAW,CAAE,CAAC,CAACoD,iBAAiB,CAAC,CAAC,CAClD;AACF,CAAC;AAED,OAAO,MAAMC,4BAA4B,GACtCR,MAAM,IAAM,CAAEC,KAAK,EAAEQ,YAAY,KAAM;EACxC,OAAO,CACNR,KAAK,CAACS,iBAAiB,CAAED,YAAY,CAAE,EACvCR,KAAK,CAACrC,MAAM,CAAC+C,UAAU,CAACnC,GAAG,CAAEiC,YAAa,CAAC,EAC3CR,KAAK,CAACC,QAAQ,CAACX,iBAAiB,EAChCU,KAAK,CAACC,QAAQ,CAACU,YAAY,EAC3BX,KAAK,CAACY,iBAAiB,EACvBb,MAAM,CAAE7C,UAAW,CAAC,CAAC2D,uBAAuB,CAAEb,KAAM,CAAC,EACrD7C,sBAAsB,CAAE6C,KAAM,CAAC,CAC/B;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* wp:polyfill */
|
|
1
2
|
/**
|
|
2
3
|
* WordPress dependencies
|
|
3
4
|
*/
|
|
@@ -8,10 +9,100 @@ import { useDispatch, useRegistry } from '@wordpress/data';
|
|
|
8
9
|
*/
|
|
9
10
|
import { store as blockEditorStore } from '../store';
|
|
10
11
|
import { useBlockEditContext } from '../components/block-edit';
|
|
12
|
+
const DEFAULT_ATTRIBUTE = '__default';
|
|
13
|
+
const PATTERN_OVERRIDES_SOURCE = 'core/pattern-overrides';
|
|
14
|
+
const BLOCK_BINDINGS_ALLOWED_BLOCKS = {
|
|
15
|
+
'core/paragraph': ['content'],
|
|
16
|
+
'core/heading': ['content'],
|
|
17
|
+
'core/image': ['id', 'url', 'title', 'alt'],
|
|
18
|
+
'core/button': ['url', 'text', 'linkTarget', 'rel']
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Checks if the given object is empty.
|
|
23
|
+
*
|
|
24
|
+
* @param {?Object} object The object to check.
|
|
25
|
+
*
|
|
26
|
+
* @return {boolean} Whether the object is empty.
|
|
27
|
+
*/
|
|
11
28
|
function isObjectEmpty(object) {
|
|
12
29
|
return !object || Object.keys(object).length === 0;
|
|
13
30
|
}
|
|
14
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Based on the given block name, checks if it is possible to bind the block.
|
|
34
|
+
*
|
|
35
|
+
* @param {string} blockName The name of the block.
|
|
36
|
+
*
|
|
37
|
+
* @return {boolean} Whether it is possible to bind the block to sources.
|
|
38
|
+
*/
|
|
39
|
+
export function canBindBlock(blockName) {
|
|
40
|
+
return blockName in BLOCK_BINDINGS_ALLOWED_BLOCKS;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Based on the given block name and attribute name, checks if it is possible to bind the block attribute.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} blockName The name of the block.
|
|
47
|
+
* @param {string} attributeName The name of attribute.
|
|
48
|
+
*
|
|
49
|
+
* @return {boolean} Whether it is possible to bind the block attribute.
|
|
50
|
+
*/
|
|
51
|
+
export function canBindAttribute(blockName, attributeName) {
|
|
52
|
+
return canBindBlock(blockName) && BLOCK_BINDINGS_ALLOWED_BLOCKS[blockName].includes(attributeName);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Gets the bindable attributes for a given block.
|
|
57
|
+
*
|
|
58
|
+
* @param {string} blockName The name of the block.
|
|
59
|
+
*
|
|
60
|
+
* @return {string[]} The bindable attributes for the block.
|
|
61
|
+
*/
|
|
62
|
+
export function getBindableAttributes(blockName) {
|
|
63
|
+
return BLOCK_BINDINGS_ALLOWED_BLOCKS[blockName];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Checks if the block has the `__default` binding for pattern overrides.
|
|
68
|
+
*
|
|
69
|
+
* @param {?Record<string, object>} bindings A block's bindings from the metadata attribute.
|
|
70
|
+
*
|
|
71
|
+
* @return {boolean} Whether the block has the `__default` binding for pattern overrides.
|
|
72
|
+
*/
|
|
73
|
+
export function hasPatternOverridesDefaultBinding(bindings) {
|
|
74
|
+
return bindings?.[DEFAULT_ATTRIBUTE]?.source === PATTERN_OVERRIDES_SOURCE;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns the bindings with the `__default` binding for pattern overrides
|
|
79
|
+
* replaced with the full-set of supported attributes. e.g.:
|
|
80
|
+
*
|
|
81
|
+
* - bindings passed in: `{ __default: { source: 'core/pattern-overrides' } }`
|
|
82
|
+
* - bindings returned: `{ content: { source: 'core/pattern-overrides' } }`
|
|
83
|
+
*
|
|
84
|
+
* @param {string} blockName The block name (e.g. 'core/paragraph').
|
|
85
|
+
* @param {?Record<string, object>} bindings A block's bindings from the metadata attribute.
|
|
86
|
+
*
|
|
87
|
+
* @return {Object} The bindings with default replaced for pattern overrides.
|
|
88
|
+
*/
|
|
89
|
+
export function replacePatternOverridesDefaultBinding(blockName, bindings) {
|
|
90
|
+
// The `__default` binding currently only works for pattern overrides.
|
|
91
|
+
if (hasPatternOverridesDefaultBinding(bindings)) {
|
|
92
|
+
const supportedAttributes = BLOCK_BINDINGS_ALLOWED_BLOCKS[blockName];
|
|
93
|
+
const bindingsWithDefaults = {};
|
|
94
|
+
for (const attributeName of supportedAttributes) {
|
|
95
|
+
// If the block has mixed binding sources, retain any non pattern override bindings.
|
|
96
|
+
const bindingSource = bindings[attributeName] ? bindings[attributeName] : {
|
|
97
|
+
source: PATTERN_OVERRIDES_SOURCE
|
|
98
|
+
};
|
|
99
|
+
bindingsWithDefaults[attributeName] = bindingSource;
|
|
100
|
+
}
|
|
101
|
+
return bindingsWithDefaults;
|
|
102
|
+
}
|
|
103
|
+
return bindings;
|
|
104
|
+
}
|
|
105
|
+
|
|
15
106
|
/**
|
|
16
107
|
* Contains utils to update the block `bindings` metadata.
|
|
17
108
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","useRegistry","store","blockEditorStore","useBlockEditContext","isObjectEmpty","object","Object","keys","length","useBlockBindingsUtils","clientId","contextClientId","blockClientId","updateBlockAttributes","getBlockAttributes","select","updateBlockBindings","bindings","metadata","currentBindings","newBindings","entries","forEach","attribute","binding","newMetadata","undefined","removeAllBlockBindings"],"sources":["@wordpress/block-editor/src/utils/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useBlockEditContext } from '../components/block-edit';\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Contains utils to update the block `bindings` metadata.\n *\n * @typedef {Object} WPBlockBindingsUtils\n *\n * @property {Function} updateBlockBindings Updates the value of the bindings connected to block attributes.\n * @property {Function} removeAllBlockBindings Removes the bindings property of the `metadata` attribute.\n */\n\n/**\n * Retrieves the existing utils needed to update the block `bindings` metadata.\n * They can be used to create, modify, or remove connections from the existing block attributes.\n *\n * It contains the following utils:\n * - `updateBlockBindings`: Updates the value of the bindings connected to block attributes. It can be used to remove a specific binding by setting the value to `undefined`.\n * - `removeAllBlockBindings`: Removes the bindings property of the `metadata` attribute.\n *\n * @since 6.7.0 Introduced in WordPress core.\n *\n * @param {?string} clientId Optional block client ID. If not set, it will use the current block client ID from the context.\n *\n * @return {?WPBlockBindingsUtils} Object containing the block bindings utils.\n *\n * @example\n * ```js\n * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n * const { updateBlockBindings, removeAllBlockBindings } = useBlockBindingsUtils();\n *\n * // Update url and alt attributes.\n * updateBlockBindings( {\n * url: {\n * source: 'core/post-meta',\n * args: {\n * key: 'url_custom_field',\n * },\n * },\n * alt: {\n * source: 'core/post-meta',\n * args: {\n * key: 'text_custom_field',\n * },\n * },\n * } );\n *\n * // Remove binding from url attribute.\n * updateBlockBindings( { url: undefined } );\n *\n * // Remove bindings from all attributes.\n * removeAllBlockBindings();\n * ```\n */\nexport function useBlockBindingsUtils( clientId ) {\n\tconst { clientId: contextClientId } = useBlockEditContext();\n\tconst blockClientId = clientId || contextClientId;\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { getBlockAttributes } = useRegistry().select( blockEditorStore );\n\n\t/**\n\t * Updates the value of the bindings connected to block attributes.\n\t * It removes the binding when the new value is `undefined`.\n\t *\n\t * @param {Object} bindings Bindings including the attributes to update and the new object.\n\t * @param {string} bindings.source The source name to connect to.\n\t * @param {Object} [bindings.args] Object containing the arguments needed by the source.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { updateBlockBindings } = useBlockBindingsUtils();\n\t * updateBlockBindings( {\n\t * url: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'url_custom_field',\n\t * },\n\t * \t },\n\t * alt: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'text_custom_field',\n\t * },\n\t * \t }\n\t * } );\n\t * ```\n\t */\n\tconst updateBlockBindings = ( bindings ) => {\n\t\tconst { metadata: { bindings: currentBindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( blockClientId );\n\t\tconst newBindings = { ...currentBindings };\n\n\t\tObject.entries( bindings ).forEach( ( [ attribute, binding ] ) => {\n\t\t\tif ( ! binding && newBindings[ attribute ] ) {\n\t\t\t\tdelete newBindings[ attribute ];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnewBindings[ attribute ] = binding;\n\t\t} );\n\n\t\tconst newMetadata = {\n\t\t\t...metadata,\n\t\t\tbindings: newBindings,\n\t\t};\n\n\t\tif ( isObjectEmpty( newMetadata.bindings ) ) {\n\t\t\tdelete newMetadata.bindings;\n\t\t}\n\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\tmetadata: isObjectEmpty( newMetadata ) ? undefined : newMetadata,\n\t\t} );\n\t};\n\n\t/**\n\t * Removes the bindings property of the `metadata` attribute.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { removeAllBlockBindings } = useBlockBindingsUtils();\n\t * removeAllBlockBindings();\n\t * ```\n\t */\n\tconst removeAllBlockBindings = () => {\n\t\tconst { metadata: { bindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( blockClientId );\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\tmetadata: isObjectEmpty( metadata ) ? undefined : metadata,\n\t\t} );\n\t};\n\n\treturn { updateBlockBindings, removeAllBlockBindings };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;;AAE1D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,SAASC,aAAaA,CAAEC,MAAM,EAAG;EAChC,OAAO,CAAEA,MAAM,IAAIC,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,KAAK,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,q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AAY,CAAC,GAAGC,SAAS,GAAGD;IACtD,CAAE,CAAC;EACJ,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAME,sBAAsB,GAAGA,CAAA,KAAM;IACpC,MAAM;MAAET,QAAQ,EAAE;QAAED,QAAQ;QAAE,GAAGC;MAAS,CAAC,GAAG,CAAC;IAAE,CAAC,GACjDJ,kBAAkB,CAAEF,aAAc,CAAC;IACpCC,qBAAqB,CAAED,aAAa,EAAE;MACrCM,QAAQ,EAAEd,aAAa,CAAEc,QAAS,CAAC,GAAGQ,SAAS,GAAGR;IACnD,CAAE,CAAC;EACJ,CAAC;EAED,OAAO;IAAEF,mBAAmB;IAAEW;EAAuB,CAAC;AACvD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useDispatch","useRegistry","store","blockEditorStore","useBlockEditContext","DEFAULT_ATTRIBUTE","PATTERN_OVERRIDES_SOURCE","BLOCK_BINDINGS_ALLOWED_BLOCKS","isObjectEmpty","object","Object","keys","length","canBindBlock","blockName","canBindAttribute","attributeName","includes","getBindableAttributes","hasPatternOverridesDefaultBinding","bindings","source","replacePatternOverridesDefaultBinding","supportedAttributes","bindingsWithDefaults","bindingSource","useBlockBindingsUtils","clientId","contextClientId","blockClientId","updateBlockAttributes","getBlockAttributes","select","updateBlockBindings","metadata","currentBindings","newBindings","entries","forEach","attribute","binding","newMetadata","undefined","removeAllBlockBindings"],"sources":["@wordpress/block-editor/src/utils/block-bindings.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useRegistry } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { useBlockEditContext } from '../components/block-edit';\n\nconst DEFAULT_ATTRIBUTE = '__default';\nconst PATTERN_OVERRIDES_SOURCE = 'core/pattern-overrides';\nconst BLOCK_BINDINGS_ALLOWED_BLOCKS = {\n\t'core/paragraph': [ 'content' ],\n\t'core/heading': [ 'content' ],\n\t'core/image': [ 'id', 'url', 'title', 'alt' ],\n\t'core/button': [ 'url', 'text', 'linkTarget', 'rel' ],\n};\n\n/**\n * Checks if the given object is empty.\n *\n * @param {?Object} object The object to check.\n *\n * @return {boolean} Whether the object is empty.\n */\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\n/**\n * Based on the given block name, checks if it is possible to bind the block.\n *\n * @param {string} blockName The name of the block.\n *\n * @return {boolean} Whether it is possible to bind the block to sources.\n */\nexport function canBindBlock( blockName ) {\n\treturn blockName in BLOCK_BINDINGS_ALLOWED_BLOCKS;\n}\n\n/**\n * Based on the given block name and attribute name, checks if it is possible to bind the block attribute.\n *\n * @param {string} blockName The name of the block.\n * @param {string} attributeName The name of attribute.\n *\n * @return {boolean} Whether it is possible to bind the block attribute.\n */\nexport function canBindAttribute( blockName, attributeName ) {\n\treturn (\n\t\tcanBindBlock( blockName ) &&\n\t\tBLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ].includes( attributeName )\n\t);\n}\n\n/**\n * Gets the bindable attributes for a given block.\n *\n * @param {string} blockName The name of the block.\n *\n * @return {string[]} The bindable attributes for the block.\n */\nexport function getBindableAttributes( blockName ) {\n\treturn BLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ];\n}\n\n/**\n * Checks if the block has the `__default` binding for pattern overrides.\n *\n * @param {?Record<string, object>} bindings A block's bindings from the metadata attribute.\n *\n * @return {boolean} Whether the block has the `__default` binding for pattern overrides.\n */\nexport function hasPatternOverridesDefaultBinding( bindings ) {\n\treturn bindings?.[ DEFAULT_ATTRIBUTE ]?.source === PATTERN_OVERRIDES_SOURCE;\n}\n\n/**\n * Returns the bindings with the `__default` binding for pattern overrides\n * replaced with the full-set of supported attributes. e.g.:\n *\n * - bindings passed in: `{ __default: { source: 'core/pattern-overrides' } }`\n * - bindings returned: `{ content: { source: 'core/pattern-overrides' } }`\n *\n * @param {string} blockName The block name (e.g. 'core/paragraph').\n * @param {?Record<string, object>} bindings A block's bindings from the metadata attribute.\n *\n * @return {Object} The bindings with default replaced for pattern overrides.\n */\nexport function replacePatternOverridesDefaultBinding( blockName, bindings ) {\n\t// The `__default` binding currently only works for pattern overrides.\n\tif ( hasPatternOverridesDefaultBinding( bindings ) ) {\n\t\tconst supportedAttributes = BLOCK_BINDINGS_ALLOWED_BLOCKS[ blockName ];\n\t\tconst bindingsWithDefaults = {};\n\t\tfor ( const attributeName of supportedAttributes ) {\n\t\t\t// If the block has mixed binding sources, retain any non pattern override bindings.\n\t\t\tconst bindingSource = bindings[ attributeName ]\n\t\t\t\t? bindings[ attributeName ]\n\t\t\t\t: { source: PATTERN_OVERRIDES_SOURCE };\n\t\t\tbindingsWithDefaults[ attributeName ] = bindingSource;\n\t\t}\n\n\t\treturn bindingsWithDefaults;\n\t}\n\n\treturn bindings;\n}\n\n/**\n * Contains utils to update the block `bindings` metadata.\n *\n * @typedef {Object} WPBlockBindingsUtils\n *\n * @property {Function} updateBlockBindings Updates the value of the bindings connected to block attributes.\n * @property {Function} removeAllBlockBindings Removes the bindings property of the `metadata` attribute.\n */\n\n/**\n * Retrieves the existing utils needed to update the block `bindings` metadata.\n * They can be used to create, modify, or remove connections from the existing block attributes.\n *\n * It contains the following utils:\n * - `updateBlockBindings`: Updates the value of the bindings connected to block attributes. It can be used to remove a specific binding by setting the value to `undefined`.\n * - `removeAllBlockBindings`: Removes the bindings property of the `metadata` attribute.\n *\n * @since 6.7.0 Introduced in WordPress core.\n *\n * @param {?string} clientId Optional block client ID. If not set, it will use the current block client ID from the context.\n *\n * @return {?WPBlockBindingsUtils} Object containing the block bindings utils.\n *\n * @example\n * ```js\n * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n * const { updateBlockBindings, removeAllBlockBindings } = useBlockBindingsUtils();\n *\n * // Update url and alt attributes.\n * updateBlockBindings( {\n * url: {\n * source: 'core/post-meta',\n * args: {\n * key: 'url_custom_field',\n * },\n * },\n * alt: {\n * source: 'core/post-meta',\n * args: {\n * key: 'text_custom_field',\n * },\n * },\n * } );\n *\n * // Remove binding from url attribute.\n * updateBlockBindings( { url: undefined } );\n *\n * // Remove bindings from all attributes.\n * removeAllBlockBindings();\n * ```\n */\nexport function useBlockBindingsUtils( clientId ) {\n\tconst { clientId: contextClientId } = useBlockEditContext();\n\tconst blockClientId = clientId || contextClientId;\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { getBlockAttributes } = useRegistry().select( blockEditorStore );\n\n\t/**\n\t * Updates the value of the bindings connected to block attributes.\n\t * It removes the binding when the new value is `undefined`.\n\t *\n\t * @param {Object} bindings Bindings including the attributes to update and the new object.\n\t * @param {string} bindings.source The source name to connect to.\n\t * @param {Object} [bindings.args] Object containing the arguments needed by the source.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { updateBlockBindings } = useBlockBindingsUtils();\n\t * updateBlockBindings( {\n\t * url: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'url_custom_field',\n\t * },\n\t * \t },\n\t * alt: {\n\t * source: 'core/post-meta',\n\t * args: {\n\t * key: 'text_custom_field',\n\t * },\n\t * \t }\n\t * } );\n\t * ```\n\t */\n\tconst updateBlockBindings = ( bindings ) => {\n\t\tconst { metadata: { bindings: currentBindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( blockClientId );\n\t\tconst newBindings = { ...currentBindings };\n\n\t\tObject.entries( bindings ).forEach( ( [ attribute, binding ] ) => {\n\t\t\tif ( ! binding && newBindings[ attribute ] ) {\n\t\t\t\tdelete newBindings[ attribute ];\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tnewBindings[ attribute ] = binding;\n\t\t} );\n\n\t\tconst newMetadata = {\n\t\t\t...metadata,\n\t\t\tbindings: newBindings,\n\t\t};\n\n\t\tif ( isObjectEmpty( newMetadata.bindings ) ) {\n\t\t\tdelete newMetadata.bindings;\n\t\t}\n\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\tmetadata: isObjectEmpty( newMetadata ) ? undefined : newMetadata,\n\t\t} );\n\t};\n\n\t/**\n\t * Removes the bindings property of the `metadata` attribute.\n\t *\n\t * @example\n\t * ```js\n\t * import { useBlockBindingsUtils } from '@wordpress/block-editor'\n\t *\n\t * const { removeAllBlockBindings } = useBlockBindingsUtils();\n\t * removeAllBlockBindings();\n\t * ```\n\t */\n\tconst removeAllBlockBindings = () => {\n\t\tconst { metadata: { bindings, ...metadata } = {} } =\n\t\t\tgetBlockAttributes( blockClientId );\n\t\tupdateBlockAttributes( blockClientId, {\n\t\t\tmetadata: isObjectEmpty( metadata ) ? undefined : metadata,\n\t\t} );\n\t};\n\n\treturn { updateBlockBindings, removeAllBlockBindings };\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;;AAE1D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,UAAU;AACpD,SAASC,mBAAmB,QAAQ,0BAA0B;AAE9D,MAAMC,iBAAiB,GAAG,WAAW;AACrC,MAAMC,wBAAwB,GAAG,wBAAwB;AACzD,MAAMC,6BAA6B,GAAG;EACrC,gBAAgB,EAAE,CAAE,SAAS,CAAE;EAC/B,cAAc,EAAE,CAAE,SAAS,CAAE;EAC7B,YAAY,EAAE,CAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,CAAE;EAC7C,aAAa,EAAE,CAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAaA,CAAEC,MAAM,EAAG;EAChC,OAAO,CAAEA,MAAM,IAAIC,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,KAAK,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAAEC,SAAS,EAAG;EACzC,OAAOA,SAAS,IAAIP,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AS,CAAC,EAAG;MAC5C,OAAOqB,WAAW,CAACrB,QAAQ;IAC5B;IAEAU,qBAAqB,CAAED,aAAa,EAAE;MACrCK,QAAQ,EAAE1B,aAAa,CAAEiC,WAAY,CAAC,GAAGC,SAAS,GAAGD;IACtD,CAAE,CAAC;EACJ,CAAC;;EAED;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACC,MAAME,sBAAsB,GAAGA,CAAA,KAAM;IACpC,MAAM;MAAET,QAAQ,EAAE;QAAEd,QAAQ;QAAE,GAAGc;MAAS,CAAC,GAAG,CAAC;IAAE,CAAC,GACjDH,kBAAkB,CAAEF,aAAc,CAAC;IACpCC,qBAAqB,CAAED,aAAa,EAAE;MACrCK,QAAQ,EAAE1B,aAAa,CAAE0B,QAAS,CAAC,GAAGQ,SAAS,GAAGR;IACnD,CAAE,CAAC;EACJ,CAAC;EAED,OAAO;IAAED,mBAAmB;IAAEU;EAAuB,CAAC;AACvD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getEditorRegion","editor","_Array$from$find","_editorCanvas$closest","editorCanvas","Array","from","document","querySelectorAll","values","find","iframe","iframeDocument","contentDocument","contentWindow","ownerDocument","closest"],"sources":["@wordpress/block-editor/src/utils/get-editor-region.js"],"sourcesContent":["/**\n * Gets the editor region for a given editor canvas element or\n * returns the passed element if no region is found\n *\n * @param { Object } editor The editor canvas element.\n * @return { Object } The editor region or given editor element\n */\nexport default function getEditorRegion( editor ) {\n\tif ( ! editor ) {\n\t\treturn null;\n\t}\n\n\t// If there are multiple editors, we need to find the iframe that contains our contentRef to make sure\n\t// we're focusing the region that contains this editor.\n\tconst editorCanvas =\n\t\tArray.from(\n\t\t\tdocument.querySelectorAll( 'iframe[name=\"editor-canvas\"]' ).values()\n\t\t).find( ( iframe ) => {\n\t\t\t// Find the iframe that contains our contentRef\n\t\t\tconst iframeDocument =\n\t\t\t\tiframe.contentDocument || iframe.contentWindow.document;\n\n\t\t\treturn iframeDocument === editor.ownerDocument;\n\t\t} ) ?? editor;\n\n\t// The region is provided by the editor, not the block-editor.\n\t// We should send focus to the region if one is available to reuse the\n\t// same interface for navigating landmarks. If no region is available,\n\t// use the canvas instead.\n\treturn editorCanvas?.closest( '[role=\"region\"]' ) ?? editorCanvas;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,eAAeA,CAAEC,MAAM,EAAG;EAAA,IAAAC,gBAAA,EAAAC,qBAAA;EACjD,IAAK,CAAEF,MAAM,EAAG;IACf,OAAO,IAAI;EACZ;;EAEA;EACA;EACA,MAAMG,YAAY,IAAAF,gBAAA,GACjBG,KAAK,CAACC,IAAI,CACTC,QAAQ,CAACC,gBAAgB,CAAE,8BAA+B,CAAC,CAACC,MAAM,CAAC,CACpE,CAAC,CAACC,IAAI,CAAIC,MAAM,IAAM;IACrB;IACA,MAAMC,cAAc,GACnBD,MAAM,CAACE,eAAe,IAAIF,MAAM,CAACG,aAAa,CAACP,QAAQ;IAExD,OAAOK,cAAc,KAAKX,MAAM,CAACc,aAAa;EAC/C,CAAE,CAAC,cAAAb,gBAAA,cAAAA,gBAAA,GAAID,MAAM;;EAEd;EACA;EACA;EACA;EACA,QAAAE,qBAAA,GAAOC,YAAY,EAAEY,OAAO,CAAE,iBAAkB,CAAC,cAAAb,qBAAA,cAAAA,qBAAA,GAAIC,YAAY;AAClE","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["getEditorRegion","editor","_Array$from$find","_editorCanvas$closest","editorCanvas","Array","from","document","querySelectorAll","values","find","iframe","iframeDocument","contentDocument","contentWindow","ownerDocument","closest"],"sources":["@wordpress/block-editor/src/utils/get-editor-region.js"],"sourcesContent":["/**\n * Gets the editor region for a given editor canvas element or\n * returns the passed element if no region is found\n *\n * @param { Object } editor The editor canvas element.\n * @return { Object } The editor region or given editor element\n */\nexport default function getEditorRegion( editor ) {\n\tif ( ! editor ) {\n\t\treturn null;\n\t}\n\n\t// If there are multiple editors, we need to find the iframe that contains our contentRef to make sure\n\t// we're focusing the region that contains this editor.\n\tconst editorCanvas =\n\t\tArray.from(\n\t\t\tdocument.querySelectorAll( 'iframe[name=\"editor-canvas\"]' ).values()\n\t\t).find( ( iframe ) => {\n\t\t\t// Find the iframe that contains our contentRef\n\t\t\tconst iframeDocument =\n\t\t\t\tiframe.contentDocument || iframe.contentWindow.document;\n\n\t\t\treturn iframeDocument === editor.ownerDocument;\n\t\t} ) ?? editor;\n\n\t// The region is provided by the editor, not the block-editor.\n\t// We should send focus to the region if one is available to reuse the\n\t// same interface for navigating landmarks. If no region is available,\n\t// use the canvas instead.\n\treturn editorCanvas?.closest( '[role=\"region\"]' ) ?? editorCanvas;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASA,eAAeA,CAAEC,MAAM,EAAG;EAAA,IAAAC,gBAAA,EAAAC,qBAAA;EACjD,IAAK,CAAEF,MAAM,EAAG;IACf,OAAO,IAAI;EACZ;;EAEA;EACA;EACA,MAAMG,YAAY,IAAAF,gBAAA,GACjBG,KAAK,CAACC,IAAI,CACTC,QAAQ,CAACC,gBAAgB,CAAE,8BAA+B,CAAC,CAACC,MAAM,CAAC,CACpE,CAAC,CAACC,IAAI,CAAIC,MAAM,IAAM;IACrB;IACA,MAAMC,cAAc,GACnBD,MAAM,CAACE,eAAe,IAAIF,MAAM,CAACG,aAAa,CAACP,QAAQ;IAExD,OAAOK,cAAc,KAAKX,MAAM,CAACc,aAAa;EAC/C,CAAE,CAAC,cAAAb,gBAAA,cAAAA,gBAAA,GAAID,MAAM;;EAEd;EACA;EACA;EACA;EACA,QAAAE,qBAAA,GAAOC,YAAY,EAAEY,OAAO,CAAE,iBAAkB,CAAC,cAAAb,qBAAA,cAAAA,qBAAA,GAAIC,YAAY;AAClE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_x","sprintf","formatFontStyle","formatFontWeight","FONT_STYLES","name","value","FONT_WEIGHTS","getFontStylesAndWeights","fontFamilyFaces","fontStyles","fontWeights","combinedStyleAndWeightOptions","isSystemFont","length","isVariableFont","forEach","face","fontWeight","test","trim","startValue","endValue","split","parseInt","slice","i","fontWeightValue","toString","some","weight","push","fontStyle","Object","keys","style","styleName","styleValue","weightName","weightValue","optionName","key"],"sources":["@wordpress/block-editor/src/utils/get-font-styles-and-weights.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { formatFontStyle } from './format-font-style';\nimport { formatFontWeight } from './format-font-weight';\n\nconst FONT_STYLES = [\n\t{\n\t\tname: _x( 'Regular', 'font style' ),\n\t\tvalue: 'normal',\n\t},\n\t{\n\t\tname: _x( 'Italic', 'font style' ),\n\t\tvalue: 'italic',\n\t},\n];\n\nconst FONT_WEIGHTS = [\n\t{\n\t\tname: _x( 'Thin', 'font weight' ),\n\t\tvalue: '100',\n\t},\n\t{\n\t\tname: _x( 'Extra Light', 'font weight' ),\n\t\tvalue: '200',\n\t},\n\t{\n\t\tname: _x( 'Light', 'font weight' ),\n\t\tvalue: '300',\n\t},\n\t{\n\t\tname: _x( 'Regular', 'font weight' ),\n\t\tvalue: '400',\n\t},\n\t{\n\t\tname: _x( 'Medium', 'font weight' ),\n\t\tvalue: '500',\n\t},\n\t{\n\t\tname: _x( 'Semi Bold', 'font weight' ),\n\t\tvalue: '600',\n\t},\n\t{\n\t\tname: _x( 'Bold', 'font weight' ),\n\t\tvalue: '700',\n\t},\n\t{\n\t\tname: _x( 'Extra Bold', 'font weight' ),\n\t\tvalue: '800',\n\t},\n\t{\n\t\tname: _x( 'Black', 'font weight' ),\n\t\tvalue: '900',\n\t},\n\t{\n\t\tname: _x( 'Extra Black', 'font weight' ),\n\t\tvalue: '1000',\n\t},\n];\n\n/**\n * Builds a list of font style and weight options based on font family faces.\n * Defaults to the standard font styles and weights if no font family faces are provided.\n *\n * @param {Array} fontFamilyFaces font family faces array\n * @return {Object} new object with combined and separated font style and weight properties\n */\nexport function getFontStylesAndWeights( fontFamilyFaces ) {\n\tlet fontStyles = [];\n\tlet fontWeights = [];\n\tconst combinedStyleAndWeightOptions = [];\n\tconst isSystemFont = ! fontFamilyFaces || fontFamilyFaces?.length === 0;\n\tlet isVariableFont = false;\n\n\tfontFamilyFaces?.forEach( ( face ) => {\n\t\t// Check for variable font by looking for a space in the font weight value. e.g. \"100 900\"\n\t\tif (\n\t\t\t'string' === typeof face.fontWeight &&\n\t\t\t/\\s/.test( face.fontWeight.trim() )\n\t\t) {\n\t\t\tisVariableFont = true;\n\n\t\t\t// Find font weight start and end values.\n\t\t\tlet [ startValue, endValue ] = face.fontWeight.split( ' ' );\n\t\t\tstartValue = parseInt( startValue.slice( 0, 1 ) );\n\t\t\tif ( endValue === '1000' ) {\n\t\t\t\tendValue = 10;\n\t\t\t} else {\n\t\t\t\tendValue = parseInt( endValue.slice( 0, 1 ) );\n\t\t\t}\n\n\t\t\t// Create font weight options for available variable weights.\n\t\t\tfor ( let i = startValue; i <= endValue; i++ ) {\n\t\t\t\tconst fontWeightValue = `${ i.toString() }00`;\n\t\t\t\tif (\n\t\t\t\t\t! fontWeights.some(\n\t\t\t\t\t\t( weight ) => weight.value === fontWeightValue\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tfontWeights.push( formatFontWeight( fontWeightValue ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Format font style and weight values.\n\t\tconst fontWeight = formatFontWeight(\n\t\t\t'number' === typeof face.fontWeight\n\t\t\t\t? face.fontWeight.toString()\n\t\t\t\t: face.fontWeight\n\t\t);\n\t\tconst fontStyle = formatFontStyle( face.fontStyle );\n\n\t\t// Create font style and font weight lists without duplicates.\n\t\tif ( fontStyle && Object.keys( fontStyle ).length ) {\n\t\t\tif (\n\t\t\t\t! fontStyles.some(\n\t\t\t\t\t( style ) => style.value === fontStyle.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfontStyles.push( fontStyle );\n\t\t\t}\n\t\t}\n\n\t\tif ( fontWeight && Object.keys( fontWeight ).length ) {\n\t\t\tif (\n\t\t\t\t! fontWeights.some(\n\t\t\t\t\t( weight ) => weight.value === fontWeight.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif ( ! isVariableFont ) {\n\t\t\t\t\tfontWeights.push( fontWeight );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} );\n\n\t// If there is no font weight of 600 or above, then include faux bold as an option.\n\tif ( ! fontWeights.some( ( weight ) => weight.value >= '600' ) ) {\n\t\tfontWeights.push( {\n\t\t\tname: _x( 'Bold', 'font weight' ),\n\t\t\tvalue: '700',\n\t\t} );\n\t}\n\n\t// If there is no italic font style, then include faux italic as an option.\n\tif ( ! fontStyles.some( ( style ) => style.value === 'italic' ) ) {\n\t\tfontStyles.push( {\n\t\t\tname: _x( 'Italic', 'font style' ),\n\t\t\tvalue: 'italic',\n\t\t} );\n\t}\n\n\t// Use default font styles and weights for system fonts.\n\tif ( isSystemFont ) {\n\t\tfontStyles = FONT_STYLES;\n\t\tfontWeights = FONT_WEIGHTS;\n\t}\n\n\t// Use default styles and weights if there are no available styles or weights from the provided font faces.\n\tfontStyles = fontStyles.length === 0 ? FONT_STYLES : fontStyles;\n\tfontWeights = fontWeights.length === 0 ? FONT_WEIGHTS : fontWeights;\n\n\t// Generate combined font style and weight options for available fonts.\n\tfontStyles.forEach( ( { name: styleName, value: styleValue } ) => {\n\t\tfontWeights.forEach( ( { name: weightName, value: weightValue } ) => {\n\t\t\tconst optionName =\n\t\t\t\tstyleValue === 'normal'\n\t\t\t\t\t? weightName\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: 1: Font weight name. 2: Font style name. */\n\t\t\t\t\t\t\t_x( '%1$s %2$s', 'font' ),\n\t\t\t\t\t\t\tweightName,\n\t\t\t\t\t\t\tstyleName\n\t\t\t\t\t );\n\n\t\t\tcombinedStyleAndWeightOptions.push( {\n\t\t\t\tkey: `${ styleValue }-${ weightValue }`,\n\t\t\t\tname: optionName,\n\t\t\t\tstyle: {\n\t\t\t\t\tfontStyle: styleValue,\n\t\t\t\t\tfontWeight: weightValue,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t} );\n\n\treturn {\n\t\tfontStyles,\n\t\tfontWeights,\n\t\tcombinedStyleAndWeightOptions,\n\t\tisSystemFont,\n\t\tisVariableFont,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,sBAAsB;AAEvD,MAAMC,WAAW,GAAG,CACnB;EACCC,IAAI,EAAEL,EAAE,CAAE,SAAS,EAAE,YAAa,CAAC;EACnCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,QAAQ,EAAE,YAAa,CAAC;EAClCM,KAAK,EAAE;AACR,CAAC,CACD;AAED,MAAMC,YAAY,GAAG,CACpB;EACCF,IAAI,EAAEL,EAAE,CAAE,MAAM,EAAE,aAAc,CAAC;EACjCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,aAAa,EAAE,aAAc,CAAC;EACxCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,OAAO,EAAE,aAAc,CAAC;EAClCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,SAAS,EAAE,aAAc,CAAC;EACpCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,QAAQ,EAAE,aAAc,CAAC;EACnCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,WAAW,EAAE,aAAc,CAAC;EACtCM,KAAK,EAAE;AACR,CA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QACb;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAO;IACN7B,UAAU;IACVC,WAAW;IACXC,6BAA6B;IAC7BC,YAAY;IACZE;EACD,CAAC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_x","sprintf","formatFontStyle","formatFontWeight","FONT_STYLES","name","value","FONT_WEIGHTS","getFontStylesAndWeights","fontFamilyFaces","fontStyles","fontWeights","combinedStyleAndWeightOptions","isSystemFont","length","isVariableFont","forEach","face","fontWeight","test","trim","startValue","endValue","split","parseInt","slice","i","fontWeightValue","toString","some","weight","push","fontStyle","Object","keys","style","styleName","styleValue","weightName","weightValue","optionName","key"],"sources":["@wordpress/block-editor/src/utils/get-font-styles-and-weights.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { formatFontStyle } from './format-font-style';\nimport { formatFontWeight } from './format-font-weight';\n\nconst FONT_STYLES = [\n\t{\n\t\tname: _x( 'Regular', 'font style' ),\n\t\tvalue: 'normal',\n\t},\n\t{\n\t\tname: _x( 'Italic', 'font style' ),\n\t\tvalue: 'italic',\n\t},\n];\n\nconst FONT_WEIGHTS = [\n\t{\n\t\tname: _x( 'Thin', 'font weight' ),\n\t\tvalue: '100',\n\t},\n\t{\n\t\tname: _x( 'Extra Light', 'font weight' ),\n\t\tvalue: '200',\n\t},\n\t{\n\t\tname: _x( 'Light', 'font weight' ),\n\t\tvalue: '300',\n\t},\n\t{\n\t\tname: _x( 'Regular', 'font weight' ),\n\t\tvalue: '400',\n\t},\n\t{\n\t\tname: _x( 'Medium', 'font weight' ),\n\t\tvalue: '500',\n\t},\n\t{\n\t\tname: _x( 'Semi Bold', 'font weight' ),\n\t\tvalue: '600',\n\t},\n\t{\n\t\tname: _x( 'Bold', 'font weight' ),\n\t\tvalue: '700',\n\t},\n\t{\n\t\tname: _x( 'Extra Bold', 'font weight' ),\n\t\tvalue: '800',\n\t},\n\t{\n\t\tname: _x( 'Black', 'font weight' ),\n\t\tvalue: '900',\n\t},\n\t{\n\t\tname: _x( 'Extra Black', 'font weight' ),\n\t\tvalue: '1000',\n\t},\n];\n\n/**\n * Builds a list of font style and weight options based on font family faces.\n * Defaults to the standard font styles and weights if no font family faces are provided.\n *\n * @param {Array} fontFamilyFaces font family faces array\n * @return {Object} new object with combined and separated font style and weight properties\n */\nexport function getFontStylesAndWeights( fontFamilyFaces ) {\n\tlet fontStyles = [];\n\tlet fontWeights = [];\n\tconst combinedStyleAndWeightOptions = [];\n\tconst isSystemFont = ! fontFamilyFaces || fontFamilyFaces?.length === 0;\n\tlet isVariableFont = false;\n\n\tfontFamilyFaces?.forEach( ( face ) => {\n\t\t// Check for variable font by looking for a space in the font weight value. e.g. \"100 900\"\n\t\tif (\n\t\t\t'string' === typeof face.fontWeight &&\n\t\t\t/\\s/.test( face.fontWeight.trim() )\n\t\t) {\n\t\t\tisVariableFont = true;\n\n\t\t\t// Find font weight start and end values.\n\t\t\tlet [ startValue, endValue ] = face.fontWeight.split( ' ' );\n\t\t\tstartValue = parseInt( startValue.slice( 0, 1 ) );\n\t\t\tif ( endValue === '1000' ) {\n\t\t\t\tendValue = 10;\n\t\t\t} else {\n\t\t\t\tendValue = parseInt( endValue.slice( 0, 1 ) );\n\t\t\t}\n\n\t\t\t// Create font weight options for available variable weights.\n\t\t\tfor ( let i = startValue; i <= endValue; i++ ) {\n\t\t\t\tconst fontWeightValue = `${ i.toString() }00`;\n\t\t\t\tif (\n\t\t\t\t\t! fontWeights.some(\n\t\t\t\t\t\t( weight ) => weight.value === fontWeightValue\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tfontWeights.push( formatFontWeight( fontWeightValue ) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Format font style and weight values.\n\t\tconst fontWeight = formatFontWeight(\n\t\t\t'number' === typeof face.fontWeight\n\t\t\t\t? face.fontWeight.toString()\n\t\t\t\t: face.fontWeight\n\t\t);\n\t\tconst fontStyle = formatFontStyle( face.fontStyle );\n\n\t\t// Create font style and font weight lists without duplicates.\n\t\tif ( fontStyle && Object.keys( fontStyle ).length ) {\n\t\t\tif (\n\t\t\t\t! fontStyles.some(\n\t\t\t\t\t( style ) => style.value === fontStyle.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tfontStyles.push( fontStyle );\n\t\t\t}\n\t\t}\n\n\t\tif ( fontWeight && Object.keys( fontWeight ).length ) {\n\t\t\tif (\n\t\t\t\t! fontWeights.some(\n\t\t\t\t\t( weight ) => weight.value === fontWeight.value\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif ( ! isVariableFont ) {\n\t\t\t\t\tfontWeights.push( fontWeight );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} );\n\n\t// If there is no font weight of 600 or above, then include faux bold as an option.\n\tif ( ! fontWeights.some( ( weight ) => weight.value >= '600' ) ) {\n\t\tfontWeights.push( {\n\t\t\tname: _x( 'Bold', 'font weight' ),\n\t\t\tvalue: '700',\n\t\t} );\n\t}\n\n\t// If there is no italic font style, then include faux italic as an option.\n\tif ( ! fontStyles.some( ( style ) => style.value === 'italic' ) ) {\n\t\tfontStyles.push( {\n\t\t\tname: _x( 'Italic', 'font style' ),\n\t\t\tvalue: 'italic',\n\t\t} );\n\t}\n\n\t// Use default font styles and weights for system fonts.\n\tif ( isSystemFont ) {\n\t\tfontStyles = FONT_STYLES;\n\t\tfontWeights = FONT_WEIGHTS;\n\t}\n\n\t// Use default styles and weights if there are no available styles or weights from the provided font faces.\n\tfontStyles = fontStyles.length === 0 ? FONT_STYLES : fontStyles;\n\tfontWeights = fontWeights.length === 0 ? FONT_WEIGHTS : fontWeights;\n\n\t// Generate combined font style and weight options for available fonts.\n\tfontStyles.forEach( ( { name: styleName, value: styleValue } ) => {\n\t\tfontWeights.forEach( ( { name: weightName, value: weightValue } ) => {\n\t\t\tconst optionName =\n\t\t\t\tstyleValue === 'normal'\n\t\t\t\t\t? weightName\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: 1: Font weight name. 2: Font style name. */\n\t\t\t\t\t\t\t_x( '%1$s %2$s', 'font' ),\n\t\t\t\t\t\t\tweightName,\n\t\t\t\t\t\t\tstyleName\n\t\t\t\t\t );\n\n\t\t\tcombinedStyleAndWeightOptions.push( {\n\t\t\t\tkey: `${ styleValue }-${ weightValue }`,\n\t\t\t\tname: optionName,\n\t\t\t\tstyle: {\n\t\t\t\t\tfontStyle: styleValue,\n\t\t\t\t\tfontWeight: weightValue,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\t} );\n\n\treturn {\n\t\tfontStyles,\n\t\tfontWeights,\n\t\tcombinedStyleAndWeightOptions,\n\t\tisSystemFont,\n\t\tisVariableFont,\n\t};\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,gBAAgB,QAAQ,sBAAsB;AAEvD,MAAMC,WAAW,GAAG,CACnB;EACCC,IAAI,EAAEL,EAAE,CAAE,SAAS,EAAE,YAAa,CAAC;EACnCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,QAAQ,EAAE,YAAa,CAAC;EAClCM,KAAK,EAAE;AACR,CAAC,CACD;AAED,MAAMC,YAAY,GAAG,CACpB;EACCF,IAAI,EAAEL,EAAE,CAAE,MAAM,EAAE,aAAc,CAAC;EACjCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,aAAa,EAAE,aAAc,CAAC;EACxCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,OAAO,EAAE,aAAc,CAAC;EAClCM,KAAK,EAAE;AACR,CAAC,EACD;EACCD,IAAI,EAAEL,EAAE,CAAE,SAAS,EAAE,aAAc,C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EACzBsC,UAAU,EACVF,SACA,CAAC;MAELxB,6BAA6B,CAACmB,IAAI,CAAE;QACnCU,GAAG,EAAE,GAAIJ,UAAU,IAAME,WAAW,EAAG;QACvClC,IAAI,EAAEmC,UAAU;QAChBL,KAAK,EAAE;UACNH,SAAS,EAAEK,UAAU;UACrBnB,UAAU,EAAEqB;QACb;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OAAO;IACN7B,UAAU;IACVC,WAAW;IACXC,6BAA6B;IAC7BC,YAAY;IACZE;EACD,CAAC;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDistanceFromPointToEdge","point","rect","edge","isHorizontal","x","y","pointLateralPosition","pointForwardPosition","edgeStart","left","top","edgeEnd","right","bottom","edgeForwardPosition","edgeLateralPosition","Math","sqrt","getDistanceToNearestEdge","allowedEdges","candidateDistance","candidateEdge","forEach","distance","undefined","isPointContainedByRect","isPointWithinTopAndBottomBoundariesOfRect"],"sources":["@wordpress/block-editor/src/utils/math.js"],"sourcesContent":["/**\n * A string representing the name of an edge.\n *\n * @typedef {'top'|'right'|'bottom'|'left'} WPEdgeName\n */\n\n/**\n * @typedef {Object} WPPoint\n * @property {number} x The horizontal position.\n * @property {number} y The vertical position.\n */\n\n/**\n * Given a point, a DOMRect and the name of an edge, returns the distance to\n * that edge of the rect.\n *\n * This function works for edges that are horizontal or vertical (e.g. not\n * rotated), the following terms are used so that the function works in both\n * orientations:\n *\n * - Forward, meaning the axis running horizontally when an edge is vertical\n * and vertically when an edge is horizontal.\n * - Lateral, meaning the axis running vertically when an edge is vertical\n * and horizontally when an edge is horizontal.\n *\n * @param {WPPoint} point The point to measure distance from.\n * @param {DOMRect} rect A DOM Rect containing edge positions.\n * @param {WPEdgeName} edge The edge to measure to.\n */\nexport function getDistanceFromPointToEdge( point, rect, edge ) {\n\tconst isHorizontal = edge === 'top' || edge === 'bottom';\n\tconst { x, y } = point;\n\tconst pointLateralPosition = isHorizontal ? x : y;\n\tconst pointForwardPosition = isHorizontal ? y : x;\n\tconst edgeStart = isHorizontal ? rect.left : rect.top;\n\tconst edgeEnd = isHorizontal ? rect.right : rect.bottom;\n\tconst edgeForwardPosition = rect[ edge ];\n\n\t// Measure the straight line distance to the edge of the rect, when the\n\t// point is adjacent to the edge.\n\t// Else, if the point is positioned diagonally to the edge of the rect,\n\t// measure diagonally to the nearest corner that the edge meets.\n\tlet edgeLateralPosition;\n\tif (\n\t\tpointLateralPosition >= edgeStart &&\n\t\tpointLateralPosition <= edgeEnd\n\t) {\n\t\tedgeLateralPosition = pointLateralPosition;\n\t} else if ( pointLateralPosition < edgeEnd ) {\n\t\tedgeLateralPosition = edgeStart;\n\t} else {\n\t\tedgeLateralPosition = edgeEnd;\n\t}\n\n\treturn Math.sqrt(\n\t\t( pointLateralPosition - edgeLateralPosition ) ** 2 +\n\t\t\t( pointForwardPosition - edgeForwardPosition ) ** 2\n\t);\n}\n\n/**\n * Given a point, a DOMRect and a list of allowed edges returns the name of and\n * distance to the nearest edge.\n *\n * @param {WPPoint} point The point to measure distance from.\n * @param {DOMRect} rect A DOM Rect containing edge positions.\n * @param {WPEdgeName[]} allowedEdges A list of the edges included in the\n * calculation. Defaults to all edges.\n *\n * @return {[number, string]} An array where the first value is the distance\n * and a second is the edge name.\n */\nexport function getDistanceToNearestEdge(\n\tpoint,\n\trect,\n\tallowedEdges = [ 'top', 'bottom', 'left', 'right' ]\n) {\n\tlet candidateDistance;\n\tlet candidateEdge;\n\n\tallowedEdges.forEach( ( edge ) => {\n\t\tconst distance = getDistanceFromPointToEdge( point, rect, edge );\n\n\t\tif ( candidateDistance === undefined || distance < candidateDistance ) {\n\t\t\tcandidateDistance = distance;\n\t\t\tcandidateEdge = edge;\n\t\t}\n\t} );\n\n\treturn [ candidateDistance, candidateEdge ];\n}\n\n/**\n * Is the point contained by the rectangle.\n *\n * @param {WPPoint} point The point.\n * @param {DOMRect} rect The rectangle.\n *\n * @return {boolean} True if the point is contained by the rectangle, false otherwise.\n */\nexport function isPointContainedByRect( point, rect ) {\n\treturn (\n\t\trect.left <= point.x &&\n\t\trect.right >= point.x &&\n\t\trect.top <= point.y &&\n\t\trect.bottom >= point.y\n\t);\n}\n\n/**\n * Is the point within the top and bottom boundaries of the rectangle.\n *\n * @param {WPPoint} point The point.\n * @param {DOMRect} rect The rectangle.\n *\n * @return {boolean} True if the point is within top and bottom of rectangle, false otherwise.\n */\nexport function isPointWithinTopAndBottomBoundariesOfRect( point, rect ) {\n\treturn rect.top <= point.y && rect.bottom >= point.y;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,0BAA0BA,CAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAG;EAC/D,MAAMC,YAAY,GAAGD,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAK,QAAQ;EACxD,MAAM;IAAEE,CAAC;IAAEC;EAAE,CAAC,GAAGL,KAAK;EACtB,MAAMM,oBAAoB,GAAGH,YAAY,GAAGC,CAAC,GAAGC,CAAC;EACjD,MAAME,oBAAoB,GAAGJ,YAAY,GAAGE,CAAC,GAAGD,CAAC;EACjD,MAAMI,SAAS,GAAGL,YAAY,GAAGF,IAAI,CAACQ,IAAI,GAAGR,IAAI,CAACS,GAAG;EACrD,MAAMC,OAAO,GAAGR,YAAY,GAAGF,IAAI,CAACW,KAAK,GAAGX,IAAI,CAACY,MAAM;EACvD,MAAMC,mBAAmB,GAAGb,IAAI,CAAEC,IAAI,CAAE;;EAExC;EACA;EACA;EACA;EACA,IAAIa,mBAAmB;EACvB,IACCT,oBAAoB,IAAIE,SAAS,IACjCF,oBAAoB,IAAIK,OAAO,EAC9B;IACDI,mBAAmB,GAAGT,oBAAoB;EAC3C,CAAC,MAAM,IAAKA,o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AI,EAAG;EACxE,OAAOA,IAAI,CAACS,GAAG,IAAIV,KAAK,CAACK,CAAC,IAAIJ,IAAI,CAACY,MAAM,IAAIb,KAAK,CAACK,CAAC;AACrD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["getDistanceFromPointToEdge","point","rect","edge","isHorizontal","x","y","pointLateralPosition","pointForwardPosition","edgeStart","left","top","edgeEnd","right","bottom","edgeForwardPosition","edgeLateralPosition","Math","sqrt","getDistanceToNearestEdge","allowedEdges","candidateDistance","candidateEdge","forEach","distance","undefined","isPointContainedByRect","isPointWithinTopAndBottomBoundariesOfRect"],"sources":["@wordpress/block-editor/src/utils/math.js"],"sourcesContent":["/**\n * A string representing the name of an edge.\n *\n * @typedef {'top'|'right'|'bottom'|'left'} WPEdgeName\n */\n\n/**\n * @typedef {Object} WPPoint\n * @property {number} x The horizontal position.\n * @property {number} y The vertical position.\n */\n\n/**\n * Given a point, a DOMRect and the name of an edge, returns the distance to\n * that edge of the rect.\n *\n * This function works for edges that are horizontal or vertical (e.g. not\n * rotated), the following terms are used so that the function works in both\n * orientations:\n *\n * - Forward, meaning the axis running horizontally when an edge is vertical\n * and vertically when an edge is horizontal.\n * - Lateral, meaning the axis running vertically when an edge is vertical\n * and horizontally when an edge is horizontal.\n *\n * @param {WPPoint} point The point to measure distance from.\n * @param {DOMRect} rect A DOM Rect containing edge positions.\n * @param {WPEdgeName} edge The edge to measure to.\n */\nexport function getDistanceFromPointToEdge( point, rect, edge ) {\n\tconst isHorizontal = edge === 'top' || edge === 'bottom';\n\tconst { x, y } = point;\n\tconst pointLateralPosition = isHorizontal ? x : y;\n\tconst pointForwardPosition = isHorizontal ? y : x;\n\tconst edgeStart = isHorizontal ? rect.left : rect.top;\n\tconst edgeEnd = isHorizontal ? rect.right : rect.bottom;\n\tconst edgeForwardPosition = rect[ edge ];\n\n\t// Measure the straight line distance to the edge of the rect, when the\n\t// point is adjacent to the edge.\n\t// Else, if the point is positioned diagonally to the edge of the rect,\n\t// measure diagonally to the nearest corner that the edge meets.\n\tlet edgeLateralPosition;\n\tif (\n\t\tpointLateralPosition >= edgeStart &&\n\t\tpointLateralPosition <= edgeEnd\n\t) {\n\t\tedgeLateralPosition = pointLateralPosition;\n\t} else if ( pointLateralPosition < edgeEnd ) {\n\t\tedgeLateralPosition = edgeStart;\n\t} else {\n\t\tedgeLateralPosition = edgeEnd;\n\t}\n\n\treturn Math.sqrt(\n\t\t( pointLateralPosition - edgeLateralPosition ) ** 2 +\n\t\t\t( pointForwardPosition - edgeForwardPosition ) ** 2\n\t);\n}\n\n/**\n * Given a point, a DOMRect and a list of allowed edges returns the name of and\n * distance to the nearest edge.\n *\n * @param {WPPoint} point The point to measure distance from.\n * @param {DOMRect} rect A DOM Rect containing edge positions.\n * @param {WPEdgeName[]} allowedEdges A list of the edges included in the\n * calculation. Defaults to all edges.\n *\n * @return {[number, string]} An array where the first value is the distance\n * and a second is the edge name.\n */\nexport function getDistanceToNearestEdge(\n\tpoint,\n\trect,\n\tallowedEdges = [ 'top', 'bottom', 'left', 'right' ]\n) {\n\tlet candidateDistance;\n\tlet candidateEdge;\n\n\tallowedEdges.forEach( ( edge ) => {\n\t\tconst distance = getDistanceFromPointToEdge( point, rect, edge );\n\n\t\tif ( candidateDistance === undefined || distance < candidateDistance ) {\n\t\t\tcandidateDistance = distance;\n\t\t\tcandidateEdge = edge;\n\t\t}\n\t} );\n\n\treturn [ candidateDistance, candidateEdge ];\n}\n\n/**\n * Is the point contained by the rectangle.\n *\n * @param {WPPoint} point The point.\n * @param {DOMRect} rect The rectangle.\n *\n * @return {boolean} True if the point is contained by the rectangle, false otherwise.\n */\nexport function isPointContainedByRect( point, rect ) {\n\treturn (\n\t\trect.left <= point.x &&\n\t\trect.right >= point.x &&\n\t\trect.top <= point.y &&\n\t\trect.bottom >= point.y\n\t);\n}\n\n/**\n * Is the point within the top and bottom boundaries of the rectangle.\n *\n * @param {WPPoint} point The point.\n * @param {DOMRect} rect The rectangle.\n *\n * @return {boolean} True if the point is within top and bottom of rectangle, false otherwise.\n */\nexport function isPointWithinTopAndBottomBoundariesOfRect( point, rect ) {\n\treturn rect.top <= point.y && rect.bottom >= point.y;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,0BAA0BA,CAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAG;EAC/D,MAAMC,YAAY,GAAGD,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAK,QAAQ;EACxD,MAAM;IAAEE,CAAC;IAAEC;EAAE,CAAC,GAAGL,KAAK;EACtB,MAAMM,oBAAoB,GAAGH,YAAY,GAAGC,CAAC,GAAGC,CAAC;EACjD,MAAME,oBAAoB,GAAGJ,YAAY,GAAGE,CAAC,GAAGD,CAAC;EACjD,MAAMI,SAAS,GAAGL,YAAY,GAAGF,IAAI,CAACQ,IAAI,GAAGR,IAAI,CAACS,GAAG;EACrD,MAAMC,OAAO,GAAGR,YAAY,GAAGF,IAAI,CAACW,KAAK,GAAGX,IAAI,CAACY,MAAM;EACvD,MAAMC,mBAAmB,GAAGb,IAAI,CAAEC,IAAI,CAAE;;EAExC;EACA;EACA;EACA;EACA,IAAIa,mBAAmB;EACvB,IACCT,oBAAoB,IAAIE,SAAS,IACjCF,oBAAoB,IAAIK,OAAO,EAC9B;IACDI,mBAAmB,GAAGT,oBAAoB;EAC3C,CAAC,MAAM,IAAKA,oBAAoB,GAAGK,OAAO,EAAG;IAC5CI,mBAAmB,GAAGP,SAAS;EAChC,CAAC,MAAM;IACNO,mBAAmB,GAAGJ,OAAO;EAC9B;EAEA,OAAOK,IAAI,CAACC,IAAI,CACf,CAAEX,oBAAoB,GAAGS,mBAAmB,KAAM,CAAC,GAClD,CAAER,oBAAoB,GAAGO,mBAAmB,KAAM,CACpD,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,wBAAwBA,CACvClB,KAAK,EACLC,IAAI,EACJkB,YAAY,GAAG,CAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAE,EAClD;EACD,IAAIC,iBAAiB;EACrB,IAAIC,aAAa;EAEjBF,YAAY,CAACG,OAAO,CAAIpB,IAAI,IAAM;IACjC,MAAMqB,QAAQ,GAAGxB,0BAA0B,CAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAK,CAAC;IAEhE,IAAKkB,iBAAiB,KAAKI,SAAS,IAAID,QAAQ,GAAGH,iBAAiB,EAAG;MACtEA,iBAAiB,GAAGG,QAAQ;MAC5BF,aAAa,GAAGnB,IAAI;IACrB;EACD,CAAE,CAAC;EAEH,OAAO,CAAEkB,iBAAiB,EAAEC,aAAa,CAAE;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,sBAAsBA,CAAEzB,KAAK,EAAEC,IAAI,EAAG;EACrD,OACCA,IAAI,CAACQ,IAAI,IAAIT,KAAK,CAACI,CAAC,IACpBH,IAAI,CAACW,KAAK,IAAIZ,KAAK,CAACI,CAAC,IACrBH,IAAI,CAACS,GAAG,IAAIV,KAAK,CAACK,CAAC,IACnBJ,IAAI,CAACY,MAAM,IAAIb,KAAK,CAACK,CAAC;AAExB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASqB,yCAAyCA,CAAE1B,KAAK,EAAEC,IAAI,EAAG;EACxE,OAAOA,IAAI,CAACS,GAAG,IAAIV,KAAK,CAACK,CAAC,IAAIJ,IAAI,CAACY,MAAM,IAAIb,KAAK,CAACK,CAAC;AACrD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["setImmutably","object","path","value","Array","isArray","leaf","pop","prev","key","lvl","getValueFromObjectPath","defaultValue","_value","arrayPath","split","forEach","fieldName","uniqByProperty","array","property","seen","Set","filter","item","has","add"],"sources":["@wordpress/block-editor/src/utils/object.js"],"sourcesContent":["/**\n * Immutably sets a value inside an object. Like `lodash#set`, but returning a\n * new object. Treats nullish initial values as empty objects. Clones any\n * nested objects. Supports arrays, too.\n *\n * @param {Object} object Object to set a value in.\n * @param {number|string|Array} path Path in the object to modify.\n * @param {*} value New value to set.\n * @return {Object} Cloned object with the new value set.\n */\nexport function setImmutably( object, path, value ) {\n\t// Normalize path\n\tpath = Array.isArray( path ) ? [ ...path ] : [ path ];\n\n\t// Shallowly clone the base of the object\n\tobject = Array.isArray( object ) ? [ ...object ] : { ...object };\n\n\tconst leaf = path.pop();\n\n\t// Traverse object from root to leaf, shallowly cloning at each level\n\tlet prev = object;\n\tfor ( const key of path ) {\n\t\tconst lvl = prev[ key ];\n\t\tprev = prev[ key ] = Array.isArray( lvl ) ? [ ...lvl ] : { ...lvl };\n\t}\n\n\tprev[ leaf ] = value;\n\n\treturn object;\n}\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as either:\n * - a string of properties, separated by dots, for example: \"x.y\".\n * - an array of properties, for example `[ 'x', 'y' ]`.\n * You can also specify a default value in case the result is nullish.\n *\n * @param {Object} object Input object.\n * @param {string|Array} path Path to the object property.\n * @param {*} defaultValue Default value if the value at the specified path is nullish.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path, defaultValue ) => {\n\tconst arrayPath = Array.isArray( path ) ? path : path.split( '.' );\n\tlet value = object;\n\tarrayPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value ?? defaultValue;\n};\n\n/**\n * Helper util to filter out objects with duplicate values for a given property.\n *\n * @param {Object[]} array Array of objects to filter.\n * @param {string} property Property to filter unique values by.\n *\n * @return {Object[]} Array of objects with unique values for the specified property.\n */\nexport function uniqByProperty( array, property ) {\n\tconst seen = new Set();\n\treturn array.filter( ( item ) => {\n\t\tconst value = item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KAAK,GAAIc,SAAS,CAAE;EAC7B,CAAE,CAAC;EACH,QAAAJ,MAAA,GAAOV,KAAK,cAAAU,MAAA,cAAAA,MAAA,GAAID,YAAY;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,cAAcA,CAAEC,KAAK,EAAEC,QAAQ,EAAG;EACjD,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAC,CAAC;EACtB,OAAOH,KAAK,CAACI,MAAM,CAAIC,IAAI,IAAM;IAChC,MAAMrB,KAAK,GAAGqB,IAAI,CAAEJ,QAAQ,CAAE;IAC9B,OAAOC,IAAI,CAACI,GAAG,CAAEtB,KAAM,CAAC,GAAG,KAAK,GAAGkB,IAAI,CAACK,GAAG,CAAEvB,KAAM,CAAC;EACrD,CAAE,CAAC;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["setImmutably","object","path","value","Array","isArray","leaf","pop","prev","key","lvl","getValueFromObjectPath","defaultValue","_value","arrayPath","split","forEach","fieldName","uniqByProperty","array","property","seen","Set","filter","item","has","add"],"sources":["@wordpress/block-editor/src/utils/object.js"],"sourcesContent":["/**\n * Immutably sets a value inside an object. Like `lodash#set`, but returning a\n * new object. Treats nullish initial values as empty objects. Clones any\n * nested objects. Supports arrays, too.\n *\n * @param {Object} object Object to set a value in.\n * @param {number|string|Array} path Path in the object to modify.\n * @param {*} value New value to set.\n * @return {Object} Cloned object with the new value set.\n */\nexport function setImmutably( object, path, value ) {\n\t// Normalize path\n\tpath = Array.isArray( path ) ? [ ...path ] : [ path ];\n\n\t// Shallowly clone the base of the object\n\tobject = Array.isArray( object ) ? [ ...object ] : { ...object };\n\n\tconst leaf = path.pop();\n\n\t// Traverse object from root to leaf, shallowly cloning at each level\n\tlet prev = object;\n\tfor ( const key of path ) {\n\t\tconst lvl = prev[ key ];\n\t\tprev = prev[ key ] = Array.isArray( lvl ) ? [ ...lvl ] : { ...lvl };\n\t}\n\n\tprev[ leaf ] = value;\n\n\treturn object;\n}\n\n/**\n * Helper util to return a value from a certain path of the object.\n * Path is specified as either:\n * - a string of properties, separated by dots, for example: \"x.y\".\n * - an array of properties, for example `[ 'x', 'y' ]`.\n * You can also specify a default value in case the result is nullish.\n *\n * @param {Object} object Input object.\n * @param {string|Array} path Path to the object property.\n * @param {*} defaultValue Default value if the value at the specified path is nullish.\n * @return {*} Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = ( object, path, defaultValue ) => {\n\tconst arrayPath = Array.isArray( path ) ? path : path.split( '.' );\n\tlet value = object;\n\tarrayPath.forEach( ( fieldName ) => {\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value ?? defaultValue;\n};\n\n/**\n * Helper util to filter out objects with duplicate values for a given property.\n *\n * @param {Object[]} array Array of objects to filter.\n * @param {string} property Property to filter unique values by.\n *\n * @return {Object[]} Array of objects with unique values for the specified property.\n */\nexport function uniqByProperty( array, property ) {\n\tconst seen = new Set();\n\treturn array.filter( ( item ) => {\n\t\tconst value = item[ property ];\n\t\treturn seen.has( value ) ? false : seen.add( value );\n\t} );\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,YAAYA,CAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAG;EACnD;EACAD,IAAI,GAAGE,KAAK,CAACC,OAAO,CAAEH,IAAK,CAAC,GAAG,CAAE,GAAGA,IAAI,CAAE,GAAG,CAAEA,IAAI,CAAE;;EAErD;EACAD,MAAM,GAAGG,KAAK,CAACC,OAAO,CAAEJ,MAAO,CAAC,GAAG,CAAE,GAAGA,MAAM,CAAE,GAAG;IAAE,GAAGA;EAAO,CAAC;EAEhE,MAAMK,IAAI,GAAGJ,IAAI,CAACK,GAAG,CAAC,CAAC;;EAEvB;EACA,IAAIC,IAAI,GAAGP,MAAM;EACjB,KAAM,MAAMQ,GAAG,IAAIP,IAAI,EAAG;IACzB,MAAMQ,GAAG,GAAGF,IA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","retrieveSelectedAttribute","blockAttributes","Object","keys","find","name","value","toString","indexOf","findRichTextAttributeKey","blockType","key","entries","attributes","source"],"sources":["@wordpress/block-editor/src/utils/selection.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RichTextData } from '@wordpress/rich-text';\n\n/**\n * A robust way to retain selection position through various\n * transforms is to insert a special character at the position and\n * then recover it.\n */\nexport const START_OF_SELECTED_AREA = '\\u0086';\n\n/**\n * Retrieve the block attribute that contains the selection position.\n *\n * @param {Object} blockAttributes Block attributes.\n * @return {string|void} The name of the block attribute that was previously selected.\n */\nexport function retrieveSelectedAttribute( blockAttributes ) {\n\tif ( ! blockAttributes ) {\n\t\treturn;\n\t}\n\n\treturn Object.keys( blockAttributes ).find( ( name ) => {\n\t\tconst value = blockAttributes[ name ];\n\t\treturn (\n\t\t\t( typeof value === 'string' || value instanceof RichTextData ) &&\n\t\t\t// To do: refactor this to use rich text's selection instead, so we\n\t\t\t// no longer have to use on this hack inserting a special character.\n\t\t\tvalue.toString().indexOf( START_OF_SELECTED_AREA ) !== -1\n\t\t);\n\t} );\n}\n\nexport function findRichTextAttributeKey( blockType ) {\n\tfor ( const [ key, value ] of Object.entries( blockType.attributes ) ) {\n\t\tif ( value.source === 'rich-text' || value.source === 'html' ) {\n\t\t\treturn key;\n\t\t}\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,sBAAsB;;AAEnD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAG,QAAQ;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CAAEC,eAAe,EAAG;EAC5D,IAAK,CAAEA,eAAe,EAAG;IACxB;EACD;EAEA,OAAOC,MAAM,CAACC,IAAI,CAAEF,eAAgB,CAAC,CAACG,IAAI,CAAIC,IAAI,IAAM;IACvD,MAAMC,KAAK,GAAGL,eAAe,CAAEI,IAAI,CAAE;IACrC,OACC,CAAE,OAAOC,KAAK,KAAK,QAAQ,IAAIA,KAAK,YAAYR,YAAY;IAC5D;IACA;IACAQ,KAAK,CAACC,QAAQ,CAAC,CAAC,CAACC,OAAO,CAAET,sBAAuB,CAAC,KAAK,CAAC,CAAC;EAE3D,CAAE,CAAC;AACJ;AAEA,OAAO,SAASU,wBAAwBA,CAAEC,SAAS,EAAG;EACrD,KAAM,MAAM,CAAEC,GAAG,EAAEL,KAAK,CAAE,IAAIJ,MAAM,CAACU,OAAO,CAAEF,SAAS,CAACG,UAAW,CAAC,EAAG;IACtE,IAAKP,KAAK,CAACQ,MAAM,KAAK,WAAW,IAAIR,KAAK,CAACQ,MAAM,KAAK,MAAM,EAAG;MAC9D,OAAOH,GAAG;IACX;EACD;AACD","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["RichTextData","START_OF_SELECTED_AREA","retrieveSelectedAttribute","blockAttributes","Object","keys","find","name","value","toString","indexOf","findRichTextAttributeKey","blockType","key","entries","attributes","source"],"sources":["@wordpress/block-editor/src/utils/selection.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { RichTextData } from '@wordpress/rich-text';\n\n/**\n * A robust way to retain selection position through various\n * transforms is to insert a special character at the position and\n * then recover it.\n */\nexport const START_OF_SELECTED_AREA = '\\u0086';\n\n/**\n * Retrieve the block attribute that contains the selection position.\n *\n * @param {Object} blockAttributes Block attributes.\n * @return {string|void} The name of the block attribute that was previously selected.\n */\nexport function retrieveSelectedAttribute( blockAttributes ) {\n\tif ( ! blockAttributes ) {\n\t\treturn;\n\t}\n\n\treturn Object.keys( blockAttributes ).find( ( name ) => {\n\t\tconst value = blockAttributes[ name ];\n\t\treturn (\n\t\t\t( typeof value === 'string' || value instanceof RichTextData ) &&\n\t\t\t// To do: refactor this to use rich text's selection instead, so we\n\t\t\t// no longer have to use on this hack inserting a special character.\n\t\t\tvalue.toString().indexOf( START_OF_SELECTED_AREA ) !== -1\n\t\t);\n\t} );\n}\n\nexport function findRichTextAttributeKey( blockType ) {\n\tfor ( const [ key, value ] of Object.entries( blockType.attributes ) ) {\n\t\tif ( value.source === 'rich-text' || value.source === 'html' ) {\n\t\t\treturn key;\n\t\t}\n\t}\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,sBAAsB;;AAEnD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAG,QAAQ;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,yBAAyBA,CAAEC,eAAe,EAAG;EAC5D,IAAK,CAAEA,eAAe,EAAG;IACxB;EACD;EAEA,OAAOC,MAAM,CAACC,IAAI,CAAEF,eAAgB,CAAC,CAACG,IAAI,CAAIC,IAAI,IAAM;IACvD,MAAMC,KAAK,GAAGL,eAAe,CAAEI,IAAI,CAAE;IACrC,OACC,CAAE,OAAOC,KAAK,KAAK,QAAQ,IAAIA,KAAK,YAAYR,YAAY;IAC5D;IACA;IACAQ,KAAK,CAACC,QAAQ,CAAC,CAAC,CAACC,OAAO,CAAET,sBAAuB,CAAC,KAAK,CAAC,CAAC;EAE3D,CAAE,CAAC;AACJ;AAEA,OAAO,SAASU,wBAAwBA,CAAEC,SAAS,EAAG;EACrD,KAAM,MAAM,CAAEC,GAAG,EAAEL,KAAK,CAAE,IAAIJ,MAAM,CAACU,OAAO,CAAEF,SAAS,CAACG,UAAW,CAAC,EAAG;IACtE,IAAKP,KAAK,CAACQ,MAAM,KAAK,WAAW,IAAIR,KAAK,CAACQ,MAAM,KAAK,MAAM,EAAG;MAC9D,OAAOH,GAAG;IACX;EACD;AACD","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["parsel","Processor","CssSyntaxError","prefixSelector","rebaseUrl","cacheByWrapperSelector","Map","ROOT_SELECTOR_TOKENS","type","content","prefixRootSelector","prefix","selector","tokenized","tokenize","lastRootIndex","findLastIndex","some","rootSelector","insertionPoint","i","length","tokenizedPrefix","splice","stringify","transformStyle","css","ignoredSelectors","baseURL","wrapperSelector","transformOptions","_transformOptions$ign","excludedSelectors","transform","prefixedSelector","excludedSelector","RegExp","match","includes","hasRootSelector","startsWith","rootUrl","filter","Boolean","process","error","console","warn","message","showSourceCode","transformStyles","styles","cache","get","WeakMap","set","map","style"],"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as parsel from 'parsel-js';\nimport Processor from 'postcss/lib/processor';\nimport CssSyntaxError from 'postcss/lib/css-syntax-error';\nimport prefixSelector from 'postcss-prefix-selector';\nimport rebaseUrl from 'postcss-urlrebase';\n\nconst cacheByWrapperSelector = new Map();\n\nconst ROOT_SELECTOR_TOKENS = [\n\t{ type: 'type', content: 'body' },\n\t{ type: 'type', content: 'html' },\n\t{ type: 'pseudo-class', content: ':root' },\n\t{ type: 'pseudo-class', content: ':where(body)' },\n\t{ type: 'pseudo-class', content: ':where(:root)' },\n\t{ type: 'pseudo-class', content: ':where(html)' },\n];\n\n/**\n * Prefixes root selectors in a way that ensures consistent specificity.\n * This requires special handling, since prefixing a classname before\n * html, body, or :root will generally result in an invalid selector.\n *\n * Some libraries will simply replace the root selector with the prefix\n * instead, but this results in inconsistent specificity.\n *\n * This function instead inserts the prefix after the root tags but before\n * any other part of the selector. This results in consistent specificity:\n * - If a `:where()` selector is used for the prefix, all selectors output\n * by `transformStyles` will have no specificity increase.\n * - If a classname, id, or something else is used as the prefix, all selectors\n * will have the same specificity bump when transformed.\n *\n * @param {string} prefix The prefix.\n * @param {string} selector The selector.\n *\n * @return {string} The prefixed root selector.\n */\nfunction prefixRootSelector( prefix, selector ) {\n\t// Use a tokenizer, since regular expressions are unreliable.\n\tconst tokenized = parsel.tokenize( selector );\n\n\t// Find the last token that contains a root selector by walking back\n\t// through the tokens.\n\tconst lastRootIndex = tokenized.findLastIndex( ( { content, type } ) => {\n\t\treturn ROOT_SELECTOR_TOKENS.some(\n\t\t\t( rootSelector ) =>\n\t\t\t\tcontent === rootSelector.content && type === rootSelector.type\n\t\t);\n\t} );\n\n\t// Walk forwards to find the combinator after the last root.\n\t// This is where the root ends and the rest of the selector begins,\n\t// and the index to insert before.\n\t// Doing it this way takes into account that a root selector like\n\t// 'body' may have additional id/class/pseudo-class/attribute-selector\n\t// parts chained to it, which is difficult to quantify using a regex.\n\tlet insertionPoint = -1;\n\tfor ( let i = lastRootIndex + 1; i < tokenized.length; i++ ) {\n\t\tif ( tokenized[ i ].type === 'combinator' ) {\n\t\t\tinsertionPoint = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Tokenize and insert the prefix with a ' ' combinator before it.\n\tconst tokenizedPrefix = parsel.tokenize( prefix );\n\ttokenized.splice(\n\t\t// Insert at the insertion point, or the end.\n\t\tinsertionPoint === -1 ? tokenized.length : insertionPoint,\n\t\t0,\n\t\t{\n\t\t\ttype: 'combinator',\n\t\t\tcontent: ' ',\n\t\t},\n\t\t...tokenizedPrefix\n\t);\n\n\treturn parsel.stringify( tokenized );\n}\n\nfunction transformStyle(\n\t{ css, ignoredSelectors = [], baseURL },\n\twrapperSelector = '',\n\ttransformOptions\n) {\n\t// When there is no wrapper selector and no base URL, there is no need\n\t// to transform the CSS. This is most cases because in the default\n\t// iframed editor, no wrapping is needed, and not many styles\n\t// provide a base URL.\n\tif ( ! wrapperSelector && ! baseURL ) {\n\t\treturn css;\n\t}\n\n\ttry {\n\t\tconst excludedSelectors = [\n\t\t\t...ignoredSelectors,\n\t\t\t...( transformOptions?.ignoredSelectors ?? [] ),\n\t\t\twrapperSelector,\n\t\t];\n\n\t\treturn new Processor(\n\t\t\t[\n\t\t\t\twrapperSelector &&\n\t\t\t\t\tprefixSelector( {\n\t\t\t\t\t\tprefix: wrapperSelector,\n\t\t\t\t\t\ttransform( prefix, selector, prefixedSelector ) {\n\t\t\t\t\t\t\t// For backwards compatibility, don't use the `exclude` option\n\t\t\t\t\t\t\t// of postcss-prefix-selector, instead handle it here to match\n\t\t\t\t\t\t\t// the behavior of the old library (postcss-prefix-wrap) that\n\t\t\t\t\t\t\t// `transformStyle` previously used.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\texcludedSelectors.some( ( excludedSelector ) =>\n\t\t\t\t\t\t\t\t\texcludedSelector instanceof RegExp\n\t\t\t\t\t\t\t\t\t\t? selector.match( excludedSelector )\n\t\t\t\t\t\t\t\t\t\t: selector.includes( excludedSelector )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn selector;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst hasRootSelector = ROOT_SELECTOR_TOKENS.some(\n\t\t\t\t\t\t\t\t( rootSelector ) =>\n\t\t\t\t\t\t\t\t\tselector.startsWith( rootSelector.content )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// Reorganize root selectors such that the root part comes before the prefix,\n\t\t\t\t\t\t\t// but the prefix still comes before the remaining part of the selector.\n\t\t\t\t\t\t\tif ( hasRootSelector ) {\n\t\t\t\t\t\t\t\treturn prefixRootSelector( prefix, selector );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prefixedSelector;\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t\tbaseURL && rebaseUrl( { rootUrl: baseURL } ),\n\t\t\t].filter( Boolean )\n\t\t).process( css, {} ).css; // use sync PostCSS API\n\t} catch ( error ) {\n\t\tif ( error instanceof CssSyntaxError ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror.message + '\\n' + error.showSourceCode( false )\n\t\t\t);\n\t\t} else {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\n/**\n * @typedef {Object} EditorStyle\n * @property {string} css the CSS block(s), as a single string.\n * @property {?string} baseURL the base URL to be used as the reference when rewritting urls.\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * @typedef {Object} TransformOptions\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.\n *\n * @param {EditorStyle[]} styles CSS rules.\n * @param {string} wrapperSelector Wrapper selector.\n * @param {TransformOptions} transformOptions Additional options for style transformation.\n * @return {Array} converted rules.\n */\nconst transformStyles = ( styles, wrapperSelector = '', transformOptions ) => {\n\tlet cache = cacheByWrapperSelector.get( wrapperSelector );\n\tif ( ! cache ) {\n\t\tcache = new WeakMap();\n\t\tcacheByWrapperSelector.set( wrapperSelector, cache );\n\t}\n\treturn styles.map( ( style ) => {\n\t\tlet css = cache.get( style );\n\t\tif ( ! css ) {\n\t\t\tcss = transformStyle( style, wrapperSelector, transformOptions );\n\t\t\tcache.set( style, css );\n\t\t}\n\t\treturn css;\n\t} );\n};\n\nexport default transformStyles;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,KAAKA,MAAM,MAAM,WAAW;AACnC,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,cAAc,MAAM,8BAA8B;AACzD,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,SAAS,MAAM,mBAAmB;AAEzC,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CAAC;AAExC,MAAMC,oBAAoB,GAAG,CAC5B;EAAEC,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAO,CAAC,EACjC;EAAED,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAO,CAAC,EACjC;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAQ,CAAC,EAC1C;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAe,CAAC,EACjD;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAgB,CAAC,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CAAC,OAAQmB,KAAK,EAAG;IACjB,IAAKA,KAAK,YAAY3C,cAAc,EAAG;MACtC;MACA4C,OAAO,CAACC,IAAI,CACX,yDAAyD,EACzDF,KAAK,CAACG,OAAO,GAAG,IAAI,GAAGH,KAAK,CAACI,cAAc,CAAE,KAAM,CACpD,CAAC;IACF,CAAC,MAAM;MACN;MACAH,OAAO,CAACC,IAAI,CACX,yDAAyD,EACzDF,KACD,CAAC;IACF;IAEA,OAAO,IAAI;EACZ;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,eAAe,GAAGA,CAAEC,MAAM,EAAEtB,eAAe,GAAG,EAAE,EAAEC,gBAAgB,KAAM;EAC7E,IAAIsB,KAAK,GAAG/C,sBAAsB,CAACgD,GAAG,CAAExB,eAAgB,CAAC;EACzD,IAAK,CAAEuB,KAAK,EAAG;IACdA,KAAK,GAAG,IAAIE,OAAO,CAAC,CAAC;IACrBjD,sBAAsB,CAACkD,GAAG,CAAE1B,eAAe,EAAEuB,KAAM,CAAC;EACrD;EACA,OAAOD,MAAM,CAACK,GAAG,CAAIC,KAAK,IAAM;IAC/B,IAAI/B,GAAG,GAAG0B,KAAK,CAACC,GAAG,CAAEI,KAAM,CAAC;IAC5B,IAAK,CAAE/B,GAAG,EAAG;MACZA,GAAG,GAAGD,cAAc,CAAEgC,KAAK,EAAE5B,eAAe,EAAEC,gBAAiB,CAAC;MAChEsB,KAAK,CAACG,GAAG,CAAEE,KAAK,EAAE/B,GAAI,CAAC;IACxB;IACA,OAAOA,GAAG;EACX,CAAE,CAAC;AACJ,CAAC;AAED,eAAewB,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["parsel","Processor","CssSyntaxError","prefixSelector","rebaseUrl","cacheByWrapperSelector","Map","ROOT_SELECTOR_TOKENS","type","content","prefixRootSelector","prefix","selector","tokenized","tokenize","lastRootIndex","findLastIndex","some","rootSelector","insertionPoint","i","length","tokenizedPrefix","splice","stringify","transformStyle","css","ignoredSelectors","baseURL","wrapperSelector","transformOptions","_transformOptions$ign","excludedSelectors","transform","prefixedSelector","excludedSelector","RegExp","match","includes","hasRootSelector","startsWith","rootUrl","filter","Boolean","process","error","console","warn","message","showSourceCode","transformStyles","styles","cache","get","WeakMap","set","map","style"],"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport * as parsel from 'parsel-js';\nimport Processor from 'postcss/lib/processor';\nimport CssSyntaxError from 'postcss/lib/css-syntax-error';\nimport prefixSelector from 'postcss-prefix-selector';\nimport rebaseUrl from 'postcss-urlrebase';\n\nconst cacheByWrapperSelector = new Map();\n\nconst ROOT_SELECTOR_TOKENS = [\n\t{ type: 'type', content: 'body' },\n\t{ type: 'type', content: 'html' },\n\t{ type: 'pseudo-class', content: ':root' },\n\t{ type: 'pseudo-class', content: ':where(body)' },\n\t{ type: 'pseudo-class', content: ':where(:root)' },\n\t{ type: 'pseudo-class', content: ':where(html)' },\n];\n\n/**\n * Prefixes root selectors in a way that ensures consistent specificity.\n * This requires special handling, since prefixing a classname before\n * html, body, or :root will generally result in an invalid selector.\n *\n * Some libraries will simply replace the root selector with the prefix\n * instead, but this results in inconsistent specificity.\n *\n * This function instead inserts the prefix after the root tags but before\n * any other part of the selector. This results in consistent specificity:\n * - If a `:where()` selector is used for the prefix, all selectors output\n * by `transformStyles` will have no specificity increase.\n * - If a classname, id, or something else is used as the prefix, all selectors\n * will have the same specificity bump when transformed.\n *\n * @param {string} prefix The prefix.\n * @param {string} selector The selector.\n *\n * @return {string} The prefixed root selector.\n */\nfunction prefixRootSelector( prefix, selector ) {\n\t// Use a tokenizer, since regular expressions are unreliable.\n\tconst tokenized = parsel.tokenize( selector );\n\n\t// Find the last token that contains a root selector by walking back\n\t// through the tokens.\n\tconst lastRootIndex = tokenized.findLastIndex( ( { content, type } ) => {\n\t\treturn ROOT_SELECTOR_TOKENS.some(\n\t\t\t( rootSelector ) =>\n\t\t\t\tcontent === rootSelector.content && type === rootSelector.type\n\t\t);\n\t} );\n\n\t// Walk forwards to find the combinator after the last root.\n\t// This is where the root ends and the rest of the selector begins,\n\t// and the index to insert before.\n\t// Doing it this way takes into account that a root selector like\n\t// 'body' may have additional id/class/pseudo-class/attribute-selector\n\t// parts chained to it, which is difficult to quantify using a regex.\n\tlet insertionPoint = -1;\n\tfor ( let i = lastRootIndex + 1; i < tokenized.length; i++ ) {\n\t\tif ( tokenized[ i ].type === 'combinator' ) {\n\t\t\tinsertionPoint = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Tokenize and insert the prefix with a ' ' combinator before it.\n\tconst tokenizedPrefix = parsel.tokenize( prefix );\n\ttokenized.splice(\n\t\t// Insert at the insertion point, or the end.\n\t\tinsertionPoint === -1 ? tokenized.length : insertionPoint,\n\t\t0,\n\t\t{\n\t\t\ttype: 'combinator',\n\t\t\tcontent: ' ',\n\t\t},\n\t\t...tokenizedPrefix\n\t);\n\n\treturn parsel.stringify( tokenized );\n}\n\nfunction transformStyle(\n\t{ css, ignoredSelectors = [], baseURL },\n\twrapperSelector = '',\n\ttransformOptions\n) {\n\t// When there is no wrapper selector and no base URL, there is no need\n\t// to transform the CSS. This is most cases because in the default\n\t// iframed editor, no wrapping is needed, and not many styles\n\t// provide a base URL.\n\tif ( ! wrapperSelector && ! baseURL ) {\n\t\treturn css;\n\t}\n\n\ttry {\n\t\tconst excludedSelectors = [\n\t\t\t...ignoredSelectors,\n\t\t\t...( transformOptions?.ignoredSelectors ?? [] ),\n\t\t\twrapperSelector,\n\t\t];\n\n\t\treturn new Processor(\n\t\t\t[\n\t\t\t\twrapperSelector &&\n\t\t\t\t\tprefixSelector( {\n\t\t\t\t\t\tprefix: wrapperSelector,\n\t\t\t\t\t\ttransform( prefix, selector, prefixedSelector ) {\n\t\t\t\t\t\t\t// For backwards compatibility, don't use the `exclude` option\n\t\t\t\t\t\t\t// of postcss-prefix-selector, instead handle it here to match\n\t\t\t\t\t\t\t// the behavior of the old library (postcss-prefix-wrap) that\n\t\t\t\t\t\t\t// `transformStyle` previously used.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\texcludedSelectors.some( ( excludedSelector ) =>\n\t\t\t\t\t\t\t\t\texcludedSelector instanceof RegExp\n\t\t\t\t\t\t\t\t\t\t? selector.match( excludedSelector )\n\t\t\t\t\t\t\t\t\t\t: selector.includes( excludedSelector )\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\treturn selector;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst hasRootSelector = ROOT_SELECTOR_TOKENS.some(\n\t\t\t\t\t\t\t\t( rootSelector ) =>\n\t\t\t\t\t\t\t\t\tselector.startsWith( rootSelector.content )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// Reorganize root selectors such that the root part comes before the prefix,\n\t\t\t\t\t\t\t// but the prefix still comes before the remaining part of the selector.\n\t\t\t\t\t\t\tif ( hasRootSelector ) {\n\t\t\t\t\t\t\t\treturn prefixRootSelector( prefix, selector );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn prefixedSelector;\n\t\t\t\t\t\t},\n\t\t\t\t\t} ),\n\t\t\t\tbaseURL && rebaseUrl( { rootUrl: baseURL } ),\n\t\t\t].filter( Boolean )\n\t\t).process( css, {} ).css; // use sync PostCSS API\n\t} catch ( error ) {\n\t\tif ( error instanceof CssSyntaxError ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror.message + '\\n' + error.showSourceCode( false )\n\t\t\t);\n\t\t} else {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t'wp.blockEditor.transformStyles Failed to transform CSS.',\n\t\t\t\terror\n\t\t\t);\n\t\t}\n\n\t\treturn null;\n\t}\n}\n\n/**\n * @typedef {Object} EditorStyle\n * @property {string} css the CSS block(s), as a single string.\n * @property {?string} baseURL the base URL to be used as the reference when rewritting urls.\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * @typedef {Object} TransformOptions\n * @property {?string[]} ignoredSelectors the selectors not to wrap.\n */\n\n/**\n * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed.\n *\n * @param {EditorStyle[]} styles CSS rules.\n * @param {string} wrapperSelector Wrapper selector.\n * @param {TransformOptions} transformOptions Additional options for style transformation.\n * @return {Array} converted rules.\n */\nconst transformStyles = ( styles, wrapperSelector = '', transformOptions ) => {\n\tlet cache = cacheByWrapperSelector.get( wrapperSelector );\n\tif ( ! cache ) {\n\t\tcache = new WeakMap();\n\t\tcacheByWrapperSelector.set( wrapperSelector, cache );\n\t}\n\treturn styles.map( ( style ) => {\n\t\tlet css = cache.get( style );\n\t\tif ( ! css ) {\n\t\t\tcss = transformStyle( style, wrapperSelector, transformOptions );\n\t\t\tcache.set( style, css );\n\t\t}\n\t\treturn css;\n\t} );\n};\n\nexport default transformStyles;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAO,KAAKA,MAAM,MAAM,WAAW;AACnC,OAAOC,SAAS,MAAM,uBAAuB;AAC7C,OAAOC,cAAc,MAAM,8BAA8B;AACzD,OAAOC,cAAc,MAAM,yBAAyB;AACpD,OAAOC,SAAS,MAAM,mBAAmB;AAEzC,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CAAC;AAExC,MAAMC,oBAAoB,GAAG,CAC5B;EAAEC,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAO,CAAC,EACjC;EAAED,IAAI,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAO,CAAC,EACjC;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;AAAQ,CAAC,EAC1C;EAAED,IAAI,EAAE,cAAc;EAAEC,OAAO,EAAE;A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