@wordpress/block-editor 12.2.0 → 12.3.1
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 +12 -0
- package/README.md +12 -0
- package/build/autocompleters/block.js +6 -6
- package/build/autocompleters/block.js.map +1 -1
- package/build/components/alignment-control/index.js +4 -6
- package/build/components/alignment-control/index.js.map +1 -1
- package/build/components/alignment-control/ui.js +14 -20
- package/build/components/alignment-control/ui.js.map +1 -1
- package/build/components/autocomplete/index.js +5 -8
- package/build/components/autocomplete/index.js.map +1 -1
- package/build/components/block-actions/index.js +12 -12
- package/build/components/block-actions/index.js.map +1 -1
- package/build/components/block-alignment-control/constants.js +1 -5
- package/build/components/block-alignment-control/constants.js.map +1 -1
- package/build/components/block-alignment-control/index.js +4 -6
- package/build/components/block-alignment-control/index.js.map +1 -1
- package/build/components/block-alignment-control/ui.js +20 -25
- package/build/components/block-alignment-control/ui.js.map +1 -1
- package/build/components/block-alignment-control/ui.native.js +17 -20
- package/build/components/block-alignment-control/ui.native.js.map +1 -1
- package/build/components/block-alignment-control/use-available-alignments.js +5 -10
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-alignment-matrix-control/index.js +4 -7
- package/build/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build/components/block-breadcrumb/index.js +5 -7
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-caption/index.native.js +30 -35
- package/build/components/block-caption/index.native.js.map +1 -1
- package/build/components/block-card/index.js +7 -9
- package/build/components/block-card/index.js.map +1 -1
- package/build/components/block-compare/block-view.js +8 -9
- package/build/components/block-compare/block-view.js.map +1 -1
- package/build/components/block-compare/index.js +7 -9
- package/build/components/block-compare/index.js.map +1 -1
- package/build/components/block-context/index.js +4 -5
- package/build/components/block-context/index.js.map +1 -1
- package/build/components/block-controls/fill.js +16 -22
- package/build/components/block-controls/fill.js.map +1 -1
- package/build/components/block-controls/hook.js +1 -3
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-controls/index.js +8 -8
- package/build/components/block-controls/index.js.map +1 -1
- package/build/components/block-controls/slot.js +28 -20
- package/build/components/block-controls/slot.js.map +1 -1
- package/build/components/block-controls/slot.native.js +9 -17
- package/build/components/block-controls/slot.native.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.js +5 -6
- package/build/components/block-draggable/draggable-chip.js.map +1 -1
- package/build/components/block-draggable/draggable-chip.native.js +3 -4
- package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
- package/build/components/block-draggable/dropping-insertion-point.native.js +6 -7
- package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
- package/build/components/block-draggable/index.js +15 -16
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-draggable/index.native.js +43 -58
- package/build/components/block-draggable/index.native.js.map +1 -1
- package/build/components/block-edit/edit.js +5 -10
- package/build/components/block-edit/edit.js.map +1 -1
- package/build/components/block-edit/edit.native.js +3 -8
- package/build/components/block-edit/edit.native.js.map +1 -1
- package/build/components/block-edit/index.js +3 -2
- package/build/components/block-edit/index.js.map +1 -1
- package/build/components/block-edit-visually-button/index.js +3 -4
- package/build/components/block-edit-visually-button/index.js.map +1 -1
- package/build/components/block-full-height-alignment-control/index.js +6 -7
- package/build/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build/components/block-heading-level-dropdown/heading-level-icon.js +47 -0
- package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
- package/build/components/block-heading-level-dropdown/index.js +83 -0
- package/build/components/block-heading-level-dropdown/index.js.map +1 -0
- package/build/components/block-heading-level-dropdown/index.native.js +72 -0
- package/build/components/block-heading-level-dropdown/index.native.js.map +1 -0
- package/build/components/block-icon/index.js +7 -11
- package/build/components/block-icon/index.js.map +1 -1
- package/build/components/block-icon/index.native.js +15 -20
- package/build/components/block-icon/index.native.js.map +1 -1
- package/build/components/block-info-slot-fill/index.js +4 -2
- package/build/components/block-info-slot-fill/index.js.map +1 -1
- package/build/components/block-inspector/index.js +45 -122
- package/build/components/block-inspector/index.js.map +1 -1
- package/build/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
- package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
- package/build/components/block-list/block-html.js +3 -4
- package/build/components/block-list/block-html.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.js +3 -4
- package/build/components/block-list/block-invalid-warning.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.native.js +10 -15
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-list/block-list-context.native.js +5 -11
- package/build/components/block-list/block-list-context.native.js.map +1 -1
- package/build/components/block-list/block-list-item-cell.native.js +5 -6
- package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build/components/block-list/block-list-item.native.js +21 -20
- package/build/components/block-list/block-list-item.native.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +8 -9
- package/build/components/block-list/block-outline.native.js.map +1 -1
- package/build/components/block-list/block-selection-button.native.js +10 -12
- package/build/components/block-list/block-selection-button.native.js.map +1 -1
- package/build/components/block-list/block.js +45 -50
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +56 -68
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/index.js +18 -18
- package/build/components/block-list/index.js.map +1 -1
- package/build/components/block-list/index.native.js +80 -90
- package/build/components/block-list/index.native.js.map +1 -1
- package/build/components/block-list/insertion-point.native.js +4 -5
- package/build/components/block-list/insertion-point.native.js.map +1 -1
- package/build/components/block-list/layout.js +6 -9
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/block-list/subdirectory-icon.js +11 -17
- package/build/components/block-list/subdirectory-icon.js.map +1 -1
- package/build/components/block-list/use-block-props/index.js +15 -11
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/index.native.js +1 -2
- package/build/components/block-list/use-block-props/index.native.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
- package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
- package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
- package/build/components/block-list/use-in-between-inserter.js +2 -6
- package/build/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build/components/block-list-appender/index.js +36 -33
- package/build/components/block-list-appender/index.js.map +1 -1
- package/build/components/block-list-appender/index.native.js +9 -11
- package/build/components/block-list-appender/index.native.js.map +1 -1
- package/build/components/block-lock/menu-item.js +3 -4
- package/build/components/block-lock/menu-item.js.map +1 -1
- package/build/components/block-lock/modal.js +6 -9
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/block-lock/toolbar.js +4 -10
- package/build/components/block-lock/toolbar.js.map +1 -1
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js +50 -68
- package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build/components/block-mobile-toolbar/index.native.js +26 -34
- package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build/components/block-mover/button.js +18 -19
- package/build/components/block-mover/button.js.map +1 -1
- package/build/components/block-mover/index.js +16 -18
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-mover/index.native.js +23 -46
- package/build/components/block-mover/index.native.js.map +1 -1
- package/build/components/block-mover/mover-description.native.js +7 -10
- package/build/components/block-mover/mover-description.native.js.map +1 -1
- package/build/components/block-navigation/dropdown.js +22 -29
- package/build/components/block-navigation/dropdown.js.map +1 -1
- package/build/components/block-parent-selector/index.js +6 -7
- package/build/components/block-parent-selector/index.js.map +1 -1
- package/build/components/block-pattern-setup/index.js +33 -39
- package/build/components/block-pattern-setup/index.js.map +1 -1
- package/build/components/block-pattern-setup/setup-toolbar.js +35 -42
- package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build/components/block-patterns-list/index.js +76 -85
- package/build/components/block-patterns-list/index.js.map +1 -1
- package/build/components/block-popover/drop-zone.js +4 -5
- package/build/components/block-popover/drop-zone.js.map +1 -1
- package/build/components/block-popover/inbetween.js +14 -21
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +18 -21
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-preview/auto.js +8 -12
- package/build/components/block-preview/auto.js.map +1 -1
- package/build/components/block-preview/index.js +21 -24
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-quick-navigation/index.js +83 -0
- package/build/components/block-quick-navigation/index.js.map +1 -0
- package/build/components/block-removal-warning-modal/index.js +90 -0
- package/build/components/block-removal-warning-modal/index.js.map +1 -0
- package/build/components/block-selection-clearer/index.js +4 -7
- package/build/components/block-selection-clearer/index.js.map +1 -1
- package/build/components/block-settings/button.native.js +10 -12
- package/build/components/block-settings/button.native.js.map +1 -1
- package/build/components/block-settings/container.native.js +6 -6
- package/build/components/block-settings/container.native.js.map +1 -1
- package/build/components/block-settings-menu/block-convert-button.js +5 -7
- package/build/components/block-settings-menu/block-convert-button.js.map +1 -1
- package/build/components/block-settings-menu/block-html-convert-button.js +10 -14
- package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
- package/build/components/block-settings-menu/block-mode-toggle.js +19 -25
- package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build/components/block-settings-menu/block-settings-dropdown.js +136 -116
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-settings-menu/index.js +8 -10
- package/build/components/block-settings-menu/index.js.map +1 -1
- package/build/components/block-settings-menu-controls/index.js +18 -21
- package/build/components/block-settings-menu-controls/index.js.map +1 -1
- package/build/components/block-styles/index.js +6 -7
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-styles/index.native.js +5 -7
- package/build/components/block-styles/index.native.js.map +1 -1
- package/build/components/block-styles/menu-items.js +4 -5
- package/build/components/block-styles/menu-items.js.map +1 -1
- package/build/components/block-styles/preview-panel.js +7 -10
- package/build/components/block-styles/preview-panel.js.map +1 -1
- package/build/components/block-styles/preview.native.js +6 -7
- package/build/components/block-styles/preview.native.js.map +1 -1
- package/build/components/block-styles/use-styles-for-block.js +7 -9
- package/build/components/block-styles/use-styles-for-block.js.map +1 -1
- package/build/components/block-styles/utils.js +4 -7
- package/build/components/block-styles/utils.js.map +1 -1
- package/build/components/block-switcher/block-styles-menu.js +4 -5
- package/build/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.js +24 -29
- package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/block-transformations-menu.native.js +9 -10
- package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build/components/block-switcher/block-variation-transformations.js +21 -30
- package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build/components/block-switcher/index.js +48 -62
- package/build/components/block-switcher/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +24 -30
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-switcher/preview-block-popover.js +3 -4
- package/build/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build/components/block-switcher/utils.js +2 -3
- package/build/components/block-switcher/utils.js.map +1 -1
- package/build/components/block-title/index.js +5 -6
- package/build/components/block-title/index.js.map +1 -1
- package/build/components/block-title/use-block-display-title.js +5 -6
- package/build/components/block-title/use-block-display-title.js.map +1 -1
- package/build/components/block-toolbar/index.js +8 -10
- package/build/components/block-toolbar/index.js.map +1 -1
- package/build/components/block-toolbar/utils.js +14 -16
- package/build/components/block-toolbar/utils.js.map +1 -1
- package/build/components/block-tools/back-compat.js +3 -4
- package/build/components/block-tools/back-compat.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +9 -11
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +10 -14
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +19 -13
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/insertion-point.js +12 -15
- package/build/components/block-tools/insertion-point.js.map +1 -1
- package/build/components/block-tools/selected-block-popover.js +27 -28
- package/build/components/block-tools/selected-block-popover.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +9 -14
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +3 -4
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-types-list/index.js +8 -9
- package/build/components/block-types-list/index.js.map +1 -1
- package/build/components/block-types-list/index.native.js +26 -33
- package/build/components/block-types-list/index.native.js.map +1 -1
- package/build/components/block-variation-picker/index.js +8 -9
- package/build/components/block-variation-picker/index.js.map +1 -1
- package/build/components/block-variation-picker/index.native.js +7 -9
- package/build/components/block-variation-picker/index.native.js.map +1 -1
- package/build/components/block-variation-transforms/index.js +30 -41
- package/build/components/block-variation-transforms/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/index.js +4 -6
- package/build/components/block-vertical-alignment-control/index.js.map +1 -1
- package/build/components/block-vertical-alignment-control/ui.js +12 -21
- package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build/components/border-radius-control/all-input-control.js +9 -14
- package/build/components/border-radius-control/all-input-control.js.map +1 -1
- package/build/components/border-radius-control/index.js +9 -10
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/input-controls.js +10 -17
- package/build/components/border-radius-control/input-controls.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +6 -11
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/border-radius-control/utils.js +3 -7
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/button-block-appender/index.js +13 -15
- package/build/components/button-block-appender/index.js.map +1 -1
- package/build/components/button-block-appender/index.native.js +25 -29
- package/build/components/button-block-appender/index.native.js.map +1 -1
- package/build/components/caption/index.native.js +40 -43
- package/build/components/caption/index.native.js.map +1 -1
- package/build/components/child-layout-control/index.js +5 -6
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/color-palette/control.js +7 -10
- package/build/components/color-palette/control.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +3 -11
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/color-style-selector/index.js +28 -35
- package/build/components/color-style-selector/index.js.map +1 -1
- package/build/components/colors/utils.js +12 -11
- package/build/components/colors/utils.js.map +1 -1
- package/build/components/colors/with-colors.js +20 -40
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +26 -27
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/dropdown.js +44 -50
- package/build/components/colors-gradients/dropdown.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.js +27 -30
- package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js +27 -31
- package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build/components/contrast-checker/index.js +12 -13
- package/build/components/contrast-checker/index.js.map +1 -1
- package/build/components/contrast-checker/index.native.js +16 -18
- package/build/components/contrast-checker/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.js +9 -10
- package/build/components/convert-to-group-buttons/index.js.map +1 -1
- package/build/components/convert-to-group-buttons/index.native.js +6 -7
- package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
- package/build/components/convert-to-group-buttons/toolbar.js +6 -12
- package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +4 -6
- package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build/components/copy-handler/index.js +9 -13
- package/build/components/copy-handler/index.js.map +1 -1
- package/build/components/date-format-picker/index.js +12 -16
- package/build/components/date-format-picker/index.js.map +1 -1
- package/build/components/default-block-appender/index.js +7 -9
- package/build/components/default-block-appender/index.js.map +1 -1
- package/build/components/default-block-appender/index.native.js +8 -10
- package/build/components/default-block-appender/index.native.js.map +1 -1
- package/build/components/default-style-picker/index.js +14 -22
- package/build/components/default-style-picker/index.js.map +1 -1
- package/build/components/duotone/components.js +14 -18
- package/build/components/duotone/components.js.map +1 -1
- package/build/components/duotone/utils.js +1 -2
- package/build/components/duotone/utils.js.map +1 -1
- package/build/components/duotone-control/index.js +13 -17
- package/build/components/duotone-control/index.js.map +1 -1
- package/build/components/editable-text/index.js +11 -13
- package/build/components/editable-text/index.js.map +1 -1
- package/build/components/editor-styles/index.js +4 -5
- package/build/components/editor-styles/index.js.map +1 -1
- package/build/components/floating-toolbar/index.native.js +7 -8
- package/build/components/floating-toolbar/index.native.js.map +1 -1
- package/build/components/font-appearance-control/index.js +21 -32
- package/build/components/font-appearance-control/index.js.map +1 -1
- package/build/components/font-family/index.js +14 -17
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/fluid-utils.js +17 -21
- package/build/components/font-sizes/fluid-utils.js.map +1 -1
- package/build/components/font-sizes/font-size-picker.js +2 -4
- package/build/components/font-sizes/font-size-picker.js.map +1 -1
- package/build/components/font-sizes/utils.js +9 -15
- package/build/components/font-sizes/utils.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +18 -37
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/advanced-panel.js +7 -10
- package/build/components/global-styles/advanced-panel.js.map +1 -1
- package/build/components/global-styles/border-panel.js +45 -78
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.js +119 -163
- package/build/components/global-styles/color-panel.js.map +1 -1
- package/build/components/global-styles/color-panel.native.js +25 -42
- package/build/components/global-styles/color-panel.native.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +78 -109
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/effects-panel.js +60 -73
- package/build/components/global-styles/effects-panel.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +55 -72
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/get-block-css-selector.js +4 -7
- package/build/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build/components/global-styles/hooks.js +22 -37
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +6 -0
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +69 -125
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-utils.js +49 -26
- package/build/components/global-styles/typography-utils.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +153 -245
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +11 -27
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/gradients/use-gradient.js +6 -7
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/gradients/with-gradient.js +2 -6
- package/build/components/gradients/with-gradient.js.map +1 -1
- package/build/components/height-control/index.js +9 -10
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/iframe/index.js +53 -90
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/iframe/use-compatibility-styles.js +29 -20
- package/build/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +83 -91
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/image-editor/constants.js +1 -2
- package/build/components/image-editor/constants.js.map +1 -1
- package/build/components/image-editor/context.js +9 -10
- package/build/components/image-editor/context.js.map +1 -1
- package/build/components/image-editor/cropper.js +11 -12
- package/build/components/image-editor/cropper.js.map +1 -1
- package/build/components/image-editor/index.js +12 -13
- package/build/components/image-editor/index.js.map +1 -1
- package/build/components/image-editor/use-save-image.js +11 -12
- package/build/components/image-editor/use-save-image.js.map +1 -1
- package/build/components/image-editor/use-transform-image.js +5 -6
- package/build/components/image-editor/use-transform-image.js.map +1 -1
- package/build/components/image-editor/zoom-dropdown.js +10 -13
- package/build/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build/components/image-size-control/index.js +12 -13
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/index.js +9 -9
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +9 -0
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/button-block-appender.js +7 -8
- package/build/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build/components/inner-blocks/default-block-appender.js +6 -8
- package/build/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build/components/inner-blocks/index.js +11 -14
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/inner-blocks/index.native.js +9 -10
- package/build/components/inner-blocks/index.native.js.map +1 -1
- package/build/components/inner-blocks/use-block-context.js +1 -4
- package/build/components/inner-blocks/use-block-context.js.map +1 -1
- package/build/components/inner-blocks/use-nested-settings-update.js +24 -32
- package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build/components/inner-blocks/with-client-id.js +2 -6
- package/build/components/inner-blocks/with-client-id.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/explorer.js +11 -12
- package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
- package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
- package/build/components/inserter/block-patterns-explorer/sidebar.js +20 -24
- package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build/components/inserter/block-patterns-tab.js +62 -45
- package/build/components/inserter/block-patterns-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.js +7 -9
- package/build/components/inserter/block-types-tab.js.map +1 -1
- package/build/components/inserter/block-types-tab.native.js +8 -9
- package/build/components/inserter/block-types-tab.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
- package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build/components/inserter/hooks/use-block-types-state.js +9 -9
- package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build/components/inserter/hooks/use-clipboard-block.native.js +2 -2
- package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
- package/build/components/inserter/hooks/use-debounced-input.js +1 -2
- package/build/components/inserter/hooks/use-debounced-input.js.map +1 -1
- package/build/components/inserter/hooks/use-insertion-point.js +11 -13
- package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build/components/inserter/index.js +45 -59
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/index.native.js +28 -36
- package/build/components/inserter/index.native.js.map +1 -1
- package/build/components/inserter/library.js +12 -13
- package/build/components/inserter/library.js.map +1 -1
- package/build/components/inserter/media-tab/hooks.js +2 -5
- package/build/components/inserter/media-tab/hooks.js.map +1 -1
- package/build/components/inserter/media-tab/media-list.js +8 -13
- package/build/components/inserter/media-tab/media-list.js.map +1 -1
- package/build/components/inserter/media-tab/media-panel.js +12 -14
- package/build/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build/components/inserter/media-tab/media-preview.js +47 -60
- package/build/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build/components/inserter/media-tab/media-tab.js +25 -29
- package/build/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build/components/inserter/media-tab/utils.js +3 -5
- package/build/components/inserter/media-tab/utils.js.map +1 -1
- package/build/components/inserter/menu.js +15 -19
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/inserter/menu.native.js +27 -31
- package/build/components/inserter/menu.native.js.map +1 -1
- package/build/components/inserter/mobile-tab-navigation.js +7 -9
- package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build/components/inserter/panel.js +5 -6
- package/build/components/inserter/panel.js.map +1 -1
- package/build/components/inserter/preview-panel.js +4 -5
- package/build/components/inserter/preview-panel.js.map +1 -1
- package/build/components/inserter/quick-inserter.js +8 -9
- package/build/components/inserter/quick-inserter.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.js +16 -21
- package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build/components/inserter/reusable-blocks-tab.native.js +5 -6
- package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build/components/inserter/search-items.js +12 -40
- package/build/components/inserter/search-items.js.map +1 -1
- package/build/components/inserter/search-results.js +17 -18
- package/build/components/inserter/search-results.js.map +1 -1
- package/build/components/inserter/search-results.native.js +11 -12
- package/build/components/inserter/search-results.native.js.map +1 -1
- package/build/components/inserter/tabs.js +11 -12
- package/build/components/inserter/tabs.js.map +1 -1
- package/build/components/inserter/tabs.native.js +37 -55
- package/build/components/inserter/tabs.native.js.map +1 -1
- package/build/components/inserter/utils.native.js +13 -17
- package/build/components/inserter/utils.native.js.map +1 -1
- package/build/components/inserter-draggable-blocks/index.js +11 -13
- package/build/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build/components/inserter-list-item/index.js +69 -74
- package/build/components/inserter-list-item/index.js.map +1 -1
- package/build/components/inserter-listbox/group.js +4 -7
- package/build/components/inserter-listbox/group.js.map +1 -1
- package/build/components/inserter-listbox/index.js +3 -4
- package/build/components/inserter-listbox/index.js.map +1 -1
- package/build/components/inserter-listbox/item.js +14 -14
- package/build/components/inserter-listbox/item.js.map +1 -1
- package/build/components/inserter-listbox/row.js +4 -5
- package/build/components/inserter-listbox/row.js.map +1 -1
- package/build/components/inspector-controls/block-support-slot-container.js +6 -11
- package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build/components/inspector-controls/block-support-tools-panel.js +6 -8
- package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build/components/inspector-controls/fill.js +13 -24
- package/build/components/inspector-controls/fill.js.map +1 -1
- package/build/components/inspector-controls/fill.native.js +9 -12
- package/build/components/inspector-controls/fill.native.js.map +1 -1
- package/build/components/inspector-controls/index.js +4 -6
- package/build/components/inspector-controls/index.js.map +1 -1
- package/build/components/inspector-controls/slot.js +13 -19
- package/build/components/inspector-controls/slot.js.map +1 -1
- package/build/components/inspector-controls/slot.native.js +8 -11
- package/build/components/inspector-controls/slot.native.js.map +1 -1
- package/build/components/inspector-controls-tabs/index.js +6 -7
- package/build/components/inspector-controls-tabs/index.js.map +1 -1
- package/build/components/inspector-controls-tabs/position-controls-panel.js +3 -8
- package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
- package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
- package/build/components/inspector-controls-tabs/settings-tab.js +3 -6
- package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/styles-tab.js +5 -6
- package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
- package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build/components/inspector-popover-header/index.js +18 -22
- package/build/components/inspector-popover-header/index.js.map +1 -1
- package/build/components/justify-content-control/index.js +4 -6
- package/build/components/justify-content-control/index.js.map +1 -1
- package/build/components/justify-content-control/ui.js +12 -17
- package/build/components/justify-content-control/ui.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +8 -11
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/line-height-control/index.js +15 -22
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/line-height-control/index.native.js +4 -5
- package/build/components/line-height-control/index.native.js.map +1 -1
- package/build/components/link-control/index.js +86 -71
- package/build/components/link-control/index.js.map +1 -1
- package/build/components/link-control/is-url-like.js +32 -2
- package/build/components/link-control/is-url-like.js.map +1 -1
- package/build/components/link-control/link-preview.js +24 -27
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-create-button.js +9 -13
- package/build/components/link-control/search-create-button.js.map +1 -1
- package/build/components/link-control/search-input.js +24 -27
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/link-control/search-item.js +15 -19
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +23 -31
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/settings-drawer.js +6 -35
- package/build/components/link-control/settings-drawer.js.map +1 -1
- package/build/components/link-control/settings.js +6 -8
- package/build/components/link-control/settings.js.map +1 -1
- package/build/components/link-control/use-internal-value.js +54 -0
- package/build/components/link-control/use-internal-value.js.map +1 -0
- package/build/components/link-control/use-rich-url-data.js +1 -1
- package/build/components/link-control/use-rich-url-data.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +10 -23
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/appender.js +15 -17
- package/build/components/list-view/appender.js.map +1 -1
- package/build/components/list-view/aria-referenced-text.js +40 -0
- package/build/components/list-view/aria-referenced-text.js.map +1 -0
- package/build/components/list-view/block-contents.js +39 -40
- package/build/components/list-view/block-contents.js.map +1 -1
- package/build/components/list-view/block-select-button.js +79 -22
- package/build/components/list-view/block-select-button.js.map +1 -1
- package/build/components/list-view/block.js +119 -101
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/branch.js +14 -13
- package/build/components/list-view/branch.js.map +1 -1
- package/build/components/list-view/drop-indicator.js +66 -16
- package/build/components/list-view/drop-indicator.js.map +1 -1
- package/build/components/list-view/expander.js +3 -4
- package/build/components/list-view/expander.js.map +1 -1
- package/build/components/list-view/index.js +50 -49
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/list-view/leaf.js +14 -16
- package/build/components/list-view/leaf.js.map +1 -1
- package/build/components/list-view/use-block-selection.js +4 -6
- package/build/components/list-view/use-block-selection.js.map +1 -1
- package/build/components/list-view/use-list-view-client-ids.js +6 -29
- package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build/components/list-view/use-list-view-drop-zone.js +63 -39
- package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build/components/list-view/use-list-view-expand-selected-item.js +4 -5
- package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build/components/list-view/use-list-view-scroll-into-view.js +5 -6
- package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
- package/build/components/media-placeholder/index.js +106 -102
- package/build/components/media-placeholder/index.js.map +1 -1
- package/build/components/media-placeholder/index.native.js +5 -6
- package/build/components/media-placeholder/index.native.js.map +1 -1
- package/build/components/media-replace-flow/index.js +92 -107
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/media-upload/check.js +4 -5
- package/build/components/media-upload/check.js.map +1 -1
- package/build/components/media-upload/index.native.js +1 -1
- package/build/components/media-upload/index.native.js.map +1 -1
- package/build/components/multi-selection-inspector/index.js +3 -4
- package/build/components/multi-selection-inspector/index.js.map +1 -1
- package/build/components/navigable-toolbar/index.js +24 -23
- package/build/components/navigable-toolbar/index.js.map +1 -1
- package/build/components/observe-typing/index.js +3 -4
- package/build/components/observe-typing/index.js.map +1 -1
- package/build/components/panel-color-settings/index.js +8 -10
- package/build/components/panel-color-settings/index.js.map +1 -1
- package/build/components/plain-text/index.js +12 -14
- package/build/components/plain-text/index.js.map +1 -1
- package/build/components/plain-text/index.native.js +15 -20
- package/build/components/plain-text/index.native.js.map +1 -1
- package/build/components/preview-options/index.js +12 -12
- package/build/components/preview-options/index.js.map +1 -1
- package/build/components/provider/block-refs-provider.js +3 -4
- package/build/components/provider/block-refs-provider.js.map +1 -1
- package/build/components/provider/index.js +2 -4
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +7 -8
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/provider/with-registry-provider.js +13 -17
- package/build/components/provider/with-registry-provider.js.map +1 -1
- package/build/components/publish-date-time-picker/index.js +10 -12
- package/build/components/publish-date-time-picker/index.js.map +1 -1
- package/build/components/recursion-provider/index.js +7 -11
- package/build/components/recursion-provider/index.js.map +1 -1
- package/build/components/resizable-box-popover/index.js +10 -11
- package/build/components/resizable-box-popover/index.js.map +1 -1
- package/build/components/responsive-block-control/label.js +5 -6
- package/build/components/responsive-block-control/label.js.map +1 -1
- package/build/components/rich-text/content.js +99 -0
- package/build/components/rich-text/content.js.map +1 -0
- package/build/components/rich-text/embed-handler-picker.native.js +6 -10
- package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build/components/rich-text/format-edit.js +7 -8
- package/build/components/rich-text/format-edit.js.map +1 -1
- package/build/components/rich-text/format-toolbar/index.js +10 -20
- package/build/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build/components/rich-text/format-toolbar-container.js +13 -16
- package/build/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build/components/rich-text/index.js +45 -83
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +128 -183
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/input-event.js +4 -5
- package/build/components/rich-text/input-event.js.map +1 -1
- package/build/components/rich-text/shortcut.js +5 -6
- package/build/components/rich-text/shortcut.js.map +1 -1
- package/build/components/rich-text/split-value.js +8 -10
- package/build/components/rich-text/split-value.js.map +1 -1
- package/build/components/rich-text/toolbar-button.js +8 -13
- package/build/components/rich-text/toolbar-button.js.map +1 -1
- package/build/components/rich-text/use-before-input-rules.js +1 -4
- package/build/components/rich-text/use-before-input-rules.js.map +1 -1
- package/build/components/rich-text/use-enter.js +3 -6
- package/build/components/rich-text/use-enter.js.map +1 -1
- package/build/components/rich-text/use-firefox-compat.js +32 -1
- package/build/components/rich-text/use-firefox-compat.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +11 -17
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/rich-text/use-input-rules.js +9 -15
- package/build/components/rich-text/use-input-rules.js.map +1 -1
- package/build/components/rich-text/use-mark-persistent.js +4 -5
- package/build/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +5 -7
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/rich-text/utils.js +5 -7
- package/build/components/rich-text/utils.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +3 -4
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +38 -0
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
- package/build/components/spacing-sizes-control/index.js +62 -64
- package/build/components/spacing-sizes-control/index.js.map +1 -1
- package/build/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
- package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
- package/build/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +22 -22
- package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
- package/build/components/spacing-sizes-control/input-controls/single.js +51 -0
- package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -0
- package/build/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +51 -69
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
- package/build/components/spacing-sizes-control/sides-dropdown/index.js +84 -0
- package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
- package/build/components/spacing-sizes-control/utils.js +213 -31
- package/build/components/spacing-sizes-control/utils.js.map +1 -1
- package/build/components/text-decoration-control/index.js +5 -6
- package/build/components/text-decoration-control/index.js.map +1 -1
- package/build/components/text-transform-control/index.js +5 -6
- package/build/components/text-transform-control/index.js.map +1 -1
- package/build/components/tool-selector/index.js +13 -20
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/typewriter/index.js +6 -9
- package/build/components/typewriter/index.js.map +1 -1
- package/build/components/ungroup-button/index.native.js +11 -16
- package/build/components/ungroup-button/index.native.js.map +1 -1
- package/build/components/unit-control/index.js +8 -10
- package/build/components/unit-control/index.js.map +1 -1
- package/build/components/url-input/index.js +23 -34
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-input/index.native.js +10 -15
- package/build/components/url-input/index.native.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +33 -29
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/components/url-popover/index.js +16 -19
- package/build/components/url-popover/index.js.map +1 -1
- package/build/components/url-popover/link-editor.js +10 -12
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/url-popover/link-viewer-url.js +5 -6
- package/build/components/url-popover/link-viewer-url.js.map +1 -1
- package/build/components/url-popover/link-viewer.js +11 -13
- package/build/components/url-popover/link-viewer.js.map +1 -1
- package/build/components/use-block-display-information/index.js +30 -2
- package/build/components/use-block-display-information/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +16 -23
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-block-drop-zone/index.native.js +8 -11
- package/build/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build/components/use-moving-animation/index.js +9 -12
- package/build/components/use-moving-animation/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +2 -6
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.native.js +8 -10
- package/build/components/use-on-block-drop/index.native.js.map +1 -1
- package/build/components/use-paste-styles/index.js +2 -6
- package/build/components/use-paste-styles/index.js.map +1 -1
- package/build/components/video-player/index.native.js +2 -4
- package/build/components/video-player/index.native.js.map +1 -1
- package/build/components/warning/index.js +6 -7
- package/build/components/warning/index.js.map +1 -1
- package/build/components/warning/index.native.js +13 -15
- package/build/components/warning/index.native.js.map +1 -1
- package/build/components/writing-flow/index.js +6 -9
- package/build/components/writing-flow/index.js.map +1 -1
- package/build/components/writing-flow/use-drag-selection.js +5 -7
- package/build/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build/components/writing-flow/use-tab-nav.js +41 -10
- package/build/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build/hooks/align.js +15 -22
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +9 -4
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/aria-label.js +1 -3
- package/build/hooks/aria-label.js.map +1 -1
- package/build/hooks/behaviors.js +131 -60
- package/build/hooks/behaviors.js.map +1 -1
- package/build/hooks/border.js +29 -43
- package/build/hooks/border.js.map +1 -1
- package/build/hooks/color.js +26 -42
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/content-lock-ui.js +33 -39
- package/build/hooks/content-lock-ui.js.map +1 -1
- package/build/hooks/contrast-checker.js +4 -7
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/custom-class-name.js +8 -5
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/dimensions.js +11 -14
- package/build/hooks/dimensions.js.map +1 -1
- package/build/hooks/duotone.js +37 -49
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-family.js +6 -11
- package/build/hooks/font-family.js.map +1 -1
- package/build/hooks/font-size.js +22 -27
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/gap.js +5 -6
- package/build/hooks/gap.js.map +1 -1
- package/build/hooks/layout.js +66 -81
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js +5 -8
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/lock.js +2 -2
- package/build/hooks/lock.js.map +1 -1
- package/build/hooks/margin.js +6 -9
- package/build/hooks/margin.js.map +1 -1
- package/build/hooks/metadata-name.js +4 -5
- package/build/hooks/metadata-name.js.map +1 -1
- package/build/hooks/metadata.js +3 -7
- package/build/hooks/metadata.js.map +1 -1
- package/build/hooks/padding.js +6 -9
- package/build/hooks/padding.js.map +1 -1
- package/build/hooks/position.js +50 -56
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/settings.js +1 -3
- package/build/hooks/settings.js.map +1 -1
- package/build/hooks/style.js +19 -23
- package/build/hooks/style.js.map +1 -1
- package/build/hooks/supports.js +4 -6
- package/build/hooks/supports.js.map +1 -1
- package/build/hooks/typography.js +18 -27
- package/build/hooks/typography.js.map +1 -1
- package/build/hooks/typography.native.js +4 -3
- package/build/hooks/typography.native.js.map +1 -1
- package/build/hooks/use-border-props.js +1 -3
- package/build/hooks/use-border-props.js.map +1 -1
- package/build/hooks/use-color-props.js +6 -8
- package/build/hooks/use-color-props.js.map +1 -1
- package/build/hooks/use-editor-wrapper-styles.native.js +34 -39
- package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -1
- package/build/hooks/use-spacing-props.js +1 -1
- package/build/hooks/use-spacing-props.js.map +1 -1
- package/build/hooks/use-typography-props.js +12 -23
- package/build/hooks/use-typography-props.js.map +1 -1
- package/build/hooks/utils.js +6 -18
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +0 -14
- package/build/index.js.map +1 -1
- package/build/layouts/constrained.js +24 -27
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/definitions.js +154 -0
- package/build/layouts/definitions.js.map +1 -0
- package/build/layouts/flex.js +50 -58
- package/build/layouts/flex.js.map +1 -1
- package/build/layouts/flow.js +12 -13
- package/build/layouts/flow.js.map +1 -1
- package/build/layouts/grid.js +47 -25
- package/build/layouts/grid.js.map +1 -1
- package/build/layouts/index.js +1 -2
- package/build/layouts/index.js.map +1 -1
- package/build/layouts/utils.js +11 -11
- package/build/layouts/utils.js.map +1 -1
- package/build/private-apis.js +17 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +226 -369
- package/build/store/actions.js.map +1 -1
- package/build/store/array.js +1 -2
- package/build/store/array.js.map +1 -1
- package/build/store/private-actions.js +203 -7
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +109 -24
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +119 -170
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +161 -231
- package/build/store/selectors.js.map +1 -1
- package/build/utils/block-variation-transforms.js +4 -7
- package/build/utils/block-variation-transforms.js.map +1 -1
- package/build/utils/math.js +1 -2
- package/build/utils/math.js.map +1 -1
- package/build/utils/object.js +40 -4
- package/build/utils/object.js.map +1 -1
- package/build/utils/order-inserter-block-items.js +5 -7
- package/build/utils/order-inserter-block-items.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +3 -6
- package/build/utils/parse-css-unit-to-px.js.map +1 -1
- package/build/utils/pasting.js +5 -8
- package/build/utils/pasting.js.map +1 -1
- package/build/utils/pre-parse-patterns.js +1 -1
- package/build/utils/pre-parse-patterns.js.map +1 -1
- package/build/utils/sorting.js +1 -2
- package/build/utils/sorting.js.map +1 -1
- package/build/utils/transform-styles/index.js +5 -7
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build/utils/transform-styles/transforms/wrap.js +28 -31
- package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-module/autocompleters/block.js +6 -6
- package/build-module/autocompleters/block.js.map +1 -1
- package/build-module/components/alignment-control/index.js +4 -5
- package/build-module/components/alignment-control/index.js.map +1 -1
- package/build-module/components/alignment-control/ui.js +14 -17
- package/build-module/components/alignment-control/ui.js.map +1 -1
- package/build-module/components/autocomplete/index.js +5 -7
- package/build-module/components/autocomplete/index.js.map +1 -1
- package/build-module/components/block-actions/index.js +12 -12
- package/build-module/components/block-actions/index.js.map +1 -1
- package/build-module/components/block-alignment-control/constants.js +0 -3
- package/build-module/components/block-alignment-control/constants.js.map +1 -1
- package/build-module/components/block-alignment-control/index.js +4 -5
- package/build-module/components/block-alignment-control/index.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.js +21 -25
- package/build-module/components/block-alignment-control/ui.js.map +1 -1
- package/build-module/components/block-alignment-control/ui.native.js +17 -19
- package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +5 -10
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-alignment-matrix-control/index.js +4 -7
- package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +5 -7
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-caption/index.native.js +29 -34
- package/build-module/components/block-caption/index.native.js.map +1 -1
- package/build-module/components/block-card/index.js +7 -9
- package/build-module/components/block-card/index.js.map +1 -1
- package/build-module/components/block-compare/block-view.js +8 -9
- package/build-module/components/block-compare/block-view.js.map +1 -1
- package/build-module/components/block-compare/index.js +7 -9
- package/build-module/components/block-compare/index.js.map +1 -1
- package/build-module/components/block-context/index.js +4 -5
- package/build-module/components/block-context/index.js.map +1 -1
- package/build-module/components/block-controls/fill.js +18 -23
- package/build-module/components/block-controls/fill.js.map +1 -1
- package/build-module/components/block-controls/hook.js +1 -3
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-controls/index.js +8 -7
- package/build-module/components/block-controls/index.js.map +1 -1
- package/build-module/components/block-controls/slot.js +29 -22
- package/build-module/components/block-controls/slot.js.map +1 -1
- package/build-module/components/block-controls/slot.native.js +10 -18
- package/build-module/components/block-controls/slot.native.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.js +5 -7
- package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
- package/build-module/components/block-draggable/draggable-chip.native.js +3 -4
- package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
- package/build-module/components/block-draggable/dropping-insertion-point.native.js +6 -7
- package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
- package/build-module/components/block-draggable/index.js +16 -17
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-draggable/index.native.js +43 -58
- package/build-module/components/block-draggable/index.native.js.map +1 -1
- package/build-module/components/block-edit/edit.js +5 -9
- package/build-module/components/block-edit/edit.js.map +1 -1
- package/build-module/components/block-edit/edit.native.js +3 -7
- package/build-module/components/block-edit/edit.native.js.map +1 -1
- package/build-module/components/block-edit/index.js +3 -2
- package/build-module/components/block-edit/index.js.map +1 -1
- package/build-module/components/block-edit-visually-button/index.js +3 -4
- package/build-module/components/block-edit-visually-button/index.js.map +1 -1
- package/build-module/components/block-full-height-alignment-control/index.js +6 -7
- package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +39 -0
- package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
- package/build-module/components/block-heading-level-dropdown/index.js +71 -0
- package/build-module/components/block-heading-level-dropdown/index.js.map +1 -0
- package/build-module/components/block-heading-level-dropdown/index.native.js +60 -0
- package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -0
- package/build-module/components/block-icon/index.js +7 -11
- package/build-module/components/block-icon/index.js.map +1 -1
- package/build-module/components/block-icon/index.native.js +15 -19
- package/build-module/components/block-icon/index.native.js.map +1 -1
- package/build-module/components/block-info-slot-fill/index.js +4 -2
- package/build-module/components/block-info-slot-fill/index.js.map +1 -1
- package/build-module/components/block-inspector/index.js +45 -123
- package/build-module/components/block-inspector/index.js.map +1 -1
- package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
- package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
- package/build-module/components/block-list/block-html.js +3 -4
- package/build-module/components/block-list/block-html.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.js +3 -4
- package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js +10 -15
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-list/block-list-context.native.js +5 -11
- package/build-module/components/block-list/block-list-context.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item-cell.native.js +5 -6
- package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
- package/build-module/components/block-list/block-list-item.native.js +21 -20
- package/build-module/components/block-list/block-list-item.native.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +8 -9
- package/build-module/components/block-list/block-outline.native.js.map +1 -1
- package/build-module/components/block-list/block-selection-button.native.js +10 -12
- package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
- package/build-module/components/block-list/block.js +45 -50
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +56 -68
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/index.js +18 -18
- package/build-module/components/block-list/index.js.map +1 -1
- package/build-module/components/block-list/index.native.js +80 -89
- package/build-module/components/block-list/index.native.js.map +1 -1
- package/build-module/components/block-list/insertion-point.native.js +4 -5
- package/build-module/components/block-list/insertion-point.native.js.map +1 -1
- package/build-module/components/block-list/layout.js +6 -9
- package/build-module/components/block-list/layout.js.map +1 -1
- package/build-module/components/block-list/subdirectory-icon.js +11 -14
- package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.js +14 -11
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/index.native.js +1 -2
- package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
- package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
- package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
- package/build-module/components/block-list/use-in-between-inserter.js +2 -6
- package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
- package/build-module/components/block-list-appender/index.js +35 -33
- package/build-module/components/block-list-appender/index.js.map +1 -1
- package/build-module/components/block-list-appender/index.native.js +9 -11
- package/build-module/components/block-list-appender/index.native.js.map +1 -1
- package/build-module/components/block-lock/menu-item.js +3 -4
- package/build-module/components/block-lock/menu-item.js.map +1 -1
- package/build-module/components/block-lock/modal.js +6 -9
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/block-lock/toolbar.js +5 -10
- package/build-module/components/block-lock/toolbar.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +50 -68
- package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
- package/build-module/components/block-mobile-toolbar/index.native.js +26 -34
- package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
- package/build-module/components/block-mover/button.js +18 -18
- package/build-module/components/block-mover/button.js.map +1 -1
- package/build-module/components/block-mover/index.js +16 -17
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-mover/index.native.js +23 -46
- package/build-module/components/block-mover/index.native.js.map +1 -1
- package/build-module/components/block-mover/mover-description.native.js +7 -10
- package/build-module/components/block-mover/mover-description.native.js.map +1 -1
- package/build-module/components/block-navigation/dropdown.js +22 -28
- package/build-module/components/block-navigation/dropdown.js.map +1 -1
- package/build-module/components/block-parent-selector/index.js +6 -6
- package/build-module/components/block-parent-selector/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/index.js +33 -38
- package/build-module/components/block-pattern-setup/index.js.map +1 -1
- package/build-module/components/block-pattern-setup/setup-toolbar.js +35 -42
- package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
- package/build-module/components/block-patterns-list/index.js +73 -81
- package/build-module/components/block-patterns-list/index.js.map +1 -1
- package/build-module/components/block-popover/drop-zone.js +4 -5
- package/build-module/components/block-popover/drop-zone.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +14 -20
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +18 -20
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-preview/auto.js +8 -11
- package/build-module/components/block-preview/auto.js.map +1 -1
- package/build-module/components/block-preview/index.js +21 -24
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-quick-navigation/index.js +69 -0
- package/build-module/components/block-quick-navigation/index.js.map +1 -0
- package/build-module/components/block-removal-warning-modal/index.js +76 -0
- package/build-module/components/block-removal-warning-modal/index.js.map +1 -0
- package/build-module/components/block-selection-clearer/index.js +4 -4
- package/build-module/components/block-selection-clearer/index.js.map +1 -1
- package/build-module/components/block-settings/button.native.js +9 -11
- package/build-module/components/block-settings/button.native.js.map +1 -1
- package/build-module/components/block-settings/container.native.js +6 -5
- package/build-module/components/block-settings/container.native.js.map +1 -1
- package/build-module/components/block-settings-menu/block-convert-button.js +5 -7
- package/build-module/components/block-settings-menu/block-convert-button.js.map +1 -1
- package/build-module/components/block-settings-menu/block-html-convert-button.js +10 -14
- package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
- package/build-module/components/block-settings-menu/block-mode-toggle.js +19 -25
- package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +139 -117
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-settings-menu/index.js +8 -9
- package/build-module/components/block-settings-menu/index.js.map +1 -1
- package/build-module/components/block-settings-menu-controls/index.js +18 -20
- package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +6 -7
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-styles/index.native.js +5 -7
- package/build-module/components/block-styles/index.native.js.map +1 -1
- package/build-module/components/block-styles/menu-items.js +4 -5
- package/build-module/components/block-styles/menu-items.js.map +1 -1
- package/build-module/components/block-styles/preview-panel.js +7 -10
- package/build-module/components/block-styles/preview-panel.js.map +1 -1
- package/build-module/components/block-styles/preview.native.js +6 -7
- package/build-module/components/block-styles/preview.native.js.map +1 -1
- package/build-module/components/block-styles/use-styles-for-block.js +7 -9
- package/build-module/components/block-styles/use-styles-for-block.js.map +1 -1
- package/build-module/components/block-styles/utils.js +4 -7
- package/build-module/components/block-styles/utils.js.map +1 -1
- package/build-module/components/block-switcher/block-styles-menu.js +4 -5
- package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.js +24 -29
- package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/block-transformations-menu.native.js +9 -10
- package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
- package/build-module/components/block-switcher/block-variation-transformations.js +21 -30
- package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
- package/build-module/components/block-switcher/index.js +48 -62
- package/build-module/components/block-switcher/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +24 -29
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-switcher/preview-block-popover.js +3 -4
- package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
- package/build-module/components/block-switcher/utils.js +2 -3
- package/build-module/components/block-switcher/utils.js.map +1 -1
- package/build-module/components/block-title/index.js +5 -6
- package/build-module/components/block-title/index.js.map +1 -1
- package/build-module/components/block-title/use-block-display-title.js +5 -6
- package/build-module/components/block-title/use-block-display-title.js.map +1 -1
- package/build-module/components/block-toolbar/index.js +8 -9
- package/build-module/components/block-toolbar/index.js.map +1 -1
- package/build-module/components/block-toolbar/utils.js +14 -16
- package/build-module/components/block-toolbar/utils.js.map +1 -1
- package/build-module/components/block-tools/back-compat.js +3 -4
- package/build-module/components/block-tools/back-compat.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +9 -10
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +10 -13
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +19 -12
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/insertion-point.js +12 -14
- package/build-module/components/block-tools/insertion-point.js.map +1 -1
- package/build-module/components/block-tools/selected-block-popover.js +27 -27
- package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +9 -14
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +3 -4
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-types-list/index.js +8 -9
- package/build-module/components/block-types-list/index.js.map +1 -1
- package/build-module/components/block-types-list/index.native.js +26 -32
- package/build-module/components/block-types-list/index.native.js.map +1 -1
- package/build-module/components/block-variation-picker/index.js +8 -9
- package/build-module/components/block-variation-picker/index.js.map +1 -1
- package/build-module/components/block-variation-picker/index.native.js +7 -9
- package/build-module/components/block-variation-picker/index.native.js.map +1 -1
- package/build-module/components/block-variation-transforms/index.js +30 -41
- package/build-module/components/block-variation-transforms/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/index.js +4 -5
- package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
- package/build-module/components/block-vertical-alignment-control/ui.js +12 -18
- package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
- package/build-module/components/border-radius-control/all-input-control.js +9 -11
- package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +9 -10
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/input-controls.js +10 -14
- package/build-module/components/border-radius-control/input-controls.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +6 -8
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/border-radius-control/utils.js +3 -7
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/button-block-appender/index.js +13 -15
- package/build-module/components/button-block-appender/index.js.map +1 -1
- package/build-module/components/button-block-appender/index.native.js +25 -29
- package/build-module/components/button-block-appender/index.native.js.map +1 -1
- package/build-module/components/caption/index.native.js +40 -43
- package/build-module/components/caption/index.native.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +5 -6
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/color-palette/control.js +7 -9
- package/build-module/components/color-palette/control.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +3 -9
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/color-style-selector/index.js +28 -35
- package/build-module/components/color-style-selector/index.js.map +1 -1
- package/build-module/components/colors/utils.js +10 -9
- package/build-module/components/colors/utils.js.map +1 -1
- package/build-module/components/colors/with-colors.js +19 -38
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +26 -25
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/dropdown.js +44 -49
- package/build-module/components/colors-gradients/dropdown.js.map +1 -1
- package/build-module/components/colors-gradients/panel-color-gradient-settings.js +27 -28
- 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 +27 -31
- package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
- package/build-module/components/contrast-checker/index.js +12 -13
- package/build-module/components/contrast-checker/index.js.map +1 -1
- package/build-module/components/contrast-checker/index.native.js +16 -18
- package/build-module/components/contrast-checker/index.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.js +9 -10
- package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/index.native.js +6 -7
- package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/toolbar.js +6 -12
- package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +4 -6
- package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
- package/build-module/components/copy-handler/index.js +9 -13
- package/build-module/components/copy-handler/index.js.map +1 -1
- package/build-module/components/date-format-picker/index.js +12 -16
- package/build-module/components/date-format-picker/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.js +7 -9
- package/build-module/components/default-block-appender/index.js.map +1 -1
- package/build-module/components/default-block-appender/index.native.js +8 -10
- package/build-module/components/default-block-appender/index.native.js.map +1 -1
- package/build-module/components/default-style-picker/index.js +14 -22
- package/build-module/components/default-style-picker/index.js.map +1 -1
- package/build-module/components/duotone/components.js +14 -18
- package/build-module/components/duotone/components.js.map +1 -1
- package/build-module/components/duotone/utils.js +1 -2
- package/build-module/components/duotone/utils.js.map +1 -1
- package/build-module/components/duotone-control/index.js +13 -17
- package/build-module/components/duotone-control/index.js.map +1 -1
- package/build-module/components/editable-text/index.js +11 -12
- package/build-module/components/editable-text/index.js.map +1 -1
- package/build-module/components/editor-styles/index.js +4 -5
- package/build-module/components/editor-styles/index.js.map +1 -1
- package/build-module/components/floating-toolbar/index.native.js +7 -8
- package/build-module/components/floating-toolbar/index.native.js.map +1 -1
- package/build-module/components/font-appearance-control/index.js +21 -29
- package/build-module/components/font-appearance-control/index.js.map +1 -1
- package/build-module/components/font-family/index.js +14 -16
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/fluid-utils.js +17 -21
- package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
- package/build-module/components/font-sizes/font-size-picker.js +2 -3
- package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
- package/build-module/components/font-sizes/utils.js +8 -14
- package/build-module/components/font-sizes/utils.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +18 -36
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/advanced-panel.js +7 -10
- package/build-module/components/global-styles/advanced-panel.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +45 -78
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.js +119 -162
- package/build-module/components/global-styles/color-panel.js.map +1 -1
- package/build-module/components/global-styles/color-panel.native.js +25 -42
- package/build-module/components/global-styles/color-panel.native.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +78 -109
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/effects-panel.js +60 -73
- package/build-module/components/global-styles/effects-panel.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +55 -72
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/get-block-css-selector.js +5 -8
- package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +22 -37
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/index.js +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +69 -125
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-utils.js +48 -26
- package/build-module/components/global-styles/typography-utils.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +146 -240
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +12 -28
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js +6 -7
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/gradients/with-gradient.js +2 -3
- package/build-module/components/gradients/with-gradient.js.map +1 -1
- package/build-module/components/height-control/index.js +9 -10
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +54 -90
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/iframe/use-compatibility-styles.js +29 -20
- package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +83 -91
- package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build-module/components/image-editor/constants.js +1 -2
- package/build-module/components/image-editor/constants.js.map +1 -1
- package/build-module/components/image-editor/context.js +9 -10
- package/build-module/components/image-editor/context.js.map +1 -1
- package/build-module/components/image-editor/cropper.js +11 -12
- package/build-module/components/image-editor/cropper.js.map +1 -1
- package/build-module/components/image-editor/index.js +12 -13
- package/build-module/components/image-editor/index.js.map +1 -1
- package/build-module/components/image-editor/use-save-image.js +11 -12
- package/build-module/components/image-editor/use-save-image.js.map +1 -1
- package/build-module/components/image-editor/use-transform-image.js +5 -6
- package/build-module/components/image-editor/use-transform-image.js.map +1 -1
- package/build-module/components/image-editor/zoom-dropdown.js +10 -13
- package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
- package/build-module/components/image-size-control/index.js +12 -13
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +1 -0
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/button-block-appender.js +7 -8
- package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/default-block-appender.js +6 -8
- package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +11 -13
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/inner-blocks/index.native.js +9 -9
- package/build-module/components/inner-blocks/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/use-block-context.js +1 -4
- package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
- package/build-module/components/inner-blocks/use-nested-settings-update.js +24 -29
- package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
- package/build-module/components/inner-blocks/with-client-id.js +2 -3
- package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/explorer.js +11 -12
- package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
- package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js +20 -24
- package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
- package/build-module/components/inserter/block-patterns-tab.js +62 -47
- package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.js +7 -9
- package/build-module/components/inserter/block-types-tab.js.map +1 -1
- package/build-module/components/inserter/block-types-tab.native.js +8 -9
- package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
- package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-block-types-state.js +9 -9
- package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
- package/build-module/components/inserter/hooks/use-clipboard-block.native.js +2 -2
- package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
- package/build-module/components/inserter/hooks/use-debounced-input.js +1 -2
- package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -1
- package/build-module/components/inserter/hooks/use-insertion-point.js +11 -13
- package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
- package/build-module/components/inserter/index.js +45 -58
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/index.native.js +28 -35
- package/build-module/components/inserter/index.native.js.map +1 -1
- package/build-module/components/inserter/library.js +12 -13
- package/build-module/components/inserter/library.js.map +1 -1
- package/build-module/components/inserter/media-tab/hooks.js +2 -5
- package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-list.js +8 -10
- package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-panel.js +12 -14
- package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-preview.js +47 -59
- package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
- package/build-module/components/inserter/media-tab/media-tab.js +27 -31
- package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
- package/build-module/components/inserter/media-tab/utils.js +3 -5
- package/build-module/components/inserter/media-tab/utils.js.map +1 -1
- package/build-module/components/inserter/menu.js +15 -19
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/inserter/menu.native.js +27 -31
- package/build-module/components/inserter/menu.native.js.map +1 -1
- package/build-module/components/inserter/mobile-tab-navigation.js +7 -9
- package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
- package/build-module/components/inserter/panel.js +5 -6
- package/build-module/components/inserter/panel.js.map +1 -1
- package/build-module/components/inserter/preview-panel.js +4 -5
- package/build-module/components/inserter/preview-panel.js.map +1 -1
- package/build-module/components/inserter/quick-inserter.js +8 -9
- package/build-module/components/inserter/quick-inserter.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.js +16 -21
- package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
- package/build-module/components/inserter/reusable-blocks-tab.native.js +5 -6
- package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
- package/build-module/components/inserter/search-items.js +12 -40
- package/build-module/components/inserter/search-items.js.map +1 -1
- package/build-module/components/inserter/search-results.js +17 -18
- package/build-module/components/inserter/search-results.js.map +1 -1
- package/build-module/components/inserter/search-results.native.js +11 -12
- package/build-module/components/inserter/search-results.native.js.map +1 -1
- package/build-module/components/inserter/tabs.js +11 -12
- package/build-module/components/inserter/tabs.js.map +1 -1
- package/build-module/components/inserter/tabs.native.js +37 -55
- package/build-module/components/inserter/tabs.native.js.map +1 -1
- package/build-module/components/inserter/utils.native.js +13 -17
- package/build-module/components/inserter/utils.native.js.map +1 -1
- package/build-module/components/inserter-draggable-blocks/index.js +11 -13
- package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
- package/build-module/components/inserter-list-item/index.js +66 -70
- package/build-module/components/inserter-list-item/index.js.map +1 -1
- package/build-module/components/inserter-listbox/group.js +4 -4
- package/build-module/components/inserter-listbox/group.js.map +1 -1
- package/build-module/components/inserter-listbox/index.js +3 -4
- package/build-module/components/inserter-listbox/index.js.map +1 -1
- package/build-module/components/inserter-listbox/item.js +14 -13
- package/build-module/components/inserter-listbox/item.js.map +1 -1
- package/build-module/components/inserter-listbox/row.js +4 -4
- package/build-module/components/inserter-listbox/row.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-slot-container.js +6 -8
- package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
- package/build-module/components/inspector-controls/block-support-tools-panel.js +6 -8
- package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
- package/build-module/components/inspector-controls/fill.js +13 -23
- package/build-module/components/inspector-controls/fill.js.map +1 -1
- package/build-module/components/inspector-controls/fill.native.js +9 -12
- package/build-module/components/inspector-controls/fill.native.js.map +1 -1
- package/build-module/components/inspector-controls/index.js +4 -5
- package/build-module/components/inspector-controls/index.js.map +1 -1
- package/build-module/components/inspector-controls/slot.js +13 -18
- package/build-module/components/inspector-controls/slot.js.map +1 -1
- package/build-module/components/inspector-controls/slot.native.js +8 -11
- package/build-module/components/inspector-controls/slot.native.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/index.js +6 -7
- package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js +3 -8
- package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/settings-tab.js +3 -6
- package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/styles-tab.js +5 -6
- package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
- package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
- package/build-module/components/inspector-popover-header/index.js +18 -22
- package/build-module/components/inspector-popover-header/index.js.map +1 -1
- package/build-module/components/justify-content-control/index.js +4 -5
- package/build-module/components/justify-content-control/index.js.map +1 -1
- package/build-module/components/justify-content-control/ui.js +12 -14
- package/build-module/components/justify-content-control/ui.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +8 -10
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.js +14 -20
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/line-height-control/index.native.js +4 -5
- package/build-module/components/line-height-control/index.native.js.map +1 -1
- package/build-module/components/link-control/index.js +85 -72
- package/build-module/components/link-control/index.js.map +1 -1
- package/build-module/components/link-control/is-url-like.js +32 -3
- package/build-module/components/link-control/is-url-like.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +24 -27
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-create-button.js +9 -12
- package/build-module/components/link-control/search-create-button.js.map +1 -1
- package/build-module/components/link-control/search-input.js +24 -27
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/link-control/search-item.js +15 -18
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +23 -30
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/settings-drawer.js +7 -33
- package/build-module/components/link-control/settings-drawer.js.map +1 -1
- package/build-module/components/link-control/settings.js +7 -9
- package/build-module/components/link-control/settings.js.map +1 -1
- package/build-module/components/link-control/use-internal-value.js +46 -0
- package/build-module/components/link-control/use-internal-value.js.map +1 -0
- package/build-module/components/link-control/use-rich-url-data.js +1 -1
- package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +10 -23
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/appender.js +14 -16
- package/build-module/components/list-view/appender.js.map +1 -1
- package/build-module/components/list-view/aria-referenced-text.js +34 -0
- package/build-module/components/list-view/aria-referenced-text.js.map +1 -0
- package/build-module/components/list-view/block-contents.js +39 -39
- package/build-module/components/list-view/block-contents.js.map +1 -1
- package/build-module/components/list-view/block-select-button.js +78 -25
- package/build-module/components/list-view/block-select-button.js.map +1 -1
- package/build-module/components/list-view/block.js +117 -101
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/branch.js +14 -12
- package/build-module/components/list-view/branch.js.map +1 -1
- package/build-module/components/list-view/drop-indicator.js +65 -16
- package/build-module/components/list-view/drop-indicator.js.map +1 -1
- package/build-module/components/list-view/expander.js +3 -4
- package/build-module/components/list-view/expander.js.map +1 -1
- package/build-module/components/list-view/index.js +50 -48
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/list-view/leaf.js +14 -15
- package/build-module/components/list-view/leaf.js.map +1 -1
- package/build-module/components/list-view/use-block-selection.js +4 -6
- package/build-module/components/list-view/use-block-selection.js.map +1 -1
- package/build-module/components/list-view/use-list-view-client-ids.js +6 -29
- package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
- package/build-module/components/list-view/use-list-view-drop-zone.js +62 -39
- package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
- package/build-module/components/list-view/use-list-view-expand-selected-item.js +4 -5
- package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
- package/build-module/components/list-view/use-list-view-scroll-into-view.js +5 -6
- package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
- package/build-module/components/media-placeholder/index.js +106 -102
- package/build-module/components/media-placeholder/index.js.map +1 -1
- package/build-module/components/media-placeholder/index.native.js +5 -6
- package/build-module/components/media-placeholder/index.native.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +92 -107
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/media-upload/check.js +4 -5
- package/build-module/components/media-upload/check.js.map +1 -1
- package/build-module/components/media-upload/index.native.js +1 -1
- package/build-module/components/media-upload/index.native.js.map +1 -1
- package/build-module/components/multi-selection-inspector/index.js +3 -4
- package/build-module/components/multi-selection-inspector/index.js.map +1 -1
- package/build-module/components/navigable-toolbar/index.js +24 -22
- package/build-module/components/navigable-toolbar/index.js.map +1 -1
- package/build-module/components/observe-typing/index.js +3 -4
- package/build-module/components/observe-typing/index.js.map +1 -1
- package/build-module/components/panel-color-settings/index.js +8 -9
- package/build-module/components/panel-color-settings/index.js.map +1 -1
- package/build-module/components/plain-text/index.js +12 -13
- package/build-module/components/plain-text/index.js.map +1 -1
- package/build-module/components/plain-text/index.native.js +15 -19
- package/build-module/components/plain-text/index.native.js.map +1 -1
- package/build-module/components/preview-options/index.js +12 -12
- package/build-module/components/preview-options/index.js.map +1 -1
- package/build-module/components/provider/block-refs-provider.js +3 -4
- package/build-module/components/provider/block-refs-provider.js.map +1 -1
- package/build-module/components/provider/index.js +2 -3
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +7 -8
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/provider/with-registry-provider.js +13 -14
- package/build-module/components/provider/with-registry-provider.js.map +1 -1
- package/build-module/components/publish-date-time-picker/index.js +10 -11
- package/build-module/components/publish-date-time-picker/index.js.map +1 -1
- package/build-module/components/recursion-provider/index.js +7 -11
- package/build-module/components/recursion-provider/index.js.map +1 -1
- package/build-module/components/resizable-box-popover/index.js +10 -10
- package/build-module/components/resizable-box-popover/index.js.map +1 -1
- package/build-module/components/responsive-block-control/label.js +5 -6
- package/build-module/components/responsive-block-control/label.js.map +1 -1
- package/build-module/components/rich-text/content.js +85 -0
- package/build-module/components/rich-text/content.js.map +1 -0
- package/build-module/components/rich-text/embed-handler-picker.native.js +6 -10
- package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
- package/build-module/components/rich-text/format-edit.js +7 -8
- package/build-module/components/rich-text/format-edit.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar/index.js +10 -20
- package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
- package/build-module/components/rich-text/format-toolbar-container.js +13 -16
- package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
- package/build-module/components/rich-text/index.js +45 -83
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +128 -183
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/input-event.js +4 -5
- package/build-module/components/rich-text/input-event.js.map +1 -1
- package/build-module/components/rich-text/shortcut.js +5 -6
- package/build-module/components/rich-text/shortcut.js.map +1 -1
- package/build-module/components/rich-text/split-value.js +8 -10
- package/build-module/components/rich-text/split-value.js.map +1 -1
- package/build-module/components/rich-text/toolbar-button.js +8 -10
- package/build-module/components/rich-text/toolbar-button.js.map +1 -1
- package/build-module/components/rich-text/use-before-input-rules.js +1 -4
- package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-enter.js +3 -6
- package/build-module/components/rich-text/use-enter.js.map +1 -1
- package/build-module/components/rich-text/use-firefox-compat.js +29 -1
- package/build-module/components/rich-text/use-firefox-compat.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +11 -17
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/rich-text/use-input-rules.js +9 -15
- package/build-module/components/rich-text/use-input-rules.js.map +1 -1
- package/build-module/components/rich-text/use-mark-persistent.js +4 -5
- package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +5 -7
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/rich-text/utils.js +5 -7
- package/build-module/components/rich-text/utils.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +3 -4
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +27 -0
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
- package/build-module/components/spacing-sizes-control/index.js +64 -64
- package/build-module/components/spacing-sizes-control/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
- package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
- package/build-module/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +21 -21
- package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
- package/build-module/components/spacing-sizes-control/input-controls/single.js +40 -0
- package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -0
- package/build-module/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +53 -70
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
- package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +73 -0
- package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
- package/build-module/components/spacing-sizes-control/utils.js +196 -25
- package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
- package/build-module/components/text-decoration-control/index.js +5 -6
- package/build-module/components/text-decoration-control/index.js.map +1 -1
- package/build-module/components/text-transform-control/index.js +5 -6
- package/build-module/components/text-transform-control/index.js.map +1 -1
- package/build-module/components/tool-selector/index.js +13 -17
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/typewriter/index.js +6 -9
- package/build-module/components/typewriter/index.js.map +1 -1
- package/build-module/components/ungroup-button/index.native.js +11 -14
- package/build-module/components/ungroup-button/index.native.js.map +1 -1
- package/build-module/components/unit-control/index.js +8 -9
- package/build-module/components/unit-control/index.js.map +1 -1
- package/build-module/components/url-input/index.js +23 -33
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-input/index.native.js +10 -12
- package/build-module/components/url-input/index.native.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +34 -30
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/components/url-popover/index.js +16 -18
- package/build-module/components/url-popover/index.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +10 -11
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/url-popover/link-viewer-url.js +5 -6
- package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
- package/build-module/components/url-popover/link-viewer.js +11 -12
- package/build-module/components/url-popover/link-viewer.js.map +1 -1
- package/build-module/components/use-block-display-information/index.js +29 -2
- package/build-module/components/use-block-display-information/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +16 -23
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.native.js +8 -11
- package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
- package/build-module/components/use-moving-animation/index.js +9 -12
- package/build-module/components/use-moving-animation/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +2 -6
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.native.js +8 -10
- package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
- package/build-module/components/use-paste-styles/index.js +2 -6
- package/build-module/components/use-paste-styles/index.js.map +1 -1
- package/build-module/components/video-player/index.native.js +2 -3
- package/build-module/components/video-player/index.native.js.map +1 -1
- package/build-module/components/warning/index.js +6 -7
- package/build-module/components/warning/index.js.map +1 -1
- package/build-module/components/warning/index.native.js +13 -14
- package/build-module/components/warning/index.native.js.map +1 -1
- package/build-module/components/writing-flow/index.js +6 -8
- package/build-module/components/writing-flow/index.js.map +1 -1
- package/build-module/components/writing-flow/use-drag-selection.js +5 -7
- package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
- package/build-module/components/writing-flow/use-tab-nav.js +41 -11
- package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
- package/build-module/hooks/align.js +15 -21
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +8 -4
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/aria-label.js +1 -3
- package/build-module/hooks/aria-label.js.map +1 -1
- package/build-module/hooks/behaviors.js +132 -58
- package/build-module/hooks/behaviors.js.map +1 -1
- package/build-module/hooks/border.js +29 -42
- package/build-module/hooks/border.js.map +1 -1
- package/build-module/hooks/color.js +26 -41
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/content-lock-ui.js +30 -33
- package/build-module/hooks/content-lock-ui.js.map +1 -1
- package/build-module/hooks/contrast-checker.js +4 -7
- package/build-module/hooks/contrast-checker.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +7 -5
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/dimensions.js +11 -13
- package/build-module/hooks/dimensions.js.map +1 -1
- package/build-module/hooks/duotone.js +37 -48
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-family.js +6 -11
- package/build-module/hooks/font-family.js.map +1 -1
- package/build-module/hooks/font-size.js +22 -28
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/gap.js +5 -6
- package/build-module/hooks/gap.js.map +1 -1
- package/build-module/hooks/layout.js +62 -77
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/line-height.js +5 -8
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/lock.js +2 -2
- package/build-module/hooks/lock.js.map +1 -1
- package/build-module/hooks/margin.js +6 -9
- package/build-module/hooks/margin.js.map +1 -1
- package/build-module/hooks/metadata-name.js +4 -5
- package/build-module/hooks/metadata-name.js.map +1 -1
- package/build-module/hooks/metadata.js +3 -7
- package/build-module/hooks/metadata.js.map +1 -1
- package/build-module/hooks/padding.js +6 -9
- package/build-module/hooks/padding.js.map +1 -1
- package/build-module/hooks/position.js +49 -55
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/settings.js +1 -3
- package/build-module/hooks/settings.js.map +1 -1
- package/build-module/hooks/style.js +18 -22
- package/build-module/hooks/style.js.map +1 -1
- package/build-module/hooks/supports.js +4 -6
- package/build-module/hooks/supports.js.map +1 -1
- package/build-module/hooks/typography.js +18 -27
- package/build-module/hooks/typography.js.map +1 -1
- package/build-module/hooks/typography.native.js +4 -3
- package/build-module/hooks/typography.native.js.map +1 -1
- package/build-module/hooks/use-border-props.js +1 -3
- package/build-module/hooks/use-border-props.js.map +1 -1
- package/build-module/hooks/use-color-props.js +6 -8
- package/build-module/hooks/use-color-props.js.map +1 -1
- package/build-module/hooks/use-editor-wrapper-styles.native.js +34 -39
- package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -1
- package/build-module/hooks/use-spacing-props.js +1 -1
- package/build-module/hooks/use-spacing-props.js.map +1 -1
- package/build-module/hooks/use-typography-props.js +11 -22
- package/build-module/hooks/use-typography-props.js.map +1 -1
- package/build-module/hooks/utils.js +7 -19
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/layouts/constrained.js +23 -27
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/definitions.js +147 -0
- package/build-module/layouts/definitions.js.map +1 -0
- package/build-module/layouts/flex.js +50 -59
- package/build-module/layouts/flex.js.map +1 -1
- package/build-module/layouts/flow.js +11 -13
- package/build-module/layouts/flow.js.map +1 -1
- package/build-module/layouts/grid.js +46 -25
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/layouts/index.js +1 -2
- package/build-module/layouts/index.js.map +1 -1
- package/build-module/layouts/utils.js +10 -11
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/private-apis.js +12 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +229 -372
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/array.js +1 -2
- package/build-module/store/array.js.map +1 -1
- package/build-module/store/private-actions.js +189 -7
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +100 -25
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +118 -169
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +160 -231
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/block-variation-transforms.js +4 -7
- package/build-module/utils/block-variation-transforms.js.map +1 -1
- package/build-module/utils/math.js +1 -2
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/object.js +38 -5
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/order-inserter-block-items.js +5 -7
- package/build-module/utils/order-inserter-block-items.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +3 -6
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-module/utils/pasting.js +5 -8
- package/build-module/utils/pasting.js.map +1 -1
- package/build-module/utils/pre-parse-patterns.js +1 -1
- package/build-module/utils/pre-parse-patterns.js.map +1 -1
- package/build-module/utils/sorting.js +1 -2
- package/build-module/utils/sorting.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +5 -7
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-module/utils/transform-styles/transforms/wrap.js +25 -28
- package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
- package/build-style/content-rtl.css +7 -10
- package/build-style/content.css +7 -10
- package/build-style/style-rtl.css +51 -122
- package/build-style/style.css +51 -122
- package/package.json +31 -31
- package/src/autocompleters/block.js +4 -2
- package/src/components/alignment-control/ui.js +1 -2
- package/src/components/block-actions/index.js +10 -0
- package/src/components/block-alignment-control/constants.js +0 -4
- package/src/components/block-alignment-control/ui.js +1 -6
- package/src/components/block-alignment-matrix-control/index.js +1 -1
- package/src/components/block-breadcrumb/index.js +2 -6
- package/src/components/block-controls/fill.js +15 -17
- package/src/components/block-controls/slot.js +21 -18
- package/src/components/block-controls/slot.native.js +3 -8
- package/src/components/block-draggable/index.js +2 -1
- package/src/components/block-edit/index.js +3 -5
- package/src/components/block-edit/test/edit.js +1 -1
- package/src/components/block-heading-level-dropdown/README.md +52 -0
- package/src/components/block-heading-level-dropdown/heading-level-icon.js +43 -0
- package/src/components/block-heading-level-dropdown/index.js +77 -0
- package/src/components/block-heading-level-dropdown/index.native.js +63 -0
- package/src/components/block-inspector/index.js +19 -92
- package/src/components/block-inspector/style.scss +0 -5
- package/src/components/block-list/block.native.js +1 -0
- package/src/components/block-list/content.scss +8 -12
- package/src/components/block-list/index.js +1 -1
- package/src/components/block-list/use-block-props/index.js +6 -1
- package/src/components/block-list/use-in-between-inserter.js +0 -4
- package/src/components/block-list-appender/index.js +32 -22
- package/src/components/block-lock/style.scss +11 -4
- package/src/components/block-lock/toolbar.js +2 -8
- package/src/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
- package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +2 -2
- package/src/components/block-mover/test/__snapshots__/index.native.js.snap +3 -3
- package/src/components/block-mover/test/index.native.js +1 -20
- package/src/components/block-preview/index.js +7 -14
- package/src/components/block-quick-navigation/index.js +81 -0
- package/src/components/block-removal-warning-modal/index.js +94 -0
- package/src/components/block-settings-menu/block-settings-dropdown.js +96 -54
- package/src/components/block-switcher/index.js +1 -2
- package/src/components/block-toolbar/style.scss +0 -4
- package/src/components/block-tools/index.js +10 -1
- package/src/components/block-tools/selected-block-popover.js +6 -0
- package/src/components/block-vertical-alignment-control/ui.js +1 -3
- package/src/components/color-palette/test/__snapshots__/control.js.snap +66 -50
- package/src/components/color-palette/with-color-context.js +2 -6
- package/src/components/colors/utils.js +5 -1
- package/src/components/colors/with-colors.js +1 -5
- package/src/components/colors-gradients/control.js +3 -3
- package/src/components/colors-gradients/panel-color-gradient-settings.js +4 -5
- package/src/components/copy-handler/index.js +5 -5
- package/src/components/duotone-control/index.js +0 -1
- package/src/components/font-sizes/test/fluid-utils.js +97 -76
- package/src/components/font-sizes/utils.js +2 -2
- package/src/components/global-styles/color-panel.js +3 -3
- package/src/components/global-styles/dimensions-panel.js +14 -5
- package/src/components/global-styles/get-block-css-selector.js +2 -2
- package/src/components/global-styles/index.js +1 -0
- package/src/components/global-styles/test/typography-utils.js +139 -1
- package/src/components/global-styles/test/use-global-styles-output.js +14 -9
- package/src/components/global-styles/typography-panel.js +19 -16
- package/src/components/global-styles/typography-utils.js +53 -28
- package/src/components/global-styles/use-global-styles-output.js +29 -19
- package/src/components/global-styles/utils.js +9 -3
- package/src/components/iframe/index.js +46 -68
- package/src/components/iframe/use-compatibility-styles.js +34 -18
- package/src/components/image-editor/constants.js +0 -1
- package/src/components/index.js +1 -1
- package/src/components/index.native.js +1 -0
- package/src/components/inner-blocks/index.js +4 -2
- package/src/components/inner-blocks/index.native.js +1 -1
- package/src/components/inner-blocks/use-nested-settings-update.js +31 -36
- package/src/components/inserter/block-patterns-tab.js +63 -8
- package/src/components/inserter/hooks/use-block-types-state.js +4 -3
- package/src/components/inserter/hooks/use-insertion-point.js +1 -0
- package/src/components/inserter/library.js +2 -1
- package/src/components/inserter/media-tab/media-tab.js +9 -3
- package/src/components/inserter/reusable-blocks-tab.js +3 -3
- package/src/components/inserter/tabs.js +3 -3
- package/src/components/inspector-controls/README.md +1 -1
- package/src/components/inspector-controls/fill.js +2 -6
- package/src/components/inspector-controls-tabs/index.js +0 -1
- package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +0 -1
- package/src/components/link-control/index.js +73 -42
- package/src/components/link-control/is-url-like.js +40 -3
- package/src/components/link-control/search-input.js +1 -0
- package/src/components/link-control/search-results.js +4 -14
- package/src/components/link-control/settings-drawer.js +2 -37
- package/src/components/link-control/settings.js +2 -2
- package/src/components/link-control/style.scss +5 -6
- package/src/components/link-control/test/index.js +202 -105
- package/src/components/link-control/test/is-url-like.js +66 -0
- package/src/components/link-control/use-internal-value.js +60 -0
- package/src/components/link-control/use-search-handler.js +10 -27
- package/src/components/list-view/appender.js +3 -5
- package/src/components/list-view/aria-referenced-text.js +30 -0
- package/src/components/list-view/block-contents.js +9 -8
- package/src/components/list-view/block-select-button.js +78 -2
- package/src/components/list-view/block.js +40 -10
- package/src/components/list-view/branch.js +6 -3
- package/src/components/list-view/drop-indicator.js +94 -9
- package/src/components/list-view/index.js +29 -19
- package/src/components/list-view/style.scss +13 -17
- package/src/components/list-view/test/use-list-view-drop-zone.js +208 -76
- package/src/components/list-view/use-block-selection.js +2 -2
- package/src/components/list-view/use-list-view-client-ids.js +3 -20
- package/src/components/list-view/use-list-view-drop-zone.js +108 -47
- package/src/components/media-placeholder/index.js +54 -20
- package/src/components/media-replace-flow/index.js +1 -3
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/navigable-toolbar/index.js +7 -5
- package/src/components/preview-options/index.js +3 -2
- package/src/components/provider/test/experimental-provider.js +9 -6
- package/src/components/rich-text/content.js +85 -0
- package/src/components/rich-text/format-toolbar/index.js +1 -2
- package/src/components/rich-text/index.js +3 -36
- package/src/components/rich-text/index.native.js +3 -33
- package/src/components/rich-text/use-firefox-compat.js +27 -1
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +26 -0
- package/src/components/spacing-sizes-control/index.js +85 -71
- package/src/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +14 -13
- package/src/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +15 -14
- package/src/components/spacing-sizes-control/input-controls/single.js +40 -0
- package/src/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +55 -80
- package/src/components/spacing-sizes-control/sides-dropdown/index.js +91 -0
- package/src/components/spacing-sizes-control/style.scss +28 -100
- package/src/components/spacing-sizes-control/test/utils.js +233 -4
- package/src/components/spacing-sizes-control/utils.js +203 -20
- package/src/components/ungroup-button/index.native.js +2 -2
- package/src/components/url-popover/image-url-input-ui.js +15 -15
- package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
- package/src/components/use-block-display-information/index.js +26 -0
- package/src/components/writing-flow/use-drag-selection.js +1 -1
- package/src/components/writing-flow/use-tab-nav.js +56 -9
- package/src/hooks/anchor.js +3 -1
- package/src/hooks/behaviors.js +163 -64
- package/src/hooks/custom-class-name.js +23 -19
- package/src/hooks/font-family.js +1 -5
- package/src/hooks/font-size.js +12 -17
- package/src/hooks/layout.js +21 -26
- package/src/hooks/position.js +24 -12
- package/src/hooks/style.js +3 -1
- package/src/hooks/supports.js +1 -1
- package/src/hooks/use-typography-props.js +14 -19
- package/src/hooks/utils.js +8 -7
- package/src/index.js +0 -2
- package/src/layouts/constrained.js +2 -1
- package/src/layouts/definitions.js +174 -0
- package/src/layouts/flex.js +7 -5
- package/src/layouts/flow.js +2 -1
- package/src/layouts/grid.js +31 -4
- package/src/layouts/test/utils.js +2 -7
- package/src/layouts/utils.js +7 -2
- package/src/private-apis.js +11 -0
- package/src/store/actions.js +7 -56
- package/src/store/private-actions.js +193 -0
- package/src/store/private-selectors.js +132 -37
- package/src/store/reducer.js +50 -8
- package/src/store/selectors.js +74 -41
- package/src/store/test/private-selectors.js +491 -48
- package/src/store/test/reducer.js +0 -7
- package/src/store/test/selectors.js +117 -17
- package/src/utils/object.js +35 -0
- package/src/utils/test/object.js +96 -1
- package/build/components/link-control/use-internal-input-value.js +0 -27
- package/build/components/link-control/use-internal-input-value.js.map +0 -1
- package/build/components/spacing-sizes-control/all-input-control.js +0 -57
- package/build/components/spacing-sizes-control/all-input-control.js.map +0 -1
- package/build/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
- package/build/components/spacing-sizes-control/input-controls.js.map +0 -1
- package/build/components/spacing-sizes-control/linked-button.js +0 -37
- package/build/components/spacing-sizes-control/linked-button.js.map +0 -1
- package/build/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
- package/build/components/ungroup-button/icon.js +0 -31
- package/build/components/ungroup-button/icon.js.map +0 -1
- package/build-module/components/link-control/use-internal-input-value.js +0 -19
- package/build-module/components/link-control/use-internal-input-value.js.map +0 -1
- package/build-module/components/spacing-sizes-control/all-input-control.js +0 -45
- package/build-module/components/spacing-sizes-control/all-input-control.js.map +0 -1
- package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
- package/build-module/components/spacing-sizes-control/input-controls.js.map +0 -1
- package/build-module/components/spacing-sizes-control/linked-button.js +0 -27
- package/build-module/components/spacing-sizes-control/linked-button.js.map +0 -1
- package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
- package/build-module/components/ungroup-button/icon.js +0 -22
- package/build-module/components/ungroup-button/icon.js.map +0 -1
- package/src/components/link-control/use-internal-input-value.js +0 -23
- package/src/components/spacing-sizes-control/all-input-control.js +0 -44
- package/src/components/spacing-sizes-control/linked-button.js +0 -24
- package/src/components/ungroup-button/icon.js +0 -26
|
@@ -7,9 +7,7 @@ exports.__experimentalGetMatchingVariation = void 0;
|
|
|
7
7
|
|
|
8
8
|
/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */
|
|
9
9
|
function matchesAttributes(blockAttributes, variation) {
|
|
10
|
-
return Object.entries(variation).every(
|
|
11
|
-
let [key, value] = _ref;
|
|
12
|
-
|
|
10
|
+
return Object.entries(variation).every(([key, value]) => {
|
|
13
11
|
if (typeof value === 'object' && typeof blockAttributes[key] === 'object') {
|
|
14
12
|
return matchesAttributes(blockAttributes[key], value);
|
|
15
13
|
}
|
|
@@ -33,10 +31,9 @@ function matchesAttributes(blockAttributes, variation) {
|
|
|
33
31
|
|
|
34
32
|
const __experimentalGetMatchingVariation = (blockAttributes, variations) => {
|
|
35
33
|
if (!variations || !blockAttributes) return;
|
|
36
|
-
const matches = variations.filter(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} = _ref2;
|
|
34
|
+
const matches = variations.filter(({
|
|
35
|
+
attributes
|
|
36
|
+
}) => {
|
|
40
37
|
if (!attributes || !Object.keys(attributes).length) return false;
|
|
41
38
|
return matchesAttributes(blockAttributes, attributes);
|
|
42
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/block-variation-transforms.js"],"names":["matchesAttributes","blockAttributes","variation","Object","entries","every","key","value","__experimentalGetMatchingVariation","variations","matches","filter","attributes","keys","length"],"mappings":";;;;;;;AAAA;AAEA,SAASA,iBAAT,CAA4BC,eAA5B,EAA6CC,SAA7C,EAAyD;AACxD,SAAOC,MAAM,CAACC,OAAP,CAAgBF,SAAhB,EAA4BG,KAA5B,CAAmC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/block-variation-transforms.js"],"names":["matchesAttributes","blockAttributes","variation","Object","entries","every","key","value","__experimentalGetMatchingVariation","variations","matches","filter","attributes","keys","length"],"mappings":";;;;;;;AAAA;AAEA,SAASA,iBAAT,CAA4BC,eAA5B,EAA6CC,SAA7C,EAAyD;AACxD,SAAOC,MAAM,CAACC,OAAP,CAAgBF,SAAhB,EAA4BG,KAA5B,CAAmC,CAAE,CAAEC,GAAF,EAAOC,KAAP,CAAF,KAAsB;AAC/D,QACC,OAAOA,KAAP,KAAiB,QAAjB,IACA,OAAON,eAAe,CAAEK,GAAF,CAAtB,KAAkC,QAFnC,EAGE;AACD,aAAON,iBAAiB,CAAEC,eAAe,CAAEK,GAAF,CAAjB,EAA0BC,KAA1B,CAAxB;AACA;;AACD,WAAON,eAAe,CAAEK,GAAF,CAAf,KAA2BC,KAAlC;AACA,GARM,CAAP;AASA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMC,kCAAkC,GAAG,CACjDP,eADiD,EAEjDQ,UAFiD,KAG7C;AACJ,MAAK,CAAEA,UAAF,IAAgB,CAAER,eAAvB,EAAyC;AACzC,QAAMS,OAAO,GAAGD,UAAU,CAACE,MAAX,CAAmB,CAAE;AAAEC,IAAAA;AAAF,GAAF,KAAsB;AACxD,QAAK,CAAEA,UAAF,IAAgB,CAAET,MAAM,CAACU,IAAP,CAAaD,UAAb,EAA0BE,MAAjD,EAA0D,OAAO,KAAP;AAC1D,WAAOd,iBAAiB,CAAEC,eAAF,EAAmBW,UAAnB,CAAxB;AACA,GAHe,CAAhB;AAIA,MAAKF,OAAO,CAACI,MAAR,KAAmB,CAAxB,EAA4B;AAC5B,SAAOJ,OAAO,CAAE,CAAF,CAAd;AACA,CAXM","sourcesContent":["/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */\n\nfunction matchesAttributes( blockAttributes, variation ) {\n\treturn Object.entries( variation ).every( ( [ key, value ] ) => {\n\t\tif (\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof blockAttributes[ key ] === 'object'\n\t\t) {\n\t\t\treturn matchesAttributes( blockAttributes[ key ], value );\n\t\t}\n\t\treturn blockAttributes[ key ] === value;\n\t} );\n}\n\n/**\n * Matches the provided block variations with a block's attributes. If no match\n * or more than one matches are found it returns `undefined`. If a single match is\n * found it returns it.\n *\n * This is a simple implementation for now as it takes into account only the attributes\n * of a block variation and not `InnerBlocks`.\n *\n * @param {Object} blockAttributes - The block attributes to try to find a match.\n * @param {WPBlockVariation[]} variations - A list of block variations to test for a match.\n * @return {WPBlockVariation | undefined} - If a match is found returns it. If not or more than one matches are found returns `undefined`.\n */\nexport const __experimentalGetMatchingVariation = (\n\tblockAttributes,\n\tvariations\n) => {\n\tif ( ! variations || ! blockAttributes ) return;\n\tconst matches = variations.filter( ( { attributes } ) => {\n\t\tif ( ! attributes || ! Object.keys( attributes ).length ) return false;\n\t\treturn matchesAttributes( blockAttributes, attributes );\n\t} );\n\tif ( matches.length !== 1 ) return;\n\treturn matches[ 0 ];\n};\n"]}
|
package/build/utils/math.js
CHANGED
|
@@ -77,8 +77,7 @@ function getDistanceFromPointToEdge(point, rect, edge) {
|
|
|
77
77
|
*/
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
function getDistanceToNearestEdge(point, rect) {
|
|
81
|
-
let allowedEdges = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['top', 'bottom', 'left', 'right'];
|
|
80
|
+
function getDistanceToNearestEdge(point, rect, allowedEdges = ['top', 'bottom', 'left', 'right']) {
|
|
82
81
|
let candidateDistance;
|
|
83
82
|
let candidateEdge;
|
|
84
83
|
allowedEdges.forEach(edge => {
|
package/build/utils/math.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/math.js"],"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"],"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;AACO,SAASA,0BAAT,CAAqCC,KAArC,EAA4CC,IAA5C,EAAkDC,IAAlD,EAAyD;AAC/D,QAAMC,YAAY,GAAGD,IAAI,KAAK,KAAT,IAAkBA,IAAI,KAAK,QAAhD;AACA,QAAM;AAAEE,IAAAA,CAAF;AAAKC,IAAAA;AAAL,MAAWL,KAAjB;AACA,QAAMM,oBAAoB,GAAGH,YAAY,GAAGC,CAAH,GAAOC,CAAhD;AACA,QAAME,oBAAoB,GAAGJ,YAAY,GAAGE,CAAH,GAAOD,CAAhD;AACA,QAAMI,SAAS,GAAGL,YAAY,GAAGF,IAAI,CAACQ,IAAR,GAAeR,IAAI,CAACS,GAAlD;AACA,QAAMC,OAAO,GAAGR,YAAY,GAAGF,IAAI,CAACW,KAAR,GAAgBX,IAAI,CAACY,MAAjD;AACA,QAAMC,mBAAmB,GAAGb,IAAI,CAAEC,IAAF,CAAhC,CAP+D,CAS/D;AACA;AACA;AACA;;AACA,MAAIa,mBAAJ;;AACA,MACCT,oBAAoB,IAAIE,SAAxB,IACAF,oBAAoB,IAAIK,OAFzB,EAGE;AACDI,IAAAA,mBAAmB,GAAGT,oBAAtB;AACA,GALD,MAKO,IAAKA,oBAAoB,GAAGK,OAA5B,EAAsC;AAC5CI,IAAAA,mBAAmB,GAAGP,SAAtB;AACA,GAFM,MAEA;AACNO,IAAAA,mBAAmB,GAAGJ,OAAtB;AACA;;AAED,SAAOK,IAAI,CAACC,IAAL,CACN,CAAEX,oBAAoB,GAAGS,mBAAzB,KAAkD,CAAlD,GACC,CAAER,oBAAoB,GAAGO,mBAAzB,KAAkD,CAF7C,CAAP;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,wBAAT,CACNlB,KADM,EAENC,IAFM,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/math.js"],"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"],"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;AACO,SAASA,0BAAT,C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AY,CAACG,OAAb,CAAwBpB,IAAF,IAAY;AACjC,UAAMqB,QAAQ,GAAGxB,0BAA0B,CAAEC,KAAF,EAASC,IAAT,EAAeC,IAAf,CAA3C;;AAEA,QAAKkB,iBAAiB,KAAKI,SAAtB,IAAmCD,QAAQ,GAAGH,iBAAnD,EAAuE;AACtEA,MAAAA,iBAAiB,GAAGG,QAApB;AACAF,MAAAA,aAAa,GAAGnB,IAAhB;AACA;AACD,GAPD;AASA,SAAO,CAAEkB,iBAAF,EAAqBC,aAArB,CAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,sBAAT,CAAiCzB,KAAjC,EAAwCC,IAAxC,EAA+C;AACrD,SACCA,IAAI,CAACQ,IAAL,IAAaT,KAAK,CAACI,CAAnB,IACAH,IAAI,CAACW,KAAL,IAAcZ,KAAK,CAACI,CADpB,IAEAH,IAAI,CAACS,GAAL,IAAYV,KAAK,CAACK,CAFlB,IAGAJ,IAAI,CAACY,MAAL,IAAeb,KAAK,CAACK,CAJtB;AAMA","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"]}
|
package/build/utils/object.js
CHANGED
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.kebabCase = kebabCase;
|
|
6
7
|
exports.setImmutably = setImmutably;
|
|
7
8
|
|
|
9
|
+
var _changeCase = require("change-case");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* External dependencies
|
|
13
|
+
*/
|
|
14
|
+
|
|
8
15
|
/**
|
|
9
16
|
* Converts a path to an array of its fragments.
|
|
10
17
|
* Supports strings, numbers and arrays:
|
|
@@ -25,6 +32,38 @@ function normalizePath(path) {
|
|
|
25
32
|
|
|
26
33
|
return [path];
|
|
27
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Converts any string to kebab case.
|
|
37
|
+
* Backwards compatible with Lodash's `_.kebabCase()`.
|
|
38
|
+
* Backwards compatible with `_wp_to_kebab_case()`.
|
|
39
|
+
*
|
|
40
|
+
* @see https://lodash.com/docs/4.17.15#kebabCase
|
|
41
|
+
* @see https://developer.wordpress.org/reference/functions/_wp_to_kebab_case/
|
|
42
|
+
*
|
|
43
|
+
* @param {string} str String to convert.
|
|
44
|
+
* @return {string} Kebab-cased string
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
function kebabCase(str) {
|
|
49
|
+
let input = str;
|
|
50
|
+
|
|
51
|
+
if (typeof str !== 'string') {
|
|
52
|
+
var _str$toString;
|
|
53
|
+
|
|
54
|
+
input = (_str$toString = str?.toString?.()) !== null && _str$toString !== void 0 ? _str$toString : '';
|
|
55
|
+
} // See https://github.com/lodash/lodash/blob/b185fcee26b2133bd071f4aaca14b455c2ed1008/lodash.js#L4970
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
input = input.replace(/['\u2019]/, '');
|
|
59
|
+
return (0, _changeCase.paramCase)(input, {
|
|
60
|
+
splitRegexp: [/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g, // fooBar => foo-bar, 3Bar => 3-bar
|
|
61
|
+
/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g, // 3bar => 3-bar
|
|
62
|
+
/([A-Za-z])([0-9])/g, // Foo3 => foo-3, foo3 => foo-3
|
|
63
|
+
/([A-Z])([A-Z][a-z])/g // FOOBar => foo-bar
|
|
64
|
+
]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
28
67
|
/**
|
|
29
68
|
* Clones an object.
|
|
30
69
|
* Non-object values are returned unchanged.
|
|
@@ -36,10 +75,7 @@ function normalizePath(path) {
|
|
|
36
75
|
|
|
37
76
|
function cloneObject(object) {
|
|
38
77
|
if (object && typeof object === 'object') {
|
|
39
|
-
return { ...Object.fromEntries(Object.entries(object).map(
|
|
40
|
-
let [key, value] = _ref;
|
|
41
|
-
return [key, cloneObject(value)];
|
|
42
|
-
}))
|
|
78
|
+
return { ...Object.fromEntries(Object.entries(object).map(([key, value]) => [key, cloneObject(value)]))
|
|
43
79
|
};
|
|
44
80
|
}
|
|
45
81
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/object.js"],"names":["normalizePath","path","Array","isArray","toString","cloneObject","object","Object","fromEntries","entries","map","key","value","setImmutably","normalizedPath","newObject","reduce","acc","i","undefined","length"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/object.js"],"names":["normalizePath","path","Array","isArray","toString","kebabCase","str","input","replace","splitRegexp","cloneObject","object","Object","fromEntries","entries","map","key","value","setImmutably","normalizedPath","newObject","reduce","acc","i","undefined","length"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA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;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASO,YAAT,CAAuBP,MAAvB,EAA+BV,IAA/B,EAAqCgB,KAArC,EAA6C;AACnD,QAAME,cAAc,GAAGnB,aAAa,CAAEC,IAAF,CAApC;AACA,QAAMmB,SAAS,GAAGT,MAAM,GAAGD,WAAW,CAAEC,MAAF,CAAd,GAA2B,EAAnD;AAEAQ,EAAAA,cAAc,CAACE,MAAf,CAAuB,CAAEC,GAAF,EAAON,GAAP,EAAYO,CAAZ,KAAmB;AACzC,QAAKD,GAAG,CAAEN,GAAF,CAAH,KAAeQ,SAApB,EAAgC;AAC/BF,MAAAA,GAAG,CAAEN,GAAF,CAAH,GAAa,EAAb;AACA;;AACD,QAAKO,CAAC,KAAKJ,cAAc,CAACM,MAAf,GAAwB,CAAnC,EAAuC;AACtCH,MAAAA,GAAG,CAAEN,GAAF,CAAH,GAAaC,KAAb;AACA;;AACD,WAAOK,GAAG,CAAEN,GAAF,CAAV;AACA,GARD,EAQGI,SARH;AAUA,SAAOA,SAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { paramCase } from 'change-case';\n\n/**\n * Converts a path to an array of its fragments.\n * Supports strings, numbers and arrays:\n *\n * 'foo' => [ 'foo' ]\n * 2 => [ '2' ]\n * [ 'foo', 'bar' ] => [ 'foo', 'bar' ]\n *\n * @param {string|number|Array} path Path\n * @return {Array} Normalized path.\n */\nfunction normalizePath( path ) {\n\tif ( Array.isArray( path ) ) {\n\t\treturn path;\n\t} else if ( typeof path === 'number' ) {\n\t\treturn [ path.toString() ];\n\t}\n\n\treturn [ path ];\n}\n\n/**\n * Converts any string to kebab case.\n * Backwards compatible with Lodash's `_.kebabCase()`.\n * Backwards compatible with `_wp_to_kebab_case()`.\n *\n * @see https://lodash.com/docs/4.17.15#kebabCase\n * @see https://developer.wordpress.org/reference/functions/_wp_to_kebab_case/\n *\n * @param {string} str String to convert.\n * @return {string} Kebab-cased string\n */\nexport function kebabCase( str ) {\n\tlet input = str;\n\tif ( typeof str !== 'string' ) {\n\t\tinput = str?.toString?.() ?? '';\n\t}\n\n\t// See https://github.com/lodash/lodash/blob/b185fcee26b2133bd071f4aaca14b455c2ed1008/lodash.js#L4970\n\tinput = input.replace( /['\\u2019]/, '' );\n\n\treturn paramCase( input, {\n\t\tsplitRegexp: [\n\t\t\t/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g, // fooBar => foo-bar, 3Bar => 3-bar\n\t\t\t/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g, // 3bar => 3-bar\n\t\t\t/([A-Za-z])([0-9])/g, // Foo3 => foo-3, foo3 => foo-3\n\t\t\t/([A-Z])([A-Z][a-z])/g, // FOOBar => foo-bar\n\t\t],\n\t} );\n}\n\n/**\n * Clones an object.\n * Non-object values are returned unchanged.\n *\n * @param {*} object Object to clone.\n * @return {*} Cloned object, or original literal non-object value.\n */\nfunction cloneObject( object ) {\n\tif ( object && typeof object === 'object' ) {\n\t\treturn {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( object ).map( ( [ key, value ] ) => [\n\t\t\t\t\tkey,\n\t\t\t\t\tcloneObject( value ),\n\t\t\t\t] )\n\t\t\t),\n\t\t};\n\t}\n\n\treturn object;\n}\n\n/**\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.\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\tconst normalizedPath = normalizePath( path );\n\tconst newObject = object ? cloneObject( object ) : {};\n\n\tnormalizedPath.reduce( ( acc, key, i ) => {\n\t\tif ( acc[ key ] === undefined ) {\n\t\t\tacc[ key ] = {};\n\t\t}\n\t\tif ( i === normalizedPath.length - 1 ) {\n\t\t\tacc[ key ] = value;\n\t\t}\n\t\treturn acc[ key ];\n\t}, newObject );\n\n\treturn newObject;\n}\n"]}
|
|
@@ -19,13 +19,11 @@ const orderInserterBlockItems = (items, priority) => {
|
|
|
19
19
|
return items;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
items.sort((
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
id: bName
|
|
28
|
-
} = _ref2;
|
|
22
|
+
items.sort(({
|
|
23
|
+
id: aName
|
|
24
|
+
}, {
|
|
25
|
+
id: bName
|
|
26
|
+
}) => {
|
|
29
27
|
// Sort block items according to `priority`.
|
|
30
28
|
let aIndex = priority.indexOf(aName);
|
|
31
29
|
let bIndex = priority.indexOf(bName); // All other block items should come after that.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/order-inserter-block-items.js"],"names":["orderInserterBlockItems","items","priority","sort","id","aName","bName","aIndex","indexOf","bIndex","length"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,uBAAuB,GAAG,CAAEC,KAAF,EAASC,QAAT,KAAuB;AAC7D,MAAK,CAAEA,QAAP,EAAkB;AACjB,WAAOD,KAAP;AACA;;AAEDA,EAAAA,KAAK,CAACE,IAAN,CAAY,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/order-inserter-block-items.js"],"names":["orderInserterBlockItems","items","priority","sort","id","aName","bName","aIndex","indexOf","bIndex","length"],"mappings":";;;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,uBAAuB,GAAG,CAAEC,KAAF,EAASC,QAAT,KAAuB;AAC7D,MAAK,CAAEA,QAAP,EAAkB;AACjB,WAAOD,KAAP;AACA;;AAEDA,EAAAA,KAAK,CAACE,IAAN,CAAY,CAAE;AAAEC,IAAAA,EAAE,EAAEC;AAAN,GAAF,EAAiB;AAAED,IAAAA,EAAE,EAAEE;AAAN,GAAjB,KAAoC;AAC/C;AACA,QAAIC,MAAM,GAAGL,QAAQ,CAACM,OAAT,CAAkBH,KAAlB,CAAb;AACA,QAAII,MAAM,GAAGP,QAAQ,CAACM,OAAT,CAAkBF,KAAlB,CAAb,CAH+C,CAI/C;;AACA,QAAKC,MAAM,GAAG,CAAd,EAAkBA,MAAM,GAAGL,QAAQ,CAACQ,MAAlB;AAClB,QAAKD,MAAM,GAAG,CAAd,EAAkBA,MAAM,GAAGP,QAAQ,CAACQ,MAAlB;AAClB,WAAOH,MAAM,GAAGE,MAAhB;AACA,GARD;AAUA,SAAOR,KAAP;AACA,CAhBM","sourcesContent":["/** @typedef {import('../store/selectors').WPEditorInserterItem} WPEditorInserterItem */\n\n/**\n * Helper function to order inserter block items according to a provided array of prioritized blocks.\n *\n * @param {WPEditorInserterItem[]} items The array of editor inserter block items to be sorted.\n * @param {string[]} priority The array of block names to be prioritized.\n * @return {WPEditorInserterItem[]} The sorted array of editor inserter block items.\n */\nexport const orderInserterBlockItems = ( items, priority ) => {\n\tif ( ! priority ) {\n\t\treturn items;\n\t}\n\n\titems.sort( ( { id: aName }, { id: bName } ) => {\n\t\t// Sort block items according to `priority`.\n\t\tlet aIndex = priority.indexOf( aName );\n\t\tlet bIndex = priority.indexOf( bName );\n\t\t// All other block items should come after that.\n\t\tif ( aIndex < 0 ) aIndex = priority.length;\n\t\tif ( bIndex < 0 ) bIndex = priority.length;\n\t\treturn aIndex - bIndex;\n\t} );\n\n\treturn items;\n};\n"]}
|
|
@@ -13,7 +13,7 @@ exports.getPxFromCssUnit = getPxFromCssUnit;
|
|
|
13
13
|
* @return {Object} parsedUnit
|
|
14
14
|
*/
|
|
15
15
|
function parseUnit(cssUnit) {
|
|
16
|
-
const match = cssUnit
|
|
16
|
+
const match = cssUnit?.trim().match(/^(0?[-.]?\d*\.?\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/);
|
|
17
17
|
|
|
18
18
|
if (!isNaN(cssUnit) && !isNaN(parseFloat(cssUnit))) {
|
|
19
19
|
return {
|
|
@@ -261,9 +261,7 @@ function convertParsedUnitToPx(parsedUnit, options) {
|
|
|
261
261
|
*/
|
|
262
262
|
|
|
263
263
|
|
|
264
|
-
function getPxFromCssUnit(cssUnit) {
|
|
265
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
266
|
-
|
|
264
|
+
function getPxFromCssUnit(cssUnit, options = {}) {
|
|
267
265
|
if (Number.isFinite(cssUnit)) {
|
|
268
266
|
return cssUnit.toFixed(0) + 'px';
|
|
269
267
|
}
|
|
@@ -295,8 +293,7 @@ const cache = {};
|
|
|
295
293
|
* @return {string} returns the cssUnit value in a simple px format.
|
|
296
294
|
*/
|
|
297
295
|
|
|
298
|
-
function memoizedGetPxFromCssUnit(cssUnit) {
|
|
299
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
296
|
+
function memoizedGetPxFromCssUnit(cssUnit, options = {}) {
|
|
300
297
|
const hash = cssUnit + hashOptions(options);
|
|
301
298
|
|
|
302
299
|
if (!cache[hash]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/parse-css-unit-to-px.js"],"names":["parseUnit","cssUnit","match","trim","isNaN","parseFloat","value","unit","undefined","calculate","expression","Function","err","getFunctionUnitValue","functionUnitValue","options","functionUnit","split","filter","Boolean","units","slice","map","getPxFromCssUnit","Math","min","max","length","parseUnitFunction","currentCssUnit","regExp","matches","exec","replace","isMathExpression","i","includes","evalMathExpression","errorFound","cssUnitsBits","parsedUnit","expressionsMatches","values","currentValue","rawCurrentValue","calculatedExpression","calculatedValue","toFixed","parsedValue","calculatedResult","convertParsedUnitToPx","PIXELS_PER_INCH","ONE_PERCENT","defaultProperties","fontSize","lineHeight","width","height","type","setOptions","Object","assign","relativeUnits","em","rem","vh","vw","vmin","vmax","ch","ex","lh","absoluteUnits","in","cm","mm","pt","pc","px","Q","Number","is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AAd,CAA5B;AACA,C,CAED;;;AACA,MAAMmE,KAAK,GAAG,EAAd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,wBAAT,CAAmClF,OAAnC,EAA2D;AAAA,MAAfc,OAAe,uEAAL,EAAK;AAC1D,QAAMqE,IAAI,GAAGnF,OAAO,GAAGoF,WAAW,CAAEtE,OAAF,CAAlC;;AAEA,MAAK,CAAEmE,KAAK,CAAEE,IAAF,CAAZ,EAAuB;AACtBF,IAAAA,KAAK,CAAEE,IAAF,CAAL,GAAgB7D,gBAAgB,CAAEtB,OAAF,EAAWc,OAAX,CAAhC;AACA;;AACD,SAAOmE,KAAK,CAAEE,IAAF,CAAZ;AACA;;AAED,SAASC,WAAT,CAAsBtE,OAAtB,EAAgC;AAC/B,MAAIqE,IAAI,GAAG,EAAX;;AACA,MAAKrE,OAAO,CAACuE,cAAR,CAAwB,UAAxB,CAAL,EAA4C;AAC3CF,IAAAA,IAAI,GAAG,MAAMrE,OAAO,CAACyC,KAArB;AACA;;AACD,MAAKzC,OAAO,CAACuE,cAAR,CAAwB,YAAxB,CAAL,EAA8C;AAC7CF,IAAAA,IAAI,GAAG,MAAMrE,OAAO,CAACwC,UAArB;AACA;;AACD,MAAKxC,OAAO,CAACuE,cAAR,CAAwB,OAAxB,CAAL,EAAyC;AACxCF,IAAAA,IAAI,GAAG,MAAMrE,OAAO,CAACyC,KAArB;AACA;;AACD,MAAKzC,OAAO,CAACuE,cAAR,CAAwB,QAAxB,CAAL,EAA0C;AACzCF,IAAAA,IAAI,GAAG,MAAMrE,OAAO,CAAC0C,MAArB;AACA;;AACD,MAAK1C,OAAO,CAACuE,cAAR,CAAwB,MAAxB,CAAL,EAAwC;AACvCF,IAAAA,IAAI,GAAG,MAAMrE,OAAO,CAAC2C,IAArB;AACA;;AACD,SAAO0B,IAAP;AACA;;eAEcD,wB","sourcesContent":["/**\n * Converts string to object { value, unit }.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit\n */\nfunction parseUnit( cssUnit ) {\n\tconst match = cssUnit\n\t\t?.trim()\n\t\t.match(\n\t\t\t/^(0?[-.]?\\d*\\.?\\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/\n\t\t);\n\tif ( ! isNaN( cssUnit ) && ! isNaN( parseFloat( cssUnit ) ) ) {\n\t\treturn { value: parseFloat( cssUnit ), unit: 'px' };\n\t}\n\treturn match\n\t\t? { value: parseFloat( match[ 1 ] ) || match[ 1 ], unit: match[ 2 ] }\n\t\t: { value: cssUnit, unit: undefined };\n}\n/**\n * Evaluate a math expression.\n *\n * @param {string} expression\n * @return {number} evaluated expression.\n */\nfunction calculate( expression ) {\n\ttry {\n\t\treturn Function( `'use strict'; return (${ expression })` )();\n\t} catch ( err ) {\n\t\treturn null;\n\t}\n}\n\n/**\n * Calculates the css function value for the supported css functions such as max, min, clamp and calc.\n *\n * @param {string} functionUnitValue string should be in a particular format (for example min(12px,12px) ) no nested loops.\n * @param {Object} options\n * @return {string} unit containing the unit in PX.\n */\nfunction getFunctionUnitValue( functionUnitValue, options ) {\n\tconst functionUnit = functionUnitValue.split( /[(),]/g ).filter( Boolean );\n\n\tconst units = functionUnit\n\t\t.slice( 1 )\n\t\t.map( ( unit ) => parseUnit( getPxFromCssUnit( unit, options ) ).value )\n\t\t.filter( Boolean );\n\n\tswitch ( functionUnit[ 0 ] ) {\n\t\tcase 'min':\n\t\t\treturn Math.min( ...units ) + 'px';\n\t\tcase 'max':\n\t\t\treturn Math.max( ...units ) + 'px';\n\t\tcase 'clamp':\n\t\t\tif ( units.length !== 3 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif ( units[ 1 ] < units[ 0 ] ) {\n\t\t\t\treturn units[ 0 ] + 'px';\n\t\t\t}\n\t\t\tif ( units[ 1 ] > units[ 2 ] ) {\n\t\t\t\treturn units[ 2 ] + 'px';\n\t\t\t}\n\t\t\treturn units[ 1 ] + 'px';\n\t\tcase 'calc':\n\t\t\treturn units[ 0 ] + 'px';\n\t}\n}\n\n/**\n * Take a css function such as min, max, calc, clamp and returns parsedUnit\n *\n * How this works for the nested function is that it first replaces the inner function call.\n * Then it tackles the outer onces.\n * So for example: min( max(25px, 35px), 40px )\n * in the first pass we would replace max(25px, 35px) with 35px.\n * then we would try to evaluate min( 35px, 40px )\n * and then finally return 35px.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit object.\n */\nfunction parseUnitFunction( cssUnit ) {\n\twhile ( true ) {\n\t\tconst currentCssUnit = cssUnit;\n\t\tconst regExp = /(max|min|calc|clamp)\\(([^()]*)\\)/g;\n\t\tconst matches = regExp.exec( cssUnit ) || [];\n\t\tif ( matches[ 0 ] ) {\n\t\t\tconst functionUnitValue = getFunctionUnitValue( matches[ 0 ] );\n\t\t\tcssUnit = cssUnit.replace( matches[ 0 ], functionUnitValue );\n\t\t}\n\n\t\t// If the unit hasn't been modified or we have a single value break free.\n\t\tif ( cssUnit === currentCssUnit || parseFloat( cssUnit ) ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn parseUnit( cssUnit );\n}\n/**\n * Return true if we think this is a math expression.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {boolean} Whether the cssUnit is a math expression.\n */\nfunction isMathExpression( cssUnit ) {\n\tfor ( let i = 0; i < cssUnit.length; i++ ) {\n\t\tif ( [ '+', '-', '/', '*' ].includes( cssUnit[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n/**\n * Evaluates the math expression and return a px value.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {string} return a converfted value to px.\n */\nfunction evalMathExpression( cssUnit ) {\n\tlet errorFound = false;\n\t// Convert every part of the expression to px values.\n\t// The following regex matches numbers that have a following unit\n\t// E.g. 5.25rem, 1vw\n\tconst cssUnitsBits = cssUnit.match( /\\d+\\.?\\d*[a-zA-Z]+|\\.\\d+[a-zA-Z]+/g );\n\tif ( cssUnitsBits ) {\n\t\tfor ( const unit of cssUnitsBits ) {\n\t\t\t// Standardize the unit to px and extract the value.\n\t\t\tconst parsedUnit = parseUnit( getPxFromCssUnit( unit ) );\n\t\t\tif ( ! parseFloat( parsedUnit.value ) ) {\n\t\t\t\terrorFound = true;\n\t\t\t\t// End early since we are dealing with a null value.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcssUnit = cssUnit.replace( unit, parsedUnit.value );\n\t\t}\n\t} else {\n\t\terrorFound = true;\n\t}\n\n\t// For mixed math expressions wrapped within CSS expressions\n\tconst expressionsMatches = cssUnit.match( /(max|min|clamp)/g );\n\tif ( ! errorFound && expressionsMatches ) {\n\t\tconst values = cssUnit.split( ',' );\n\t\tfor ( const currentValue of values ) {\n\t\t\t// Check for nested calc() and remove them to calculate the value.\n\t\t\tconst rawCurrentValue = currentValue.replace( /\\s|calc/g, '' );\n\n\t\t\tif ( isMathExpression( rawCurrentValue ) ) {\n\t\t\t\tconst calculatedExpression = calculate( rawCurrentValue );\n\n\t\t\t\tif ( calculatedExpression ) {\n\t\t\t\t\tconst calculatedValue =\n\t\t\t\t\t\tcalculatedExpression.toFixed( 0 ) + 'px';\n\t\t\t\t\tcssUnit = cssUnit.replace( currentValue, calculatedValue );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst parsedValue = parseUnitFunction( cssUnit );\n\t\treturn ! parsedValue ? null : parsedValue.value + parsedValue.unit;\n\t}\n\n\tif ( errorFound ) {\n\t\treturn null;\n\t}\n\n\tconst calculatedResult = calculate( cssUnit );\n\treturn calculatedResult ? calculatedResult.toFixed( 0 ) + 'px' : null;\n}\n\n/**\n * Convert a parsedUnit object to px value.\n *\n * @param {Object} parsedUnit\n * @param {Object} options\n * @return {string} or {null} returns the converted with in a px value format.\n */\nfunction convertParsedUnitToPx( parsedUnit, options ) {\n\tconst PIXELS_PER_INCH = 96;\n\tconst ONE_PERCENT = 0.01;\n\n\tconst defaultProperties = {\n\t\tfontSize: 16,\n\t\tlineHeight: 16,\n\t\twidth: 375,\n\t\theight: 812,\n\t\ttype: 'font',\n\t};\n\n\tconst setOptions = Object.assign( {}, defaultProperties, options );\n\n\tconst relativeUnits = {\n\t\tem: setOptions.fontSize,\n\t\trem: setOptions.fontSize,\n\t\tvh: setOptions.height * ONE_PERCENT,\n\t\tvw: setOptions.width * ONE_PERCENT,\n\t\tvmin:\n\t\t\t( setOptions.width < setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\tvmax:\n\t\t\t( setOptions.width > setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\t'%':\n\t\t\t( setOptions.type === 'font'\n\t\t\t\t? setOptions.fontSize\n\t\t\t\t: setOptions.width ) * ONE_PERCENT,\n\t\tch: 8, // The advance measure (width) of the glyph \"0\" of the element's font. Approximate\n\t\tex: 7.15625, // X-height of the element's font. Approximate.\n\t\tlh: setOptions.lineHeight,\n\t};\n\n\tconst absoluteUnits = {\n\t\tin: PIXELS_PER_INCH,\n\t\tcm: PIXELS_PER_INCH / 2.54,\n\t\tmm: PIXELS_PER_INCH / 25.4,\n\t\tpt: PIXELS_PER_INCH / 72,\n\t\tpc: PIXELS_PER_INCH / 6,\n\t\tpx: 1,\n\t\tQ: PIXELS_PER_INCH / 2.54 / 40,\n\t};\n\n\tif ( relativeUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( relativeUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\tif ( absoluteUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( absoluteUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\treturn null;\n}\n\n/**\n * Returns the px value of a cssUnit.\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nexport function getPxFromCssUnit( cssUnit, options = {} ) {\n\tif ( Number.isFinite( cssUnit ) ) {\n\t\treturn cssUnit.toFixed( 0 ) + 'px';\n\t}\n\tif ( cssUnit === undefined ) {\n\t\treturn null;\n\t}\n\tlet parsedUnit = parseUnit( cssUnit );\n\n\tif ( ! parsedUnit.unit ) {\n\t\tparsedUnit = parseUnitFunction( cssUnit );\n\t}\n\n\tif ( isMathExpression( cssUnit ) && ! parsedUnit.unit ) {\n\t\treturn evalMathExpression( cssUnit );\n\t}\n\n\treturn convertParsedUnitToPx( parsedUnit, options );\n}\n\n// Use simple cache.\nconst cache = {};\n/**\n * Returns the px value of a cssUnit. The memoized version of getPxFromCssUnit;\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nfunction memoizedGetPxFromCssUnit( cssUnit, options = {} ) {\n\tconst hash = cssUnit + hashOptions( options );\n\n\tif ( ! cache[ hash ] ) {\n\t\tcache[ hash ] = getPxFromCssUnit( cssUnit, options );\n\t}\n\treturn cache[ hash ];\n}\n\nfunction hashOptions( options ) {\n\tlet hash = '';\n\tif ( options.hasOwnProperty( 'fontSize' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'lineHeight' ) ) {\n\t\thash = ':' + options.lineHeight;\n\t}\n\tif ( options.hasOwnProperty( 'width' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'height' ) ) {\n\t\thash = ':' + options.height;\n\t}\n\tif ( options.hasOwnProperty( 'type' ) ) {\n\t\thash = ':' + options.type;\n\t}\n\treturn hash;\n}\n\nexport default memoizedGetPxFromCssUnit;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/parse-css-unit-to-px.js"],"names":["parseUnit","cssUnit","match","trim","isNaN","parseFloat","value","unit","undefined","calculate","expression","Function","err","getFunctionUnitValue","functionUnitValue","options","functionUnit","split","filter","Boolean","units","slice","map","getPxFromCssUnit","Math","min","max","length","parseUnitFunction","currentCssUnit","regExp","matches","exec","replace","isMathExpression","i","includes","evalMathExpression","errorFound","cssUnitsBits","parsedUnit","expressionsMatches","values","currentValue","rawCurrentValue","calculatedExpression","calculatedValue","toFixed","parsedValue","calculatedResult","convertParsedUnitToPx","PIXELS_PER_INCH","ONE_PERCENT","defaultProperties","fontSize","lineHeight","width","height","type","setOptions","Object","assign","relativeUnits","em","rem","vh","vw","vmin","vmax","ch","ex","lh","absoluteUnits","in","cm","mm","pt","pc","px","Q","Number","isFinite","cache","memoizedGetPxFromCssUnit","hash","hashOptions","hasOwnProperty"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,SAAT,CAAoBC,OAApB,EAA8B;AAC7B,QAAMC,KAAK,GAAGD,OAAO,EAClBE,IADW,GAEZD,KAFY,CAGZ,6EAHY,CAAd;;AAKA,MAAK,CAAEE,KAAK,CAAEH,OAAF,CAAP,IAAsB,CAAEG,KAAK,CAAEC,UAAU,CAAEJ,OAAF,CAAZ,CAAlC,EAA8D;AAC7D,WAAO;AAAEK,MAAAA,KAAK,EAAED,UAAU,CAAEJ,OAAF,CAAnB;AAAgCM,MAAAA,IAAI,EAAE;AAAtC,KAAP;AACA;;AACD,SAAOL,KAAK,GACT;AAAEI,IAAAA,KAAK,EAAED,UAAU,CAAEH,KAAK,CAAE,CAAF,CAAP,CAAV,IAA4BA,KAAK,CAAE,CAAF,CAA1C;AAAiDK,IAAAA,IAAI,EAAEL,KAAK,CAAE,CAAF;AAA5D,GADS,GAET;AAAEI,IAAAA,KAAK,EAAEL,OAAT;AAAkBM,IAAAA,IAAI,EAAEC;AAAxB,GAFH;AAGA;AACD;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,SAAT,CAAoBC,UAApB,EAAiC;AAChC,MAAI;AACH,WAAOC,QAAQ,CAAG,yBAAyBD,UAAY,GAAxC,CAAR,EAAP;AACA,GAFD,CAEE,OAAQE,GAAR,E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AL,EAA0C;AACzCF,IAAAA,IAAI,GAAG,MAAMrE,OAAO,CAAC0C,MAArB;AACA;;AACD,MAAK1C,OAAO,CAACuE,cAAR,CAAwB,MAAxB,CAAL,EAAwC;AACvCF,IAAAA,IAAI,GAAG,MAAMrE,OAAO,CAAC2C,IAArB;AACA;;AACD,SAAO0B,IAAP;AACA;;eAEcD,wB","sourcesContent":["/**\n * Converts string to object { value, unit }.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit\n */\nfunction parseUnit( cssUnit ) {\n\tconst match = cssUnit\n\t\t?.trim()\n\t\t.match(\n\t\t\t/^(0?[-.]?\\d*\\.?\\d+)(r?e[m|x]|v[h|w|min|max]+|p[x|t|c]|[c|m]m|%|in|ch|Q|lh)$/\n\t\t);\n\tif ( ! isNaN( cssUnit ) && ! isNaN( parseFloat( cssUnit ) ) ) {\n\t\treturn { value: parseFloat( cssUnit ), unit: 'px' };\n\t}\n\treturn match\n\t\t? { value: parseFloat( match[ 1 ] ) || match[ 1 ], unit: match[ 2 ] }\n\t\t: { value: cssUnit, unit: undefined };\n}\n/**\n * Evaluate a math expression.\n *\n * @param {string} expression\n * @return {number} evaluated expression.\n */\nfunction calculate( expression ) {\n\ttry {\n\t\treturn Function( `'use strict'; return (${ expression })` )();\n\t} catch ( err ) {\n\t\treturn null;\n\t}\n}\n\n/**\n * Calculates the css function value for the supported css functions such as max, min, clamp and calc.\n *\n * @param {string} functionUnitValue string should be in a particular format (for example min(12px,12px) ) no nested loops.\n * @param {Object} options\n * @return {string} unit containing the unit in PX.\n */\nfunction getFunctionUnitValue( functionUnitValue, options ) {\n\tconst functionUnit = functionUnitValue.split( /[(),]/g ).filter( Boolean );\n\n\tconst units = functionUnit\n\t\t.slice( 1 )\n\t\t.map( ( unit ) => parseUnit( getPxFromCssUnit( unit, options ) ).value )\n\t\t.filter( Boolean );\n\n\tswitch ( functionUnit[ 0 ] ) {\n\t\tcase 'min':\n\t\t\treturn Math.min( ...units ) + 'px';\n\t\tcase 'max':\n\t\t\treturn Math.max( ...units ) + 'px';\n\t\tcase 'clamp':\n\t\t\tif ( units.length !== 3 ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif ( units[ 1 ] < units[ 0 ] ) {\n\t\t\t\treturn units[ 0 ] + 'px';\n\t\t\t}\n\t\t\tif ( units[ 1 ] > units[ 2 ] ) {\n\t\t\t\treturn units[ 2 ] + 'px';\n\t\t\t}\n\t\t\treturn units[ 1 ] + 'px';\n\t\tcase 'calc':\n\t\t\treturn units[ 0 ] + 'px';\n\t}\n}\n\n/**\n * Take a css function such as min, max, calc, clamp and returns parsedUnit\n *\n * How this works for the nested function is that it first replaces the inner function call.\n * Then it tackles the outer onces.\n * So for example: min( max(25px, 35px), 40px )\n * in the first pass we would replace max(25px, 35px) with 35px.\n * then we would try to evaluate min( 35px, 40px )\n * and then finally return 35px.\n *\n * @param {string} cssUnit\n * @return {Object} parsedUnit object.\n */\nfunction parseUnitFunction( cssUnit ) {\n\twhile ( true ) {\n\t\tconst currentCssUnit = cssUnit;\n\t\tconst regExp = /(max|min|calc|clamp)\\(([^()]*)\\)/g;\n\t\tconst matches = regExp.exec( cssUnit ) || [];\n\t\tif ( matches[ 0 ] ) {\n\t\t\tconst functionUnitValue = getFunctionUnitValue( matches[ 0 ] );\n\t\t\tcssUnit = cssUnit.replace( matches[ 0 ], functionUnitValue );\n\t\t}\n\n\t\t// If the unit hasn't been modified or we have a single value break free.\n\t\tif ( cssUnit === currentCssUnit || parseFloat( cssUnit ) ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn parseUnit( cssUnit );\n}\n/**\n * Return true if we think this is a math expression.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {boolean} Whether the cssUnit is a math expression.\n */\nfunction isMathExpression( cssUnit ) {\n\tfor ( let i = 0; i < cssUnit.length; i++ ) {\n\t\tif ( [ '+', '-', '/', '*' ].includes( cssUnit[ i ] ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n/**\n * Evaluates the math expression and return a px value.\n *\n * @param {string} cssUnit the cssUnit value being evaluted.\n * @return {string} return a converfted value to px.\n */\nfunction evalMathExpression( cssUnit ) {\n\tlet errorFound = false;\n\t// Convert every part of the expression to px values.\n\t// The following regex matches numbers that have a following unit\n\t// E.g. 5.25rem, 1vw\n\tconst cssUnitsBits = cssUnit.match( /\\d+\\.?\\d*[a-zA-Z]+|\\.\\d+[a-zA-Z]+/g );\n\tif ( cssUnitsBits ) {\n\t\tfor ( const unit of cssUnitsBits ) {\n\t\t\t// Standardize the unit to px and extract the value.\n\t\t\tconst parsedUnit = parseUnit( getPxFromCssUnit( unit ) );\n\t\t\tif ( ! parseFloat( parsedUnit.value ) ) {\n\t\t\t\terrorFound = true;\n\t\t\t\t// End early since we are dealing with a null value.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcssUnit = cssUnit.replace( unit, parsedUnit.value );\n\t\t}\n\t} else {\n\t\terrorFound = true;\n\t}\n\n\t// For mixed math expressions wrapped within CSS expressions\n\tconst expressionsMatches = cssUnit.match( /(max|min|clamp)/g );\n\tif ( ! errorFound && expressionsMatches ) {\n\t\tconst values = cssUnit.split( ',' );\n\t\tfor ( const currentValue of values ) {\n\t\t\t// Check for nested calc() and remove them to calculate the value.\n\t\t\tconst rawCurrentValue = currentValue.replace( /\\s|calc/g, '' );\n\n\t\t\tif ( isMathExpression( rawCurrentValue ) ) {\n\t\t\t\tconst calculatedExpression = calculate( rawCurrentValue );\n\n\t\t\t\tif ( calculatedExpression ) {\n\t\t\t\t\tconst calculatedValue =\n\t\t\t\t\t\tcalculatedExpression.toFixed( 0 ) + 'px';\n\t\t\t\t\tcssUnit = cssUnit.replace( currentValue, calculatedValue );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst parsedValue = parseUnitFunction( cssUnit );\n\t\treturn ! parsedValue ? null : parsedValue.value + parsedValue.unit;\n\t}\n\n\tif ( errorFound ) {\n\t\treturn null;\n\t}\n\n\tconst calculatedResult = calculate( cssUnit );\n\treturn calculatedResult ? calculatedResult.toFixed( 0 ) + 'px' : null;\n}\n\n/**\n * Convert a parsedUnit object to px value.\n *\n * @param {Object} parsedUnit\n * @param {Object} options\n * @return {string} or {null} returns the converted with in a px value format.\n */\nfunction convertParsedUnitToPx( parsedUnit, options ) {\n\tconst PIXELS_PER_INCH = 96;\n\tconst ONE_PERCENT = 0.01;\n\n\tconst defaultProperties = {\n\t\tfontSize: 16,\n\t\tlineHeight: 16,\n\t\twidth: 375,\n\t\theight: 812,\n\t\ttype: 'font',\n\t};\n\n\tconst setOptions = Object.assign( {}, defaultProperties, options );\n\n\tconst relativeUnits = {\n\t\tem: setOptions.fontSize,\n\t\trem: setOptions.fontSize,\n\t\tvh: setOptions.height * ONE_PERCENT,\n\t\tvw: setOptions.width * ONE_PERCENT,\n\t\tvmin:\n\t\t\t( setOptions.width < setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\tvmax:\n\t\t\t( setOptions.width > setOptions.height\n\t\t\t\t? setOptions.width\n\t\t\t\t: setOptions.height ) * ONE_PERCENT,\n\t\t'%':\n\t\t\t( setOptions.type === 'font'\n\t\t\t\t? setOptions.fontSize\n\t\t\t\t: setOptions.width ) * ONE_PERCENT,\n\t\tch: 8, // The advance measure (width) of the glyph \"0\" of the element's font. Approximate\n\t\tex: 7.15625, // X-height of the element's font. Approximate.\n\t\tlh: setOptions.lineHeight,\n\t};\n\n\tconst absoluteUnits = {\n\t\tin: PIXELS_PER_INCH,\n\t\tcm: PIXELS_PER_INCH / 2.54,\n\t\tmm: PIXELS_PER_INCH / 25.4,\n\t\tpt: PIXELS_PER_INCH / 72,\n\t\tpc: PIXELS_PER_INCH / 6,\n\t\tpx: 1,\n\t\tQ: PIXELS_PER_INCH / 2.54 / 40,\n\t};\n\n\tif ( relativeUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( relativeUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\tif ( absoluteUnits[ parsedUnit.unit ] ) {\n\t\treturn (\n\t\t\t( absoluteUnits[ parsedUnit.unit ] * parsedUnit.value ).toFixed(\n\t\t\t\t0\n\t\t\t) + 'px'\n\t\t);\n\t}\n\n\treturn null;\n}\n\n/**\n * Returns the px value of a cssUnit.\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nexport function getPxFromCssUnit( cssUnit, options = {} ) {\n\tif ( Number.isFinite( cssUnit ) ) {\n\t\treturn cssUnit.toFixed( 0 ) + 'px';\n\t}\n\tif ( cssUnit === undefined ) {\n\t\treturn null;\n\t}\n\tlet parsedUnit = parseUnit( cssUnit );\n\n\tif ( ! parsedUnit.unit ) {\n\t\tparsedUnit = parseUnitFunction( cssUnit );\n\t}\n\n\tif ( isMathExpression( cssUnit ) && ! parsedUnit.unit ) {\n\t\treturn evalMathExpression( cssUnit );\n\t}\n\n\treturn convertParsedUnitToPx( parsedUnit, options );\n}\n\n// Use simple cache.\nconst cache = {};\n/**\n * Returns the px value of a cssUnit. The memoized version of getPxFromCssUnit;\n *\n * @param {string} cssUnit\n * @param {Object} options\n * @return {string} returns the cssUnit value in a simple px format.\n */\nfunction memoizedGetPxFromCssUnit( cssUnit, options = {} ) {\n\tconst hash = cssUnit + hashOptions( options );\n\n\tif ( ! cache[ hash ] ) {\n\t\tcache[ hash ] = getPxFromCssUnit( cssUnit, options );\n\t}\n\treturn cache[ hash ];\n}\n\nfunction hashOptions( options ) {\n\tlet hash = '';\n\tif ( options.hasOwnProperty( 'fontSize' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'lineHeight' ) ) {\n\t\thash = ':' + options.lineHeight;\n\t}\n\tif ( options.hasOwnProperty( 'width' ) ) {\n\t\thash = ':' + options.width;\n\t}\n\tif ( options.hasOwnProperty( 'height' ) ) {\n\t\thash = ':' + options.height;\n\t}\n\tif ( options.hasOwnProperty( 'type' ) ) {\n\t\thash = ':' + options.type;\n\t}\n\treturn hash;\n}\n\nexport default memoizedGetPxFromCssUnit;\n"]}
|
package/build/utils/pasting.js
CHANGED
|
@@ -11,10 +11,9 @@ var _dom = require("@wordpress/dom");
|
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
|
-
function getPasteEventData(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = _ref;
|
|
14
|
+
function getPasteEventData({
|
|
15
|
+
clipboardData
|
|
16
|
+
}) {
|
|
18
17
|
let plainText = '';
|
|
19
18
|
let html = ''; // IE11 only supports `Text` as an argument for `getData` and will
|
|
20
19
|
// otherwise throw an invalid argument error, so we try the standard
|
|
@@ -70,15 +69,13 @@ function shouldDismissPastedFiles(files, html
|
|
|
70
69
|
) {
|
|
71
70
|
// The question is only relevant when there is actual HTML content and when
|
|
72
71
|
// there is exactly one image file.
|
|
73
|
-
if (html &&
|
|
74
|
-
var _html$match;
|
|
75
|
-
|
|
72
|
+
if (html && files?.length === 1 && files[0].type.indexOf('image/') === 0) {
|
|
76
73
|
// A single <img> tag found in the HTML source suggests that the
|
|
77
74
|
// content being pasted revolves around an image. Sometimes there are
|
|
78
75
|
// other elements found, like <figure>, but we assume that the user's
|
|
79
76
|
// intention is to paste the actual image file.
|
|
80
77
|
const IMAGE_TAG = /<\s*img\b/gi;
|
|
81
|
-
if (
|
|
78
|
+
if (html.match(IMAGE_TAG)?.length !== 1) return true; // Even when there is exactly one <img> tag in the HTML payload, we
|
|
82
79
|
// choose to weed out local images, i.e. those whose source starts with
|
|
83
80
|
// "file://". These payloads occur in specific configurations, such as
|
|
84
81
|
// when copying an entire document from Microsoft Word, that contains
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/pasting.js"],"names":["getPasteEventData","clipboardData","plainText","html","getData","error1","error2","files","length","shouldDismissPastedFiles","type","indexOf","IMAGE_TAG","match","IMG_WITH_LOCAL_SRC"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,SAASA,iBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/pasting.js"],"names":["getPasteEventData","clipboardData","plainText","html","getData","error1","error2","files","length","shouldDismissPastedFiles","type","indexOf","IMAGE_TAG","match","IMG_WITH_LOCAL_SRC"],"mappings":";;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,SAASA,iBAAT,CAA4B;AAAEC,EAAAA;AAAF,CAA5B,EAAgD;AACtD,MAAIC,SAAS,GAAG,EAAhB;AACA,MAAIC,IAAI,GAAG,EAAX,CAFsD,CAItD;AACA;AACA;;AACA,MAAI;AACHD,IAAAA,SAAS,GAAGD,aAAa,CAACG,OAAd,CAAuB,YAAvB,CAAZ;AACAD,IAAAA,IAAI,GAAGF,aAAa,CAACG,OAAd,CAAuB,WAAvB,CAAP;AACA,GAHD,CAGE,OAAQC,MAAR,EAAiB;AAClB,QAAI;AACHF,MAAAA,IAAI,GAAGF,aAAa,CAACG,OAAd,CAAuB,MAAvB,CAAP;AACA,KAFD,CAEE,OAAQE,MAAR,EAAiB;AAClB;AACA;AACA;AACA;AACA;AACD;;AAED,QAAMC,KAAK,GAAG,mCAA0BN,aAA1B,CAAd;;AAEA,MACCM,KAAK,CAACC,MAAN,IACA,CAAEC,wBAAwB,CAAEF,KAAF,EAASJ,IAAT,EAAeD,SAAf,CAF3B,EAGE;AACD,WAAO;AAAEK,MAAAA;AAAF,KAAP;AACA;;AAED,SAAO;AAAEJ,IAAAA,IAAF;AAAQD,IAAAA,SAAR;AAAmBK,IAAAA,KAAK,EAAE;AAA1B,GAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASE,wBAAT,CAAmCF,KAAnC,EAA0CJ;AAAK;AAA/C,EAAkE;AACxE;AACA;AACA,MACCA,IAAI,IACJI,KAAK,EAAEC,MAAP,KAAkB,CADlB,IAEAD,KAAK,CAAE,CAAF,CAAL,CAAWG,IAAX,CAAgBC,OAAhB,CAAyB,QAAzB,MAAwC,CAHzC,EAIE;AACD;AACA;AACA;AACA;AACA,UAAMC,SAAS,GAAG,aAAlB;AACA,QAAKT,IAAI,CAACU,KAAL,CAAYD,SAAZ,GAAyBJ,MAAzB,KAAoC,CAAzC,EAA6C,OAAO,IAAP,CAN5C,CAQD;AACA;AACA;AACA;AACA;AACA;;AACA,UAAMM,kBAAkB,GAAG,iCAA3B;AACA,QAAKX,IAAI,CAACU,KAAL,CAAYC,kBAAZ,CAAL,EAAwC,OAAO,IAAP;AACxC;;AAED,SAAO,KAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\n\nexport function getPasteEventData( { clipboardData } ) {\n\tlet plainText = '';\n\tlet html = '';\n\n\t// IE11 only supports `Text` as an argument for `getData` and will\n\t// otherwise throw an invalid argument error, so we try the standard\n\t// arguments first, then fallback to `Text` if they fail.\n\ttry {\n\t\tplainText = clipboardData.getData( 'text/plain' );\n\t\thtml = clipboardData.getData( 'text/html' );\n\t} catch ( error1 ) {\n\t\ttry {\n\t\t\thtml = clipboardData.getData( 'Text' );\n\t\t} catch ( error2 ) {\n\t\t\t// Some browsers like UC Browser paste plain text by default and\n\t\t\t// don't support clipboardData at all, so allow default\n\t\t\t// behaviour.\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst files = getFilesFromDataTransfer( clipboardData );\n\n\tif (\n\t\tfiles.length &&\n\t\t! shouldDismissPastedFiles( files, html, plainText )\n\t) {\n\t\treturn { files };\n\t}\n\n\treturn { html, plainText, files: [] };\n}\n\n/**\n * Given a collection of DataTransfer files and HTML and plain text strings,\n * determine whether the files are to be dismissed in favor of the HTML.\n *\n * Certain office-type programs, like Microsoft Word or Apple Numbers,\n * will, upon copy, generate a screenshot of the content being copied and\n * attach it to the clipboard alongside the actual rich text that the user\n * sought to copy. In those cases, we should let Gutenberg handle the rich text\n * content and not the screenshot, since this allows Gutenberg to insert\n * meaningful blocks, like paragraphs, lists or even tables.\n *\n * @param {File[]} files File objects obtained from a paste event\n * @param {string} html HTML content obtained from a paste event\n * @return {boolean} True if the files should be dismissed\n */\nexport function shouldDismissPastedFiles( files, html /*, plainText */ ) {\n\t// The question is only relevant when there is actual HTML content and when\n\t// there is exactly one image file.\n\tif (\n\t\thtml &&\n\t\tfiles?.length === 1 &&\n\t\tfiles[ 0 ].type.indexOf( 'image/' ) === 0\n\t) {\n\t\t// A single <img> tag found in the HTML source suggests that the\n\t\t// content being pasted revolves around an image. Sometimes there are\n\t\t// other elements found, like <figure>, but we assume that the user's\n\t\t// intention is to paste the actual image file.\n\t\tconst IMAGE_TAG = /<\\s*img\\b/gi;\n\t\tif ( html.match( IMAGE_TAG )?.length !== 1 ) return true;\n\n\t\t// Even when there is exactly one <img> tag in the HTML payload, we\n\t\t// choose to weed out local images, i.e. those whose source starts with\n\t\t// \"file://\". These payloads occur in specific configurations, such as\n\t\t// when copying an entire document from Microsoft Word, that contains\n\t\t// text and exactly one image, and pasting that content using Google\n\t\t// Chrome.\n\t\tconst IMG_WITH_LOCAL_SRC = /<\\s*img\\b[^>]*\\bsrc=\"file:\\/\\//i;\n\t\tif ( html.match( IMG_WITH_LOCAL_SRC ) ) return true;\n\t}\n\n\treturn false;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/pre-parse-patterns.js"],"names":["requestIdleCallback","window","callback","setTimeout","Date","now","requestAnimationFrame","cancelIdleCallback","clearTimeout","cancelAnimationFrame","usePreParsePatterns","patterns","isPreviewMode","_select","__experimentalBlockPatterns","__unstableIsPreviewMode","blockEditorStore","getSettings","length","handle","index","__experimentalGetParsedPattern","name"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,CAAE,MAAM;AACnC,MAAK,OAAOC,MAAP,KAAkB,WAAvB,EAAqC;AACpC,WAASC,QAAF,IAAgB;AACtBC,MAAAA,UAAU,CAAE,MAAMD,QAAQ,CAAEE,IAAI,CAACC,GAAL,EAAF,CAAhB,EAAgC,CAAhC,CAAV;AACA,KAFD;AAGA;;AAED,SAAOJ,MAAM,CAACD,mBAAP,IAA8BC,MAAM,CAACK,qBAA5C;AACA,CAR2B,GAA5B;;AAUA,MAAMC,kBAAkB,GAAG,CAAE,MAAM;AAClC,MAAK,OAAON,MAAP,KAAkB,WAAvB,EAAqC;AACpC,WAAOO,YAAP;AACA;;AAED,SAAOP,MAAM,CAACM,kBAAP,IAA6BN,MAAM,CAACQ,oBAA3C;AACA,CAN0B,GAA3B;;AAQO,SAASC,mBAAT,GAA+B;AACrC,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA8B,qBAAaC,OAAF,IAAe;AAC7D,UAAM;AAAEC,MAAAA,2BAAF;AAA+BC,MAAAA;AAA/B,QACLF,OAAO,CAAEG,YAAF,CAAP,CAA4BC,WAA5B,EADD;;AAEA,WAAO;AACNN,MAAAA,QAAQ,EAAEG,2BADJ;AAENF,MAAAA,aAAa,EAAEG;AAFT,KAAP;AAIA,GAPmC,EAOjC,EAPiC,CAApC;AASA,0BAAW,MAAM;AAChB,QAAKH,aAAL,EAAqB;AACpB;AACA;;AACD,QAAK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/pre-parse-patterns.js"],"names":["requestIdleCallback","window","callback","setTimeout","Date","now","requestAnimationFrame","cancelIdleCallback","clearTimeout","cancelAnimationFrame","usePreParsePatterns","patterns","isPreviewMode","_select","__experimentalBlockPatterns","__unstableIsPreviewMode","blockEditorStore","getSettings","length","handle","index","__experimentalGetParsedPattern","name"],"mappings":";;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,mBAA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AAmB,CAAEE,QAAF,CAA5B;AACA,KAXD;;AAaAiB,IAAAA,MAAM,GAAGnB,mBAAmB,CAAEE,QAAF,CAA5B;AACA,WAAO,MAAMK,kBAAkB,CAAEY,MAAF,CAA/B;AACA,GA1BD,EA0BG,CAAER,QAAF,EAAYC,aAAZ,CA1BH;AA4BA,SAAO,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, select } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\n\nconst requestIdleCallback = ( () => {\n\tif ( typeof window === 'undefined' ) {\n\t\treturn ( callback ) => {\n\t\t\tsetTimeout( () => callback( Date.now() ), 0 );\n\t\t};\n\t}\n\n\treturn window.requestIdleCallback || window.requestAnimationFrame;\n} )();\n\nconst cancelIdleCallback = ( () => {\n\tif ( typeof window === 'undefined' ) {\n\t\treturn clearTimeout;\n\t}\n\n\treturn window.cancelIdleCallback || window.cancelAnimationFrame;\n} )();\n\nexport function usePreParsePatterns() {\n\tconst { patterns, isPreviewMode } = useSelect( ( _select ) => {\n\t\tconst { __experimentalBlockPatterns, __unstableIsPreviewMode } =\n\t\t\t_select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tpatterns: __experimentalBlockPatterns,\n\t\t\tisPreviewMode: __unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( isPreviewMode ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( ! patterns?.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet handle;\n\t\tlet index = -1;\n\n\t\tconst callback = () => {\n\t\t\tindex++;\n\t\t\tif ( index >= patterns.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tselect( blockEditorStore ).__experimentalGetParsedPattern(\n\t\t\t\tpatterns[ index ].name\n\t\t\t);\n\n\t\t\thandle = requestIdleCallback( callback );\n\t\t};\n\n\t\thandle = requestIdleCallback( callback );\n\t\treturn () => cancelIdleCallback( handle );\n\t}, [ patterns, isPreviewMode ] );\n\n\treturn null;\n}\n"]}
|
package/build/utils/sorting.js
CHANGED
|
@@ -56,8 +56,7 @@ const comparator = (field, items, order) => {
|
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
function orderBy(items, field) {
|
|
60
|
-
let order = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'asc';
|
|
59
|
+
function orderBy(items, field, order = 'asc') {
|
|
61
60
|
return items.concat().sort(comparator(field, items, order));
|
|
62
61
|
}
|
|
63
62
|
//# sourceMappingURL=sorting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/sorting.js"],"names":["comparator","field","items","order","a","b","cmpA","cmpB","orderA","findIndex","item","orderB","orderBy","concat","sort"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,CAAEC,KAAF,EAASC,KAAT,EAAgBC,KAAhB,KAA2B;AAC7C,SAAO,CAAEC,CAAF,EAAKC,CAAL,KAAY;AAClB,QAAIC,IAAJ,EAAUC,IAAV;;AAEA,QAAK,OAAON,KAAP,KAAiB,UAAtB,EAAmC;AAClCK,MAAAA,IAAI,GAAGL,KAAK,CAAEG,CAAF,CAAZ;AACAG,MAAAA,IAAI,GAAGN,KAAK,CAAEI,CAAF,CAAZ;AACA,KAHD,MAGO;AACNC,MAAAA,IAAI,GAAGF,CAAC,CAAEH,KAAF,CAAR;AACAM,MAAAA,IAAI,GAAGF,CAAC,CAAEJ,KAAF,CAAR;AACA;;AAED,QAAKK,IAAI,GAAGC,IAAZ,EAAmB;AAClB,aAAOJ,KAAK,KAAK,KAAV,GAAkB,CAAlB,GAAsB,CAAC,CAA9B;AACA,KAFD,MAEO,IAAKI,IAAI,GAAGD,IAAZ,EAAmB;AACzB,aAAOH,KAAK,KAAK,KAAV,GAAkB,CAAC,CAAnB,GAAuB,CAA9B;AACA;;AAED,UAAMK,MAAM,GAAGN,KAAK,CAACO,SAAN,CAAmBC,IAAF,IAAYA,IAAI,KAAKN,CAAtC,CAAf;AACA,UAAMO,MAAM,GAAGT,KAAK,CAACO,SAAN,CAAmBC,IAAF,IAAYA,IAAI,KAAKL,CAAtC,CAAf,CAlBkB,CAoBlB;;AACA,QAAKG,MAAM,GAAGG,MAAd,EAAuB;AACtB,aAAO,CAAP;AACA,KAFD,MAEO,IAAKA,MAAM,GAAGH,MAAd,EAAuB;AAC7B,aAAO,CAAC,CAAR;AACA;;AAED,WAAO,CAAP;AACA,GA5BD;AA6BA,CA9BD;AAgCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,OAAT,CAAkBV,KAAlB,EAAyBD,KAAzB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/sorting.js"],"names":["comparator","field","items","order","a","b","cmpA","cmpB","orderA","findIndex","item","orderB","orderBy","concat","sort"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG,CAAEC,KAAF,EAASC,KAAT,EAAgBC,KAAhB,KAA2B;AAC7C,SAAO,CAAEC,CAAF,EAAKC,CAAL,KAAY;AAClB,QAAIC,IAAJ,EAAUC,IAAV;;AAEA,QAAK,OAAON,KAAP,KAAiB,UAAtB,EAAmC;AAClCK,MAAAA,IAAI,GAAGL,KAAK,CAAEG,CAAF,CAAZ;AACAG,MAAAA,IAAI,GAAGN,KAAK,CAAEI,CAAF,CAAZ;AACA,KAHD,MAGO;AACNC,MAAAA,IAAI,GAAGF,CAAC,CAAEH,KAAF,CAAR;AACAM,MAAAA,IAAI,GAAGF,CAAC,CAAEJ,KAAF,CAAR;AACA;;AAED,QAAKK,IAAI,GAAGC,IAAZ,EAAmB;AAClB,aAAOJ,KAAK,KAAK,KAAV,GAAkB,CAAlB,GAAsB,CAAC,CAA9B;AACA,KAFD,MAEO,IAAKI,IAAI,GAAGD,IAAZ,EAAmB;AACzB,aAAOH,KAAK,KAAK,KAAV,GAAkB,CAAC,CAAnB,GAAuB,CAA9B;AACA;;AAED,UAAMK,MAAM,GAAGN,KAAK,CAACO,SAAN,CAAmBC,IAAF,IAAYA,IAAI,KAAKN,CAAtC,CAAf;AACA,UAAMO,MAAM,GAAGT,KAAK,CAACO,SAAN,CAAmBC,IAAF,IAAYA,IAAI,KAAKL,CAAtC,CAAf,CAlBkB,CAoBlB;;AACA,QAAKG,MAAM,GAAGG,MAAd,EAAuB;AACtB,aAAO,CAAP;AACA,KAFD,MAEO,IAAKA,MAAM,GAAGH,MAAd,EAAuB;AAC7B,aAAO,CAAC,CAAR;AACA;;AAED,WAAO,CAAP;AACA,GA5BD;AA6BA,CA9BD;AAgCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,OAAT,CAAkBV,KAAlB,EAAyBD,KAAzB,EAAgCE,KAAK,GAAG,KAAxC,EAAgD;AACtD,SAAOD,KAAK,CAACW,MAAN,GAAeC,IAAf,CAAqBd,UAAU,CAAEC,KAAF,EAASC,KAAT,EAAgBC,KAAhB,CAA/B,CAAP;AACA","sourcesContent":["/**\n * Recursive stable sorting comparator function.\n *\n * @param {string|Function} field Field to sort by.\n * @param {Array} items Items to sort.\n * @param {string} order Order, 'asc' or 'desc'.\n * @return {Function} Comparison function to be used in a `.sort()`.\n */\nconst comparator = ( field, items, order ) => {\n\treturn ( a, b ) => {\n\t\tlet cmpA, cmpB;\n\n\t\tif ( typeof field === 'function' ) {\n\t\t\tcmpA = field( a );\n\t\t\tcmpB = field( b );\n\t\t} else {\n\t\t\tcmpA = a[ field ];\n\t\t\tcmpB = b[ field ];\n\t\t}\n\n\t\tif ( cmpA > cmpB ) {\n\t\t\treturn order === 'asc' ? 1 : -1;\n\t\t} else if ( cmpB > cmpA ) {\n\t\t\treturn order === 'asc' ? -1 : 1;\n\t\t}\n\n\t\tconst orderA = items.findIndex( ( item ) => item === a );\n\t\tconst orderB = items.findIndex( ( item ) => item === b );\n\n\t\t// Stable sort: maintaining original array order\n\t\tif ( orderA > orderB ) {\n\t\t\treturn 1;\n\t\t} else if ( orderB > orderA ) {\n\t\t\treturn -1;\n\t\t}\n\n\t\treturn 0;\n\t};\n};\n\n/**\n * Order items by a certain key.\n * Supports decorator functions that allow complex picking of a comparison field.\n * Sorts in ascending order by default, but supports descending as well.\n * Stable sort - maintains original order of equal items.\n *\n * @param {Array} items Items to order.\n * @param {string|Function} field Field to order by.\n * @param {string} order Sorting order, `asc` or `desc`.\n * @return {Array} Sorted items.\n */\nexport function orderBy( items, field, order = 'asc' ) {\n\treturn items.concat().sort( comparator( field, items, order ) );\n}\n"]}
|
|
@@ -30,13 +30,11 @@ var _wrap = _interopRequireDefault(require("./transforms/wrap"));
|
|
|
30
30
|
* @param {string} wrapperClassName Wrapper Class Name.
|
|
31
31
|
* @return {Array} converted rules.
|
|
32
32
|
*/
|
|
33
|
-
const transformStyles =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
baseURL
|
|
39
|
-
} = _ref;
|
|
33
|
+
const transformStyles = (styles, wrapperClassName = '') => {
|
|
34
|
+
return Object.values(styles !== null && styles !== void 0 ? styles : []).map(({
|
|
35
|
+
css,
|
|
36
|
+
baseURL
|
|
37
|
+
}) => {
|
|
40
38
|
const transforms = [];
|
|
41
39
|
|
|
42
40
|
if (wrapperClassName) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"names":["transformStyles","styles","wrapperClassName","Object","values","map","css","baseURL","transforms","push","length"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,eAAe,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/transform-styles/index.js"],"names":["transformStyles","styles","wrapperClassName","Object","values","map","css","baseURL","transforms","push","length"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,eAAe,GAAG,CAAEC,MAAF,EAAUC,gBAAgB,GAAG,EAA7B,KAAqC;AAC5D,SAAOC,MAAM,CAACC,MAAP,CAAeH,MAAf,aAAeA,MAAf,cAAeA,MAAf,GAAyB,EAAzB,EAA8BI,GAA9B,CAAmC,CAAE;AAAEC,IAAAA,GAAF;AAAOC,IAAAA;AAAP,GAAF,KAAwB;AACjE,UAAMC,UAAU,GAAG,EAAnB;;AACA,QAAKN,gBAAL,EAAwB;AACvBM,MAAAA,UAAU,CAACC,IAAX,CAAiB,mBAAMP,gBAAN,CAAjB;AACA;;AACD,QAAKK,OAAL,EAAe;AACdC,MAAAA,UAAU,CAACC,IAAX,CAAiB,yBAAYF,OAAZ,CAAjB;AACA;;AACD,QAAKC,UAAU,CAACE,MAAhB,EAAyB;AACxB,aAAO,uBAAUJ,GAAV,EAAe,sBAASE,UAAT,CAAf,CAAP;AACA;;AAED,WAAOF,GAAP;AACA,GAbM,CAAP;AAcA,CAfD;;eAiBeN,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport traverse from './traverse';\nimport urlRewrite from './transforms/url-rewrite';\nimport wrap from './transforms/wrap';\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 {Object|Array} styles CSS rules.\n * @param {string} wrapperClassName Wrapper Class Name.\n * @return {Array} converted rules.\n */\nconst transformStyles = ( styles, wrapperClassName = '' ) => {\n\treturn Object.values( styles ?? [] ).map( ( { css, baseURL } ) => {\n\t\tconst transforms = [];\n\t\tif ( wrapperClassName ) {\n\t\t\ttransforms.push( wrap( wrapperClassName ) );\n\t\t}\n\t\tif ( baseURL ) {\n\t\t\ttransforms.push( urlRewrite( baseURL ) );\n\t\t}\n\t\tif ( transforms.length ) {\n\t\t\treturn traverse( css, compose( transforms ) );\n\t\t}\n\n\t\treturn css;\n\t} );\n};\n\nexport default transformStyles;\n"]}
|
|
@@ -19,39 +19,36 @@ const IS_ROOT_TAG = /^(body|html|:root).*$/;
|
|
|
19
19
|
* @return {(node: Object) => Object} Callback to wrap selectors.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
const wrap =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return selector.replace(/^(body|html|:root)/, namespace);
|
|
45
|
-
};
|
|
22
|
+
const wrap = (namespace, ignore = []) => node => {
|
|
23
|
+
/**
|
|
24
|
+
* Updates selector if necessary.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} selector Selector to modify.
|
|
27
|
+
*
|
|
28
|
+
* @return {string} Updated selector.
|
|
29
|
+
*/
|
|
30
|
+
const updateSelector = selector => {
|
|
31
|
+
if (ignore.includes(selector.trim())) {
|
|
32
|
+
return selector;
|
|
33
|
+
} // Anything other than a root tag is always prefixed.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
{
|
|
37
|
+
if (!selector.match(IS_ROOT_TAG)) {
|
|
38
|
+
return namespace + ' ' + selector;
|
|
39
|
+
}
|
|
40
|
+
} // HTML and Body elements cannot be contained within our container so lets extract their styles.
|
|
41
|
+
|
|
42
|
+
return selector.replace(/^(body|html|:root)/, namespace);
|
|
43
|
+
};
|
|
46
44
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
if (node.type === 'rule') {
|
|
46
|
+
return { ...node,
|
|
47
|
+
selectors: node.selectors.map(updateSelector)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
52
50
|
|
|
53
|
-
|
|
54
|
-
};
|
|
51
|
+
return node;
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
var _default = wrap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-editor/src/utils/transform-styles/transforms/wrap.js"],"names":["IS_ROOT_TAG","wrap","namespace","ignore","node","updateSelector","selector","includes","trim","match","replace","type","selectors","map"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,MAAMA,WAAW,GAAG,uBAApB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,IAAI,GACT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-editor/src/utils/transform-styles/transforms/wrap.js"],"names":["IS_ROOT_TAG","wrap","namespace","ignore","node","updateSelector","selector","includes","trim","match","replace","type","selectors","map"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,MAAMA,WAAW,GAAG,uBAApB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,IAAI,GACT,CAAEC,SAAF,EAAaC,MAAM,GAAG,EAAtB,KACEC,IAAF,IAAY;AACX;AACF;AACA;AACA;AACA;AACA;AACA;AACE,QAAMC,cAAc,GAAKC,QAAF,IAAgB;AACtC,QAAKH,MAAM,CAACI,QAAP,CAAiBD,QAAQ,CAACE,IAAT,EAAjB,CAAL,EAA0C;AACzC,aAAOF,QAAP;AACA,KAHqC,CAKtC;;;AACA;AACC,UAAK,CAAEA,QAAQ,CAACG,KAAT,CAAgBT,WAAhB,CAAP,EAAuC;AACtC,eAAOE,SAAS,GAAG,GAAZ,GAAkBI,QAAzB;AACA;AACD,KAVqC,CAYtC;;AACA,WAAOA,QAAQ,CAACI,OAAT,CAAkB,oBAAlB,EAAwCR,SAAxC,CAAP;AACA,GAdD;;AAgBA,MAAKE,IAAI,CAACO,IAAL,KAAc,MAAnB,EAA4B;AAC3B,WAAO,EACN,GAAGP,IADG;AAENQ,MAAAA,SAAS,EAAER,IAAI,CAACQ,SAAL,CAAeC,GAAf,CAAoBR,cAApB;AAFL,KAAP;AAIA;;AAED,SAAOD,IAAP;AACA,CAlCF;;eAoCeH,I","sourcesContent":["/**\n * @constant string IS_ROOT_TAG Regex to check if the selector is a root tag selector.\n */\nconst IS_ROOT_TAG = /^(body|html|:root).*$/;\n\n/**\n * Creates a callback to modify selectors so they only apply within a certain\n * namespace.\n *\n * @param {string} namespace Namespace to prefix selectors with.\n * @param {string[]} ignore Selectors to not prefix.\n *\n * @return {(node: Object) => Object} Callback to wrap selectors.\n */\nconst wrap =\n\t( namespace, ignore = [] ) =>\n\t( node ) => {\n\t\t/**\n\t\t * Updates selector if necessary.\n\t\t *\n\t\t * @param {string} selector Selector to modify.\n\t\t *\n\t\t * @return {string} Updated selector.\n\t\t */\n\t\tconst updateSelector = ( selector ) => {\n\t\t\tif ( ignore.includes( selector.trim() ) ) {\n\t\t\t\treturn selector;\n\t\t\t}\n\n\t\t\t// Anything other than a root tag is always prefixed.\n\t\t\t{\n\t\t\t\tif ( ! selector.match( IS_ROOT_TAG ) ) {\n\t\t\t\t\treturn namespace + ' ' + selector;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// HTML and Body elements cannot be contained within our container so lets extract their styles.\n\t\t\treturn selector.replace( /^(body|html|:root)/, namespace );\n\t\t};\n\n\t\tif ( node.type === 'rule' ) {\n\t\t\treturn {\n\t\t\t\t...node,\n\t\t\t\tselectors: node.selectors.map( updateSelector ),\n\t\t\t};\n\t\t}\n\n\t\treturn node;\n\t};\n\nexport default wrap;\n"]}
|
|
@@ -40,20 +40,20 @@ function createBlockCompleter() {
|
|
|
40
40
|
selectedBlockName,
|
|
41
41
|
prioritizedBlocks
|
|
42
42
|
} = useSelect(select => {
|
|
43
|
-
var _getBlockListSettings;
|
|
44
|
-
|
|
45
43
|
const {
|
|
46
44
|
getSelectedBlockClientId,
|
|
47
45
|
getBlockName,
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
getBlockListSettings,
|
|
47
|
+
getBlockRootClientId
|
|
50
48
|
} = select(blockEditorStore);
|
|
51
49
|
const selectedBlockClientId = getSelectedBlockClientId();
|
|
52
|
-
|
|
50
|
+
|
|
51
|
+
const _rootClientId = getBlockRootClientId(selectedBlockClientId);
|
|
52
|
+
|
|
53
53
|
return {
|
|
54
54
|
selectedBlockName: selectedBlockClientId ? getBlockName(selectedBlockClientId) : null,
|
|
55
55
|
rootClientId: _rootClientId,
|
|
56
|
-
prioritizedBlocks:
|
|
56
|
+
prioritizedBlocks: getBlockListSettings(_rootClientId)?.prioritizedInserterBlocks
|
|
57
57
|
};
|
|
58
58
|
}, []);
|
|
59
59
|
const [items, categories, collections] = useBlockTypesState(rootClientId, noop);
|