@wordpress/block-editor 12.11.1 → 12.12.2-next.f8d8eceb.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -10
- package/README.md +35 -3
- package/build/components/block-alignment-control/use-available-alignments.js +30 -28
- package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build/components/block-controls/hook.js +4 -1
- package/build/components/block-controls/hook.js.map +1 -1
- package/build/components/block-list/block-outline.native.js +1 -1
- package/build/components/block-list/block-outline.native.js.map +1 -1
- package/build/components/block-list/block.js +2 -0
- package/build/components/block-list/block.js.map +1 -1
- package/build/components/block-list/block.native.js +4 -4
- package/build/components/block-list/block.native.js.map +1 -1
- package/build/components/block-list/layout.js +2 -3
- package/build/components/block-list/layout.js.map +1 -1
- package/build/components/block-preview/index.js +4 -1
- package/build/components/block-preview/index.js.map +1 -1
- package/build/components/block-styles/index.js +1 -2
- package/build/components/block-styles/index.js.map +1 -1
- package/build/components/block-switcher/pattern-transformations-menu.js +2 -4
- package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build/components/block-tools/block-contextual-toolbar.js +1 -0
- package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build/components/border-radius-control/index.js +3 -2
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/color-palette/with-color-context.js +6 -6
- package/build/components/color-palette/with-color-context.js.map +1 -1
- package/build/components/colors/with-colors.js +2 -8
- package/build/components/colors/with-colors.js.map +1 -1
- package/build/components/colors-gradients/control.js +6 -7
- package/build/components/colors-gradients/control.js.map +1 -1
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +5 -13
- package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build/components/dimensions-tool/index.js +22 -22
- package/build/components/dimensions-tool/index.js.map +1 -1
- package/build/components/dimensions-tool/scale-tool.js +1 -1
- package/build/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build/components/font-family/index.js +2 -3
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/font-sizes/font-size-picker.js +3 -5
- package/build/components/font-sizes/font-size-picker.js.map +1 -1
- package/build/components/font-sizes/with-font-sizes.js +3 -4
- package/build/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build/components/global-styles/filters-panel.js +7 -8
- package/build/components/global-styles/filters-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +2 -2
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/gradients/use-gradient.js +2 -5
- package/build/components/gradients/use-gradient.js.map +1 -1
- package/build/components/height-control/index.js +93 -5
- package/build/components/height-control/index.js.map +1 -1
- package/build/components/iframe/index.js +9 -1
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/image-editor/aspect-ratio-dropdown.js +0 -6
- package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
- package/build/components/index.js +9 -2
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js +17 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/inner-blocks/index.js +2 -2
- package/build/components/inner-blocks/index.js.map +1 -1
- package/build/components/letter-spacing-control/index.js +3 -3
- package/build/components/letter-spacing-control/index.js.map +1 -1
- package/build/components/link-control/link-preview.js +5 -2
- package/build/components/link-control/link-preview.js.map +1 -1
- package/build/components/link-control/search-item.js +11 -0
- package/build/components/link-control/search-item.js.map +1 -1
- package/build/components/link-control/search-results.js +2 -1
- package/build/components/link-control/search-results.js.map +1 -1
- package/build/components/link-control/use-internal-value.js +14 -8
- package/build/components/link-control/use-internal-value.js.map +1 -1
- package/build/components/link-control/use-search-handler.js +10 -5
- package/build/components/link-control/use-search-handler.js.map +1 -1
- package/build/components/list-view/index.js +6 -5
- package/build/components/list-view/index.js.map +1 -1
- package/build/components/media-replace-flow/index.js +2 -4
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/provider/use-block-sync.js +2 -2
- package/build/components/provider/use-block-sync.js.map +1 -1
- package/build/components/rich-text/index.js +1 -1
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/index.native.js +14 -3
- package/build/components/rich-text/index.native.js.map +1 -1
- package/build/components/rich-text/use-delete.js +1 -1
- package/build/components/rich-text/use-delete.js.map +1 -1
- package/build/components/rich-text/use-paste-handler.js +25 -22
- package/build/components/rich-text/use-paste-handler.js.map +1 -1
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +6 -3
- package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +91 -3
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/tool-selector/index.js +1 -2
- package/build/components/tool-selector/index.js.map +1 -1
- package/build/components/unit-control/index.js +3 -3
- package/build/components/unit-control/index.js.map +1 -1
- package/build/components/use-block-commands/index.js +96 -47
- package/build/components/use-block-commands/index.js.map +1 -1
- package/build/components/use-settings/index.js +212 -0
- package/build/components/use-settings/index.js.map +1 -0
- package/build/components/writing-flow/use-arrow-nav.js +4 -0
- package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build/hooks/align.js +51 -35
- package/build/hooks/align.js.map +1 -1
- package/build/hooks/anchor.js +37 -32
- package/build/hooks/anchor.js.map +1 -1
- package/build/hooks/background.js +4 -4
- package/build/hooks/background.js.map +1 -1
- package/build/hooks/block-rename-ui.js +5 -5
- package/build/hooks/block-rename-ui.js.map +1 -1
- package/build/hooks/{metadata-name.js → block-renaming.js} +3 -7
- package/build/hooks/block-renaming.js.map +1 -0
- package/build/hooks/color.js +2 -4
- package/build/hooks/color.js.map +1 -1
- package/build/hooks/custom-class-name.js +28 -21
- package/build/hooks/custom-class-name.js.map +1 -1
- package/build/hooks/duotone.js +33 -8
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/font-size.js +4 -4
- package/build/hooks/font-size.js.map +1 -1
- package/build/hooks/index.js +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/layout.js +16 -17
- package/build/hooks/layout.js.map +1 -1
- package/build/hooks/line-height.js +3 -3
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/metadata.js +6 -27
- package/build/hooks/metadata.js.map +1 -1
- package/build/hooks/position.js +2 -3
- package/build/hooks/position.js.map +1 -1
- package/build/hooks/use-color-props.js +3 -11
- package/build/hooks/use-color-props.js.map +1 -1
- package/build/hooks/utils.js +2 -43
- package/build/hooks/utils.js.map +1 -1
- package/build/layouts/constrained.js +3 -3
- package/build/layouts/constrained.js.map +1 -1
- package/build/layouts/grid.js +25 -3
- package/build/layouts/grid.js.map +1 -1
- package/build/layouts/utils.js +1 -1
- package/build/layouts/utils.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +13 -5
- package/build/store/actions.js.map +1 -1
- package/build/utils/object.js +4 -1
- package/build/utils/object.js.map +1 -1
- package/build/utils/parse-css-unit-to-px.js +20 -0
- package/build/utils/parse-css-unit-to-px.js.map +1 -1
- package/build/utils/pasting.js +1 -1
- package/build/utils/pasting.js.map +1 -1
- package/build/utils/transform-styles/index.js +19 -24
- package/build/utils/transform-styles/index.js.map +1 -1
- package/build-module/components/block-alignment-control/use-available-alignments.js +30 -28
- package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
- package/build-module/components/block-controls/hook.js +4 -1
- package/build-module/components/block-controls/hook.js.map +1 -1
- package/build-module/components/block-list/block-outline.native.js +1 -1
- package/build-module/components/block-list/block-outline.native.js.map +1 -1
- package/build-module/components/block-list/block.js +2 -0
- package/build-module/components/block-list/block.js.map +1 -1
- package/build-module/components/block-list/block.native.js +4 -4
- package/build-module/components/block-list/block.native.js.map +1 -1
- package/build-module/components/block-list/layout.js +2 -2
- package/build-module/components/block-list/layout.js.map +1 -1
- package/build-module/components/block-preview/index.js +4 -1
- package/build-module/components/block-preview/index.js.map +1 -1
- package/build-module/components/block-styles/index.js +1 -2
- package/build-module/components/block-styles/index.js.map +1 -1
- package/build-module/components/block-switcher/pattern-transformations-menu.js +2 -4
- package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
- package/build-module/components/block-tools/block-contextual-toolbar.js +1 -0
- package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
- package/build-module/components/border-radius-control/index.js +3 -2
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/color-palette/with-color-context.js +6 -5
- package/build-module/components/color-palette/with-color-context.js.map +1 -1
- package/build-module/components/colors/with-colors.js +2 -7
- package/build-module/components/colors/with-colors.js.map +1 -1
- package/build-module/components/colors-gradients/control.js +6 -7
- package/build-module/components/colors-gradients/control.js.map +1 -1
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +5 -12
- package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -1
- package/build-module/components/dimensions-tool/index.js +22 -22
- package/build-module/components/dimensions-tool/index.js.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build-module/components/font-family/index.js +2 -2
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/font-sizes/font-size-picker.js +3 -4
- package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
- package/build-module/components/font-sizes/with-font-sizes.js +3 -3
- package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
- package/build-module/components/global-styles/filters-panel.js +7 -8
- package/build-module/components/global-styles/filters-panel.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +2 -2
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/gradients/use-gradient.js +2 -4
- package/build-module/components/gradients/use-gradient.js.map +1 -1
- package/build-module/components/height-control/index.js +93 -4
- package/build-module/components/height-control/index.js.map +1 -1
- package/build-module/components/iframe/index.js +9 -1
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/image-editor/aspect-ratio-dropdown.js +0 -6
- package/build-module/components/image-editor/aspect-ratio-dropdown.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 +2 -1
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/inner-blocks/index.js +2 -2
- package/build-module/components/inner-blocks/index.js.map +1 -1
- package/build-module/components/letter-spacing-control/index.js +3 -2
- package/build-module/components/letter-spacing-control/index.js.map +1 -1
- package/build-module/components/link-control/link-preview.js +6 -3
- package/build-module/components/link-control/link-preview.js.map +1 -1
- package/build-module/components/link-control/search-item.js +12 -1
- package/build-module/components/link-control/search-item.js.map +1 -1
- package/build-module/components/link-control/search-results.js +2 -1
- package/build-module/components/link-control/search-results.js.map +1 -1
- package/build-module/components/link-control/use-internal-value.js +14 -9
- package/build-module/components/link-control/use-internal-value.js.map +1 -1
- package/build-module/components/link-control/use-search-handler.js +10 -5
- package/build-module/components/link-control/use-search-handler.js.map +1 -1
- package/build-module/components/list-view/index.js +7 -6
- package/build-module/components/list-view/index.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +3 -5
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/provider/use-block-sync.js +2 -2
- package/build-module/components/provider/use-block-sync.js.map +1 -1
- package/build-module/components/rich-text/index.js +1 -1
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/index.native.js +15 -4
- package/build-module/components/rich-text/index.native.js.map +1 -1
- package/build-module/components/rich-text/use-delete.js +1 -1
- package/build-module/components/rich-text/use-delete.js.map +1 -1
- package/build-module/components/rich-text/use-paste-handler.js +25 -22
- package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +6 -2
- package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +91 -2
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/tool-selector/index.js +1 -2
- package/build-module/components/tool-selector/index.js.map +1 -1
- package/build-module/components/unit-control/index.js +3 -2
- package/build-module/components/unit-control/index.js.map +1 -1
- package/build-module/components/use-block-commands/index.js +95 -47
- package/build-module/components/use-block-commands/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +203 -0
- package/build-module/components/use-settings/index.js.map +1 -0
- package/build-module/components/writing-flow/use-arrow-nav.js +4 -0
- package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
- package/build-module/hooks/align.js +51 -35
- package/build-module/hooks/align.js.map +1 -1
- package/build-module/hooks/anchor.js +37 -32
- package/build-module/hooks/anchor.js.map +1 -1
- package/build-module/hooks/background.js +4 -4
- package/build-module/hooks/background.js.map +1 -1
- package/build-module/hooks/block-rename-ui.js +6 -6
- package/build-module/hooks/block-rename-ui.js.map +1 -1
- package/build-module/hooks/{metadata-name.js → block-renaming.js} +3 -6
- package/build-module/hooks/block-renaming.js.map +1 -0
- package/build-module/hooks/color.js +2 -4
- package/build-module/hooks/color.js.map +1 -1
- package/build-module/hooks/custom-class-name.js +28 -21
- package/build-module/hooks/custom-class-name.js.map +1 -1
- package/build-module/hooks/duotone.js +34 -9
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/font-size.js +4 -4
- package/build-module/hooks/font-size.js.map +1 -1
- package/build-module/hooks/index.js +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/layout.js +16 -17
- package/build-module/hooks/layout.js.map +1 -1
- package/build-module/hooks/line-height.js +3 -3
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/metadata.js +6 -25
- package/build-module/hooks/metadata.js.map +1 -1
- package/build-module/hooks/position.js +2 -3
- package/build-module/hooks/position.js.map +1 -1
- package/build-module/hooks/use-color-props.js +3 -11
- package/build-module/hooks/use-color-props.js.map +1 -1
- package/build-module/hooks/utils.js +3 -44
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/layouts/constrained.js +3 -2
- package/build-module/layouts/constrained.js.map +1 -1
- package/build-module/layouts/grid.js +25 -3
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/layouts/utils.js +1 -1
- package/build-module/layouts/utils.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js +14 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/object.js +3 -1
- package/build-module/utils/object.js.map +1 -1
- package/build-module/utils/parse-css-unit-to-px.js +20 -0
- package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
- package/build-module/utils/pasting.js +1 -1
- package/build-module/utils/pasting.js.map +1 -1
- package/build-module/utils/transform-styles/index.js +20 -24
- package/build-module/utils/transform-styles/index.js.map +1 -1
- package/build-style/style-rtl.css +24 -12
- package/build-style/style.css +24 -12
- package/package.json +36 -34
- package/src/components/block-alignment-control/use-available-alignments.js +49 -34
- package/src/components/block-controls/hook.js +6 -3
- package/src/components/block-list/block-outline.native.js +1 -1
- package/src/components/block-list/block.js +2 -0
- package/src/components/block-list/block.native.js +4 -4
- package/src/components/block-list/layout.js +2 -2
- package/src/components/block-preview/index.js +7 -1
- package/src/components/block-styles/index.js +1 -4
- package/src/components/block-styles/style.scss +1 -1
- package/src/components/block-switcher/pattern-transformations-menu.js +1 -4
- package/src/components/block-switcher/style.scss +6 -0
- package/src/components/block-tools/block-contextual-toolbar.js +1 -0
- package/src/components/block-tools/style.scss +0 -1
- package/src/components/border-radius-control/index.js +3 -2
- package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -1
- package/src/components/color-palette/with-color-context.js +9 -9
- package/src/components/colors/with-colors.js +6 -7
- package/src/components/colors-gradients/control.js +10 -7
- package/src/components/colors-gradients/style.scss +4 -2
- package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +29 -15
- package/src/components/dimensions-tool/index.js +25 -25
- package/src/components/dimensions-tool/scale-tool.js +1 -1
- package/src/components/font-family/index.js +2 -2
- package/src/components/font-sizes/font-size-picker.js +6 -4
- package/src/components/font-sizes/with-font-sizes.js +3 -5
- package/src/components/global-styles/filters-panel.js +9 -15
- package/src/components/global-styles/image-settings-panel.js +2 -2
- package/src/components/global-styles/typography-panel.js +1 -1
- package/src/components/gradients/use-gradient.js +10 -4
- package/src/components/height-control/index.js +53 -4
- package/src/components/iframe/index.js +8 -1
- package/src/components/image-editor/aspect-ratio-dropdown.js +0 -8
- package/src/components/index.js +1 -1
- package/src/components/index.native.js +2 -1
- package/src/components/inner-blocks/index.js +2 -2
- package/src/components/inserter/style.scss +9 -1
- package/src/components/letter-spacing-control/index.js +3 -2
- package/src/components/link-control/README.md +43 -0
- package/src/components/link-control/link-preview.js +11 -5
- package/src/components/link-control/search-item.js +14 -0
- package/src/components/link-control/search-results.js +1 -0
- package/src/components/link-control/style.scss +3 -3
- package/src/components/link-control/test/index.js +19 -0
- package/src/components/link-control/use-internal-value.js +14 -10
- package/src/components/link-control/use-search-handler.js +22 -15
- package/src/components/list-view/index.js +13 -3
- package/src/components/media-replace-flow/index.js +9 -14
- package/src/components/provider/test/use-block-sync.js +1 -1
- package/src/components/provider/use-block-sync.js +2 -2
- package/src/components/rich-text/index.js +1 -1
- package/src/components/rich-text/index.native.js +19 -3
- package/src/components/rich-text/use-delete.js +1 -1
- package/src/components/rich-text/use-paste-handler.js +27 -24
- package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +7 -5
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +25 -2
- package/src/components/tool-selector/index.js +1 -1
- package/src/components/unit-control/index.js +3 -8
- package/src/components/use-block-commands/index.js +93 -47
- package/src/components/{use-setting → use-settings}/README.md +9 -10
- package/src/components/use-settings/index.js +272 -0
- package/src/components/{use-setting → use-settings}/test/index.js +47 -5
- package/src/components/writing-flow/use-arrow-nav.js +4 -0
- package/src/hooks/align.js +79 -54
- package/src/hooks/anchor.js +75 -65
- package/src/hooks/background.js +7 -9
- package/src/hooks/block-rename-ui.js +5 -14
- package/src/hooks/{metadata-name.js → block-renaming.js} +4 -7
- package/src/hooks/color.js +7 -4
- package/src/hooks/custom-class-name.js +36 -31
- package/src/hooks/duotone.js +51 -14
- package/src/hooks/font-size.js +4 -4
- package/src/hooks/index.js +1 -1
- package/src/hooks/layout.js +17 -17
- package/src/hooks/line-height.js +3 -3
- package/src/hooks/metadata.js +6 -38
- package/src/hooks/position.js +5 -3
- package/src/hooks/use-color-props.js +21 -14
- package/src/hooks/utils.js +90 -43
- package/src/layouts/constrained.js +3 -8
- package/src/layouts/grid.js +50 -2
- package/src/layouts/utils.js +2 -1
- package/src/lock-unlock.js +1 -1
- package/src/store/actions.js +25 -8
- package/src/utils/object.js +4 -1
- package/src/utils/parse-css-unit-to-px.js +20 -0
- package/src/utils/pasting.js +1 -4
- package/src/utils/test/__snapshots__/transform-styles.js.snap +103 -0
- package/src/utils/test/pasting.js +12 -19
- package/src/utils/test/transform-styles.js +217 -0
- package/src/utils/transform-styles/index.js +25 -25
- package/build/components/use-setting/index.js +0 -159
- package/build/components/use-setting/index.js.map +0 -1
- package/build/hooks/metadata-name.js.map +0 -1
- package/build/utils/transform-styles/ast/index.js +0 -21
- package/build/utils/transform-styles/ast/index.js.map +0 -1
- package/build/utils/transform-styles/ast/parse.js +0 -660
- package/build/utils/transform-styles/ast/parse.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/compiler.js +0 -52
- package/build/utils/transform-styles/ast/stringify/compiler.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/compress.js +0 -178
- package/build/utils/transform-styles/ast/stringify/compress.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/identity.js +0 -207
- package/build/utils/transform-styles/ast/stringify/identity.js.map +0 -1
- package/build/utils/transform-styles/ast/stringify/index.js +0 -36
- package/build/utils/transform-styles/ast/stringify/index.js.map +0 -1
- package/build/utils/transform-styles/transforms/url-rewrite.js +0 -130
- package/build/utils/transform-styles/transforms/url-rewrite.js.map +0 -1
- package/build/utils/transform-styles/transforms/wrap.js +0 -59
- package/build/utils/transform-styles/transforms/wrap.js.map +0 -1
- package/build/utils/transform-styles/traverse.js +0 -37
- package/build/utils/transform-styles/traverse.js.map +0 -1
- package/build-module/components/use-setting/index.js +0 -152
- package/build-module/components/use-setting/index.js.map +0 -1
- package/build-module/hooks/metadata-name.js.map +0 -1
- package/build-module/utils/transform-styles/ast/index.js +0 -6
- package/build-module/utils/transform-styles/ast/index.js.map +0 -1
- package/build-module/utils/transform-styles/ast/parse.js +0 -654
- package/build-module/utils/transform-styles/ast/parse.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/compiler.js +0 -49
- package/build-module/utils/transform-styles/ast/stringify/compiler.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/compress.js +0 -176
- package/build-module/utils/transform-styles/ast/stringify/compress.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/identity.js +0 -206
- package/build-module/utils/transform-styles/ast/stringify/identity.js.map +0 -1
- package/build-module/utils/transform-styles/ast/stringify/index.js +0 -29
- package/build-module/utils/transform-styles/ast/stringify/index.js.map +0 -1
- package/build-module/utils/transform-styles/transforms/url-rewrite.js +0 -123
- package/build-module/utils/transform-styles/transforms/url-rewrite.js.map +0 -1
- package/build-module/utils/transform-styles/transforms/wrap.js +0 -52
- package/build-module/utils/transform-styles/transforms/wrap.js.map +0 -1
- package/build-module/utils/transform-styles/traverse.js +0 -28
- package/build-module/utils/transform-styles/traverse.js.map +0 -1
- package/src/components/use-setting/index.js +0 -213
- package/src/utils/transform-styles/ast/index.js +0 -5
- package/src/utils/transform-styles/ast/parse.js +0 -732
- package/src/utils/transform-styles/ast/stringify/compiler.js +0 -50
- package/src/utils/transform-styles/ast/stringify/compress.js +0 -238
- package/src/utils/transform-styles/ast/stringify/identity.js +0 -286
- package/src/utils/transform-styles/ast/stringify/index.js +0 -32
- package/src/utils/transform-styles/test/__snapshots__/traverse.js.snap +0 -7
- package/src/utils/transform-styles/test/traverse.js +0 -24
- package/src/utils/transform-styles/transforms/test/__snapshots__/url-rewrite.js.snap +0 -25
- package/src/utils/transform-styles/transforms/test/__snapshots__/wrap.js.snap +0 -64
- package/src/utils/transform-styles/transforms/test/url-rewrite.js +0 -39
- package/src/utils/transform-styles/transforms/test/wrap.js +0 -95
- package/src/utils/transform-styles/transforms/url-rewrite.js +0 -139
- package/src/utils/transform-styles/transforms/wrap.js +0 -56
- package/src/utils/transform-styles/traverse.js +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getBlockSupport","useMemo","useSetting","useSettingsForBlockElement","getValueFromObjectPath","setImmutably","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","shouldSkipSerialization","blockType","featureSet","feature","skipSerialization","__experimentalSkipSerialization","includes","useBlockSettings","name","parentLayout","fontFamilies","fontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","spacingSizes","units","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","rawSettings","color","palette","custom","theme","default","gradients","duotone","customGradient","background","link","heading","button","text","typography","spacing","border","radius","style","width","dimensions"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSetting } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization( blockType, featureSet, feature ) {\n\tconst support = getBlockSupport( blockType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst fontFamilies = useSetting( 'typography.fontFamilies' );\n\tconst fontSizes = useSetting( 'typography.fontSizes' );\n\tconst customFontSize = useSetting( 'typography.customFontSize' );\n\tconst fontStyle = useSetting( 'typography.fontStyle' );\n\tconst fontWeight = useSetting( 'typography.fontWeight' );\n\tconst lineHeight = useSetting( 'typography.lineHeight' );\n\tconst textColumns = useSetting( 'typography.textColumns' );\n\tconst textDecoration = useSetting( 'typography.textDecoration' );\n\tconst writingMode = useSetting( 'typography.writingMode' );\n\tconst textTransform = useSetting( 'typography.textTransform' );\n\tconst letterSpacing = useSetting( 'typography.letterSpacing' );\n\tconst padding = useSetting( 'spacing.padding' );\n\tconst margin = useSetting( 'spacing.margin' );\n\tconst blockGap = useSetting( 'spacing.blockGap' );\n\tconst spacingSizes = useSetting( 'spacing.spacingSizes' );\n\tconst units = useSetting( 'spacing.units' );\n\tconst minHeight = useSetting( 'dimensions.minHeight' );\n\tconst layout = useSetting( 'layout' );\n\tconst borderColor = useSetting( 'border.color' );\n\tconst borderRadius = useSetting( 'border.radius' );\n\tconst borderStyle = useSetting( 'border.style' );\n\tconst borderWidth = useSetting( 'border.width' );\n\tconst customColorsEnabled = useSetting( 'color.custom' );\n\tconst customColors = useSetting( 'color.palette.custom' );\n\tconst customDuotone = useSetting( 'color.customDuotone' );\n\tconst themeColors = useSetting( 'color.palette.theme' );\n\tconst defaultColors = useSetting( 'color.palette.default' );\n\tconst defaultPalette = useSetting( 'color.defaultPalette' );\n\tconst defaultDuotone = useSetting( 'color.defaultDuotone' );\n\tconst userDuotonePalette = useSetting( 'color.duotone.custom' );\n\tconst themeDuotonePalette = useSetting( 'color.duotone.theme' );\n\tconst defaultDuotonePalette = useSetting( 'color.duotone.default' );\n\tconst userGradientPalette = useSetting( 'color.gradients.custom' );\n\tconst themeGradientPalette = useSetting( 'color.gradients.theme' );\n\tconst defaultGradientPalette = useSetting( 'color.gradients.default' );\n\tconst defaultGradients = useSetting( 'color.defaultGradients' );\n\tconst areCustomGradientsEnabled = useSetting( 'color.customGradient' );\n\tconst isBackgroundEnabled = useSetting( 'color.background' );\n\tconst isLinkEnabled = useSetting( 'color.link' );\n\tconst isTextEnabled = useSetting( 'color.text' );\n\tconst isHeadingEnabled = useSetting( 'color.heading' );\n\tconst isButtonEnabled = useSetting( 'color.button' );\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: fontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: fontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: spacingSizes,\n\t\t\t\t},\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t};\n\t}, [\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,0BAA0B,QAAQ,mCAAmC;AAC9E,SAASC,sBAAsB,EAAEC,YAAY,QAAQ,iBAAiB;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAKC,MAAM,IAAM;EAC7C,IACCA,MAAM,KAAK,IAAI,IACf,OAAOA,MAAM,KAAK,QAAQ,IAC1BC,KAAK,CAACC,OAAO,CAAEF,MAAO,CAAC,EACtB;IACD,OAAOA,MAAM;EACd;EAEA,MAAMG,oBAAoB,GAAGC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EACnBC,oBAAoB,EACpBC,sBAAsB,EACtBC,gBAAgB,EAChBC,yBAAyB,EACzBC,mBAAmB,EACnBC,aAAa,EACbC,aAAa,CACZ,CAAC;EAEH,OAAOpF,0BAA0B,CAAEuF,WAAW,EAAE5C,IAAK,CAAC;AACvD"}
|
|
1
|
+
{"version":3,"names":["getBlockSupport","useMemo","useSettings","useSettingsForBlockElement","getValueFromObjectPath","setImmutably","cleanEmptyObject","object","Array","isArray","cleanedNestedObjects","Object","entries","map","key","value","filter","undefined","length","fromEntries","transformStyles","activeSupports","migrationPaths","result","source","index","results","values","every","isActive","innerBlocks","referenceBlockAttributes","attributes","returnBlock","forEach","support","path","styleValue","shouldSkipSerialization","blockType","featureSet","feature","skipSerialization","__experimentalSkipSerialization","includes","useBlockSettings","name","parentLayout","fontFamilies","fontSizes","customFontSize","fontStyle","fontWeight","lineHeight","textColumns","textDecoration","writingMode","textTransform","letterSpacing","padding","margin","blockGap","spacingSizes","units","minHeight","layout","borderColor","borderRadius","borderStyle","borderWidth","customColorsEnabled","customColors","customDuotone","themeColors","defaultColors","defaultPalette","defaultDuotone","userDuotonePalette","themeDuotonePalette","defaultDuotonePalette","userGradientPalette","themeGradientPalette","defaultGradientPalette","defaultGradients","areCustomGradientsEnabled","isBackgroundEnabled","isLinkEnabled","isTextEnabled","isHeadingEnabled","isButtonEnabled","rawSettings","color","palette","custom","theme","default","gradients","duotone","customGradient","background","link","heading","button","text","typography","spacing","border","radius","style","width","dimensions"],"sources":["@wordpress/block-editor/src/hooks/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../components';\nimport { useSettingsForBlockElement } from '../components/global-styles/hooks';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\n\n/**\n * Removed falsy values from nested object.\n *\n * @param {*} object\n * @return {*} Object cleaned from falsy values\n */\nexport const cleanEmptyObject = ( object ) => {\n\tif (\n\t\tobject === null ||\n\t\ttypeof object !== 'object' ||\n\t\tArray.isArray( object )\n\t) {\n\t\treturn object;\n\t}\n\n\tconst cleanedNestedObjects = Object.entries( object )\n\t\t.map( ( [ key, value ] ) => [ key, cleanEmptyObject( value ) ] )\n\t\t.filter( ( [ , value ] ) => value !== undefined );\n\treturn ! cleanedNestedObjects.length\n\t\t? undefined\n\t\t: Object.fromEntries( cleanedNestedObjects );\n};\n\nexport function transformStyles(\n\tactiveSupports,\n\tmigrationPaths,\n\tresult,\n\tsource,\n\tindex,\n\tresults\n) {\n\t// If there are no active supports return early.\n\tif (\n\t\tObject.values( activeSupports ?? {} ).every(\n\t\t\t( isActive ) => ! isActive\n\t\t)\n\t) {\n\t\treturn result;\n\t}\n\t// If the condition verifies we are probably in the presence of a wrapping transform\n\t// e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed.\n\tif ( results.length === 1 && result.innerBlocks.length === source.length ) {\n\t\treturn result;\n\t}\n\t// For cases where we have a transform from one block to multiple blocks\n\t// or multiple blocks to one block we apply the styles of the first source block\n\t// to the result(s).\n\tlet referenceBlockAttributes = source[ 0 ]?.attributes;\n\t// If we are in presence of transform between more than one block in the source\n\t// that has more than one block in the result\n\t// we apply the styles on source N to the result N,\n\t// if source N does not exists we do nothing.\n\tif ( results.length > 1 && source.length > 1 ) {\n\t\tif ( source[ index ] ) {\n\t\t\treferenceBlockAttributes = source[ index ]?.attributes;\n\t\t} else {\n\t\t\treturn result;\n\t\t}\n\t}\n\tlet returnBlock = result;\n\tObject.entries( activeSupports ).forEach( ( [ support, isActive ] ) => {\n\t\tif ( isActive ) {\n\t\t\tmigrationPaths[ support ].forEach( ( path ) => {\n\t\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\t\treferenceBlockAttributes,\n\t\t\t\t\tpath\n\t\t\t\t);\n\t\t\t\tif ( styleValue ) {\n\t\t\t\t\treturnBlock = {\n\t\t\t\t\t\t...returnBlock,\n\t\t\t\t\t\tattributes: setImmutably(\n\t\t\t\t\t\t\treturnBlock.attributes,\n\t\t\t\t\t\t\tpath,\n\t\t\t\t\t\t\tstyleValue\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\treturn returnBlock;\n}\n\n/**\n * Check whether serialization of specific block support feature or set should\n * be skipped.\n *\n * @param {string|Object} blockType Block name or block type object.\n * @param {string} featureSet Name of block support feature set.\n * @param {string} feature Name of the individual feature to check.\n *\n * @return {boolean} Whether serialization should occur.\n */\nexport function shouldSkipSerialization( blockType, featureSet, feature ) {\n\tconst support = getBlockSupport( blockType, featureSet );\n\tconst skipSerialization = support?.__experimentalSkipSerialization;\n\n\tif ( Array.isArray( skipSerialization ) ) {\n\t\treturn skipSerialization.includes( feature );\n\t}\n\n\treturn skipSerialization;\n}\n\n/**\n * Based on the block and its context, returns an object of all the block settings.\n * This object can be passed as a prop to all the Styles UI components\n * (TypographyPanel, DimensionsPanel...).\n *\n * @param {string} name Block name.\n * @param {*} parentLayout Parent layout.\n *\n * @return {Object} Settings object.\n */\nexport function useBlockSettings( name, parentLayout ) {\n\tconst [\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\twritingMode,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t] = useSettings(\n\t\t'typography.fontFamilies',\n\t\t'typography.fontSizes',\n\t\t'typography.customFontSize',\n\t\t'typography.fontStyle',\n\t\t'typography.fontWeight',\n\t\t'typography.lineHeight',\n\t\t'typography.textColumns',\n\t\t'typography.textDecoration',\n\t\t'typography.writingMode',\n\t\t'typography.textTransform',\n\t\t'typography.letterSpacing',\n\t\t'spacing.padding',\n\t\t'spacing.margin',\n\t\t'spacing.blockGap',\n\t\t'spacing.spacingSizes',\n\t\t'spacing.units',\n\t\t'dimensions.minHeight',\n\t\t'layout',\n\t\t'border.color',\n\t\t'border.radius',\n\t\t'border.style',\n\t\t'border.width',\n\t\t'color.custom',\n\t\t'color.palette.custom',\n\t\t'color.customDuotone',\n\t\t'color.palette.theme',\n\t\t'color.palette.default',\n\t\t'color.defaultPalette',\n\t\t'color.defaultDuotone',\n\t\t'color.duotone.custom',\n\t\t'color.duotone.theme',\n\t\t'color.duotone.default',\n\t\t'color.gradients.custom',\n\t\t'color.gradients.theme',\n\t\t'color.gradients.default',\n\t\t'color.defaultGradients',\n\t\t'color.customGradient',\n\t\t'color.background',\n\t\t'color.link',\n\t\t'color.text',\n\t\t'color.heading',\n\t\t'color.button'\n\t);\n\n\tconst rawSettings = useMemo( () => {\n\t\treturn {\n\t\t\tcolor: {\n\t\t\t\tpalette: {\n\t\t\t\t\tcustom: customColors,\n\t\t\t\t\ttheme: themeColors,\n\t\t\t\t\tdefault: defaultColors,\n\t\t\t\t},\n\t\t\t\tgradients: {\n\t\t\t\t\tcustom: userGradientPalette,\n\t\t\t\t\ttheme: themeGradientPalette,\n\t\t\t\t\tdefault: defaultGradientPalette,\n\t\t\t\t},\n\t\t\t\tduotone: {\n\t\t\t\t\tcustom: userDuotonePalette,\n\t\t\t\t\ttheme: themeDuotonePalette,\n\t\t\t\t\tdefault: defaultDuotonePalette,\n\t\t\t\t},\n\t\t\t\tdefaultGradients,\n\t\t\t\tdefaultPalette,\n\t\t\t\tdefaultDuotone,\n\t\t\t\tcustom: customColorsEnabled,\n\t\t\t\tcustomGradient: areCustomGradientsEnabled,\n\t\t\t\tcustomDuotone,\n\t\t\t\tbackground: isBackgroundEnabled,\n\t\t\t\tlink: isLinkEnabled,\n\t\t\t\theading: isHeadingEnabled,\n\t\t\t\tbutton: isButtonEnabled,\n\t\t\t\ttext: isTextEnabled,\n\t\t\t},\n\t\t\ttypography: {\n\t\t\t\tfontFamilies: {\n\t\t\t\t\tcustom: fontFamilies,\n\t\t\t\t},\n\t\t\t\tfontSizes: {\n\t\t\t\t\tcustom: fontSizes,\n\t\t\t\t},\n\t\t\t\tcustomFontSize,\n\t\t\t\tfontStyle,\n\t\t\t\tfontWeight,\n\t\t\t\tlineHeight,\n\t\t\t\ttextColumns,\n\t\t\t\ttextDecoration,\n\t\t\t\ttextTransform,\n\t\t\t\tletterSpacing,\n\t\t\t\twritingMode,\n\t\t\t},\n\t\t\tspacing: {\n\t\t\t\tspacingSizes: {\n\t\t\t\t\tcustom: spacingSizes,\n\t\t\t\t},\n\t\t\t\tpadding,\n\t\t\t\tmargin,\n\t\t\t\tblockGap,\n\t\t\t\tunits,\n\t\t\t},\n\t\t\tborder: {\n\t\t\t\tcolor: borderColor,\n\t\t\t\tradius: borderRadius,\n\t\t\t\tstyle: borderStyle,\n\t\t\t\twidth: borderWidth,\n\t\t\t},\n\t\t\tdimensions: {\n\t\t\t\tminHeight,\n\t\t\t},\n\t\t\tlayout,\n\t\t\tparentLayout,\n\t\t};\n\t}, [\n\t\tfontFamilies,\n\t\tfontSizes,\n\t\tcustomFontSize,\n\t\tfontStyle,\n\t\tfontWeight,\n\t\tlineHeight,\n\t\ttextColumns,\n\t\ttextDecoration,\n\t\ttextTransform,\n\t\tletterSpacing,\n\t\twritingMode,\n\t\tpadding,\n\t\tmargin,\n\t\tblockGap,\n\t\tspacingSizes,\n\t\tunits,\n\t\tminHeight,\n\t\tlayout,\n\t\tparentLayout,\n\t\tborderColor,\n\t\tborderRadius,\n\t\tborderStyle,\n\t\tborderWidth,\n\t\tcustomColorsEnabled,\n\t\tcustomColors,\n\t\tcustomDuotone,\n\t\tthemeColors,\n\t\tdefaultColors,\n\t\tdefaultPalette,\n\t\tdefaultDuotone,\n\t\tuserDuotonePalette,\n\t\tthemeDuotonePalette,\n\t\tdefaultDuotonePalette,\n\t\tuserGradientPalette,\n\t\tthemeGradientPalette,\n\t\tdefaultGradientPalette,\n\t\tdefaultGradients,\n\t\tareCustomGradientsEnabled,\n\t\tisBackgroundEnabled,\n\t\tisLinkEnabled,\n\t\tisTextEnabled,\n\t\tisHeadingEnabled,\n\t\tisButtonEnabled,\n\t] );\n\n\treturn useSettingsForBlockElement( rawSettings, name );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,mBAAmB;AACnD,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,0BAA0B,QAAQ,mCAAmC;AAC9E,SAASC,sBAAsB,EAAEC,YAAY,QAAQ,iBAAiB;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAKC,MAAM,IAAM;EAC7C,IACCA,MAAM,KAAK,IAAI,IACf,OAAOA,MAAM,KAAK,QAAQ,IAC1BC,KAAK,CAACC,OAAO,CAAEF,MAAO,CAAC,EACtB;IACD,OAAOA,MAAM;EACd;EAEA,MAAMG,oBAAoB,GAAGC,MAAM,CAACC,OAAO,CAAEL,MAAO,CAAC,CACnDM,GAAG,CAAE,CAAE,CAAEC,GAAG,EAAEC,KAAK,CAAE,KAAM,CAAED,GAAG,EAAER,gBAAgB,CAAES,KAAM,CAAC,CAAG,CAAC,CAC/DC,MAAM,C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d,CAAC;EAEH,OAAOtF,0BAA0B,CAAEuF,WAAW,EAAE5C,IAAK,CAAC;AACvD"}
|
|
@@ -10,7 +10,7 @@ import { getCSSRules } from '@wordpress/style-engine';
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
-
import
|
|
13
|
+
import { useSettings } from '../components/use-settings';
|
|
14
14
|
import { appendSelectors, getBlockGapCSS, getAlignmentsInfo } from './utils';
|
|
15
15
|
import { getGapCSSValue } from '../hooks/gap';
|
|
16
16
|
import { shouldSkipSerialization } from '../hooks/utils';
|
|
@@ -50,8 +50,9 @@ export default {
|
|
|
50
50
|
icon: justifyRight,
|
|
51
51
|
label: __('Justify items right')
|
|
52
52
|
}];
|
|
53
|
+
const [availableUnits] = useSettings('spacing.units');
|
|
53
54
|
const units = useCustomUnits({
|
|
54
|
-
availableUnits:
|
|
55
|
+
availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw']
|
|
55
56
|
});
|
|
56
57
|
return createElement(Fragment, null, createElement("div", {
|
|
57
58
|
className: "block-editor-hooks__layout-controls"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOptionIcon","ToggleGroupControlOptionIcon","__","Icon","positionCenter","stretchWide","justifyLeft","justifyCenter","justifyRight","getCSSRules","useSetting","appendSelectors","getBlockGapCSS","getAlignmentsInfo","getGapCSSValue","shouldSkipSerialization","LAYOUT_DEFINITIONS","name","label","inspectorControls","DefaultLayoutInspectorControls","layout","onChange","layoutBlockSupport","wideSize","contentSize","justifyContent","allowJustification","onJustificationChange","value","justificationOptions","icon","units","availableUnits","createElement","Fragment","className","labelPosition","__unstableInputWidth","nextWidth","parseFloat","__nextHasNoMarginBottom","map","key","toolBarControls","DefaultLayoutToolbarControls","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","blockGapStyleValue","spacing","blockGap","blockGapValue","top","marginLeft","marginRight","output","padding","paddingValues","forEach","rule","getOrientation","getAlignments","alignmentInfo","alignments","undefined","includes","unshift","alignment","info","wide","none"],"sources":["@wordpress/block-editor/src/layouts/constrained.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tIcon,\n\tpositionCenter,\n\tstretchWide,\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n} from '@wordpress/icons';\nimport { getCSSRules } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../components/use-setting';\nimport { appendSelectors, getBlockGapCSS, getAlignmentsInfo } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\nexport default {\n\tname: 'constrained',\n\tlabel: __( 'Constrained' ),\n\tinspectorControls: function DefaultLayoutInspectorControls( {\n\t\tlayout,\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { wideSize, contentSize, justifyContent = 'center' } = layout;\n\t\tconst { allowJustification = true } = layoutBlockSupport;\n\t\tconst onJustificationChange = ( value ) => {\n\t\t\tonChange( {\n\t\t\t\t...layout,\n\t\t\t\tjustifyContent: value,\n\t\t\t} );\n\t\t};\n\t\tconst justificationOptions = [\n\t\t\t{\n\t\t\t\tvalue: 'left',\n\t\t\t\ticon: justifyLeft,\n\t\t\t\tlabel: __( 'Justify items left' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'center',\n\t\t\t\ticon: justifyCenter,\n\t\t\t\tlabel: __( 'Justify items center' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'right',\n\t\t\t\ticon: justifyRight,\n\t\t\t\tlabel: __( 'Justify items right' ),\n\t\t\t},\n\t\t];\n\t\tconst units = useCustomUnits( {\n\t\t\tavailableUnits: useSetting( 'spacing.units' ) || [\n\t\t\t\t'%',\n\t\t\t\t'px',\n\t\t\t\t'em',\n\t\t\t\t'rem',\n\t\t\t\t'vw',\n\t\t\t],\n\t\t} );\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"block-editor-hooks__layout-controls\">\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__layout-controls-unit-input\"\n\t\t\t\t\t\t\tlabel={ __( 'Content' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ contentSize || wideSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\tcontentSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Icon icon={ positionCenter } />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__layout-controls-unit-input\"\n\t\t\t\t\t\t\tlabel={ __( 'Wide' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ wideSize || contentSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\twideSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<p className=\"block-editor-hooks__layout-controls-helptext\">\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the width for all elements that are assigned to the center or wide columns.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t\t{ allowJustification && (\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Justification' ) }\n\t\t\t\t\t\tvalue={ justifyContent }\n\t\t\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ justificationOptions.map(\n\t\t\t\t\t\t\t( { value, icon, label } ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function DefaultLayoutToolbarControls() {\n\t\treturn null;\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout = {},\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { contentSize, wideSize, justifyContent } = layout;\n\t\tconst blockGapStyleValue = getGapCSSValue( style?.spacing?.blockGap );\n\n\t\t// If a block's block.json skips serialization for spacing or\n\t\t// spacing.blockGap, don't apply the user-defined value to the styles.\n\t\tlet blockGapValue = '';\n\t\tif ( ! shouldSkipSerialization( blockName, 'spacing', 'blockGap' ) ) {\n\t\t\t// If an object is provided only use the 'top' value for this kind of gap.\n\t\t\tif ( blockGapStyleValue?.top ) {\n\t\t\t\tblockGapValue = getGapCSSValue( blockGapStyleValue?.top );\n\t\t\t} else if ( typeof blockGapStyleValue === 'string' ) {\n\t\t\t\tblockGapValue = getGapCSSValue( blockGapStyleValue );\n\t\t\t}\n\t\t}\n\n\t\tconst marginLeft =\n\t\t\tjustifyContent === 'left' ? '0 !important' : 'auto !important';\n\t\tconst marginRight =\n\t\t\tjustifyContent === 'right' ? '0 !important' : 'auto !important';\n\n\t\tlet output =\n\t\t\t!! contentSize || !! wideSize\n\t\t\t\t? `\n\t\t\t\t\t${ appendSelectors(\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t\t\t) } {\n\t\t\t\t\t\tmax-width: ${ contentSize ?? wideSize };\n\t\t\t\t\t\tmargin-left: ${ marginLeft };\n\t\t\t\t\t\tmargin-right: ${ marginRight };\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignwide' ) } {\n\t\t\t\t\t\tmax-width: ${ wideSize ?? contentSize };\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`\n\t\t\t\t: '';\n\n\t\tif ( justifyContent === 'left' ) {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t) }\n\t\t\t{ margin-left: ${ marginLeft }; }`;\n\t\t} else if ( justifyContent === 'right' ) {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t) }\n\t\t\t{ margin-right: ${ marginRight }; }`;\n\t\t}\n\n\t\t// If there is custom padding, add negative margins for alignfull blocks.\n\t\tif ( style?.spacing?.padding ) {\n\t\t\t// The style object might be storing a preset so we need to make sure we get a usable value.\n\t\t\tconst paddingValues = getCSSRules( style );\n\t\t\tpaddingValues.forEach( ( rule ) => {\n\t\t\t\tif ( rule.key === 'paddingRight' ) {\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-right: calc(${ rule.value } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t} else if ( rule.key === 'paddingLeft' ) {\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-left: calc(${ rule.value } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'constrained',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'vertical';\n\t},\n\tgetAlignments( layout ) {\n\t\tconst alignmentInfo = getAlignmentsInfo( layout );\n\t\tif ( layout.alignments !== undefined ) {\n\t\t\tif ( ! layout.alignments.includes( 'none' ) ) {\n\t\t\t\tlayout.alignments.unshift( 'none' );\n\t\t\t}\n\t\t\treturn layout.alignments.map( ( alignment ) => ( {\n\t\t\t\tname: alignment,\n\t\t\t\tinfo: alignmentInfo[ alignment ],\n\t\t\t} ) );\n\t\t}\n\t\tconst { contentSize, wideSize } = layout;\n\n\t\tconst alignments = [\n\t\t\t{ name: 'left' },\n\t\t\t{ name: 'center' },\n\t\t\t{ name: 'right' },\n\t\t];\n\n\t\tif ( contentSize ) {\n\t\t\talignments.unshift( { name: 'full' } );\n\t\t}\n\n\t\tif ( wideSize ) {\n\t\t\talignments.unshift( { name: 'wide', info: alignmentInfo.wide } );\n\t\t}\n\n\t\talignments.unshift( { name: 'none', info: alignmentInfo.none } );\n\n\t\treturn alignments;\n\t},\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,4BAA4B,IAAIC,cAAc,EAC9CC,yBAAyB,IAAIC,WAAW,EACxCC,gCAAgC,IAAIC,kBAAkB,EACtDC,0CAA0C,IAAIC,4BAA4B,QACpE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,IAAI,EACJC,cAAc,EACdC,WAAW,EACXC,WAAW,EACXC,aAAa,EACbC,YAAY,QACN,kBAAkB;AACzB,SAASC,WAAW,QAAQ,yBAAyB;;AAErD;AACA;AACA;AACA,OAAOC,UAAU,MAAM,2BAA2B;AAClD,SAASC,eAAe,EAAEC,cAAc,EAAEC,iBAAiB,QAAQ,SAAS;AAC5E,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,uBAAuB,QAAQ,gBAAgB;AACxD,SAASC,kBAAkB,QAAQ,eAAe;AAElD,eAAe;EACdC,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAEhB,EAAE,CAAE,aAAc,CAAC;EAC1BiB,iBAAiB,EAAE,SAASC,8BAA8BA,CAAE;IAC3DC,MAAM;I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ACF;IACA,OAAOI,MAAM;EACd,CAAC;EACDK,cAAcA,CAAA,EAAG;IAChB,OAAO,UAAU;EAClB,CAAC;EACDC,aAAaA,CAAE5C,MAAM,EAAG;IACvB,MAAM6C,aAAa,GAAGrD,iBAAiB,CAAEQ,MAAO,CAAC;IACjD,IAAKA,MAAM,CAAC8C,UAAU,KAAKC,SAAS,EAAG;MACtC,IAAK,CAAE/C,MAAM,CAAC8C,UAAU,CAACE,QAAQ,CAAE,MAAO,CAAC,EAAG;QAC7ChD,MAAM,CAAC8C,UAAU,CAACG,OAAO,CAAE,MAAO,CAAC;MACpC;MACA,OAAOjD,MAAM,CAAC8C,UAAU,CAACzB,GAAG,CAAI6B,SAAS,KAAQ;QAChDtD,IAAI,EAAEsD,SAAS;QACfC,IAAI,EAAEN,aAAa,CAAEK,SAAS;MAC/B,CAAC,CAAG,CAAC;IACN;IACA,MAAM;MAAE9C,WAAW;MAAED;IAAS,CAAC,GAAGH,MAAM;IAExC,MAAM8C,UAAU,GAAG,CAClB;MAAElD,IAAI,EAAE;IAAO,CAAC,EAChB;MAAEA,IAAI,EAAE;IAAS,CAAC,EAClB;MAAEA,IAAI,EAAE;IAAQ,CAAC,CACjB;IAED,IAAKQ,WAAW,EAAG;MAClB0C,UAAU,CAACG,OAAO,CAAE;QAAErD,IAAI,EAAE;MAAO,CAAE,CAAC;IACvC;IAEA,IAAKO,QAAQ,EAAG;MACf2C,UAAU,CAACG,OAAO,CAAE;QAAErD,IAAI,EAAE,MAAM;QAAEuD,IAAI,EAAEN,aAAa,CAACO;MAAK,CAAE,CAAC;IACjE;IAEAN,UAAU,CAACG,OAAO,CAAE;MAAErD,IAAI,EAAE,MAAM;MAAEuD,IAAI,EAAEN,aAAa,CAACQ;IAAK,CAAE,CAAC;IAEhE,OAAOP,UAAU;EAClB;AACD,CAAC"}
|
|
1
|
+
{"version":3,"names":["__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOptionIcon","ToggleGroupControlOptionIcon","__","Icon","positionCenter","stretchWide","justifyLeft","justifyCenter","justifyRight","getCSSRules","useSettings","appendSelectors","getBlockGapCSS","getAlignmentsInfo","getGapCSSValue","shouldSkipSerialization","LAYOUT_DEFINITIONS","name","label","inspectorControls","DefaultLayoutInspectorControls","layout","onChange","layoutBlockSupport","wideSize","contentSize","justifyContent","allowJustification","onJustificationChange","value","justificationOptions","icon","availableUnits","units","createElement","Fragment","className","labelPosition","__unstableInputWidth","nextWidth","parseFloat","__nextHasNoMarginBottom","map","key","toolBarControls","DefaultLayoutToolbarControls","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","blockGapStyleValue","spacing","blockGap","blockGapValue","top","marginLeft","marginRight","output","padding","paddingValues","forEach","rule","getOrientation","getAlignments","alignmentInfo","alignments","undefined","includes","unshift","alignment","info","wide","none"],"sources":["@wordpress/block-editor/src/layouts/constrained.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tIcon,\n\tpositionCenter,\n\tstretchWide,\n\tjustifyLeft,\n\tjustifyCenter,\n\tjustifyRight,\n} from '@wordpress/icons';\nimport { getCSSRules } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport { useSettings } from '../components/use-settings';\nimport { appendSelectors, getBlockGapCSS, getAlignmentsInfo } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\nexport default {\n\tname: 'constrained',\n\tlabel: __( 'Constrained' ),\n\tinspectorControls: function DefaultLayoutInspectorControls( {\n\t\tlayout,\n\t\tonChange,\n\t\tlayoutBlockSupport = {},\n\t} ) {\n\t\tconst { wideSize, contentSize, justifyContent = 'center' } = layout;\n\t\tconst { allowJustification = true } = layoutBlockSupport;\n\t\tconst onJustificationChange = ( value ) => {\n\t\t\tonChange( {\n\t\t\t\t...layout,\n\t\t\t\tjustifyContent: value,\n\t\t\t} );\n\t\t};\n\t\tconst justificationOptions = [\n\t\t\t{\n\t\t\t\tvalue: 'left',\n\t\t\t\ticon: justifyLeft,\n\t\t\t\tlabel: __( 'Justify items left' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'center',\n\t\t\t\ticon: justifyCenter,\n\t\t\t\tlabel: __( 'Justify items center' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: 'right',\n\t\t\t\ticon: justifyRight,\n\t\t\t\tlabel: __( 'Justify items right' ),\n\t\t\t},\n\t\t];\n\t\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\t\tconst units = useCustomUnits( {\n\t\t\tavailableUnits: availableUnits || [ '%', 'px', 'em', 'rem', 'vw' ],\n\t\t} );\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"block-editor-hooks__layout-controls\">\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__layout-controls-unit-input\"\n\t\t\t\t\t\t\tlabel={ __( 'Content' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ contentSize || wideSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\tcontentSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Icon icon={ positionCenter } />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__layout-controls-unit-input\"\n\t\t\t\t\t\t\tlabel={ __( 'Wide' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ wideSize || contentSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\twideSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<p className=\"block-editor-hooks__layout-controls-helptext\">\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the width for all elements that are assigned to the center or wide columns.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t\t{ allowJustification && (\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Justification' ) }\n\t\t\t\t\t\tvalue={ justifyContent }\n\t\t\t\t\t\tonChange={ onJustificationChange }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ justificationOptions.map(\n\t\t\t\t\t\t\t( { value, icon, label } ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ToggleGroupControlOptionIcon\n\t\t\t\t\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function DefaultLayoutToolbarControls() {\n\t\treturn null;\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout = {},\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { contentSize, wideSize, justifyContent } = layout;\n\t\tconst blockGapStyleValue = getGapCSSValue( style?.spacing?.blockGap );\n\n\t\t// If a block's block.json skips serialization for spacing or\n\t\t// spacing.blockGap, don't apply the user-defined value to the styles.\n\t\tlet blockGapValue = '';\n\t\tif ( ! shouldSkipSerialization( blockName, 'spacing', 'blockGap' ) ) {\n\t\t\t// If an object is provided only use the 'top' value for this kind of gap.\n\t\t\tif ( blockGapStyleValue?.top ) {\n\t\t\t\tblockGapValue = getGapCSSValue( blockGapStyleValue?.top );\n\t\t\t} else if ( typeof blockGapStyleValue === 'string' ) {\n\t\t\t\tblockGapValue = getGapCSSValue( blockGapStyleValue );\n\t\t\t}\n\t\t}\n\n\t\tconst marginLeft =\n\t\t\tjustifyContent === 'left' ? '0 !important' : 'auto !important';\n\t\tconst marginRight =\n\t\t\tjustifyContent === 'right' ? '0 !important' : 'auto !important';\n\n\t\tlet output =\n\t\t\t!! contentSize || !! wideSize\n\t\t\t\t? `\n\t\t\t\t\t${ appendSelectors(\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t\t\t) } {\n\t\t\t\t\t\tmax-width: ${ contentSize ?? wideSize };\n\t\t\t\t\t\tmargin-left: ${ marginLeft };\n\t\t\t\t\t\tmargin-right: ${ marginRight };\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignwide' ) } {\n\t\t\t\t\t\tmax-width: ${ wideSize ?? contentSize };\n\t\t\t\t\t}\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`\n\t\t\t\t: '';\n\n\t\tif ( justifyContent === 'left' ) {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t) }\n\t\t\t{ margin-left: ${ marginLeft }; }`;\n\t\t} else if ( justifyContent === 'right' ) {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\t'> :where(:not(.alignleft):not(.alignright):not(.alignfull))'\n\t\t\t) }\n\t\t\t{ margin-right: ${ marginRight }; }`;\n\t\t}\n\n\t\t// If there is custom padding, add negative margins for alignfull blocks.\n\t\tif ( style?.spacing?.padding ) {\n\t\t\t// The style object might be storing a preset so we need to make sure we get a usable value.\n\t\t\tconst paddingValues = getCSSRules( style );\n\t\t\tpaddingValues.forEach( ( rule ) => {\n\t\t\t\tif ( rule.key === 'paddingRight' ) {\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-right: calc(${ rule.value } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t} else if ( rule.key === 'paddingLeft' ) {\n\t\t\t\t\toutput += `\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmargin-left: calc(${ rule.value } * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'constrained',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'vertical';\n\t},\n\tgetAlignments( layout ) {\n\t\tconst alignmentInfo = getAlignmentsInfo( layout );\n\t\tif ( layout.alignments !== undefined ) {\n\t\t\tif ( ! layout.alignments.includes( 'none' ) ) {\n\t\t\t\tlayout.alignments.unshift( 'none' );\n\t\t\t}\n\t\t\treturn layout.alignments.map( ( alignment ) => ( {\n\t\t\t\tname: alignment,\n\t\t\t\tinfo: alignmentInfo[ alignment ],\n\t\t\t} ) );\n\t\t}\n\t\tconst { contentSize, wideSize } = layout;\n\n\t\tconst alignments = [\n\t\t\t{ name: 'left' },\n\t\t\t{ name: 'center' },\n\t\t\t{ name: 'right' },\n\t\t];\n\n\t\tif ( contentSize ) {\n\t\t\talignments.unshift( { name: 'full' } );\n\t\t}\n\n\t\tif ( wideSize ) {\n\t\t\talignments.unshift( { name: 'wide', info: alignmentInfo.wide } );\n\t\t}\n\n\t\talignments.unshift( { name: 'none', info: alignmentInfo.none } );\n\n\t\treturn alignments;\n\t},\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,4BAA4B,IAAIC,cAAc,EAC9CC,yBAAyB,IAAIC,WAAW,EACxCC,gCAAgC,IAAIC,kBAAkB,EACtDC,0CAA0C,IAAIC,4BAA4B,QACpE,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,IAAI,EACJC,cAAc,EACdC,WAAW,EACXC,WAAW,EACXC,aAAa,EACbC,YAAY,QACN,kBA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OAAO,CAAE;QAAErD,IAAI,EAAE;MAAO,CAAE,CAAC;IACvC;IAEA,IAAKO,QAAQ,EAAG;MACf2C,UAAU,CAACG,OAAO,CAAE;QAAErD,IAAI,EAAE,MAAM;QAAEuD,IAAI,EAAEN,aAAa,CAACO;MAAK,CAAE,CAAC;IACjE;IAEAN,UAAU,CAACG,OAAO,CAAE;MAAErD,IAAI,EAAE,MAAM;MAAEuD,IAAI,EAAEN,aAAa,CAACQ;IAAK,CAAE,CAAC;IAEhE,OAAOP,UAAU;EAClB;AACD,CAAC"}
|
|
@@ -18,7 +18,29 @@ const RANGE_CONTROL_MAX_VALUES = {
|
|
|
18
18
|
vw: 100,
|
|
19
19
|
vh: 100,
|
|
20
20
|
em: 38,
|
|
21
|
-
rem: 38
|
|
21
|
+
rem: 38,
|
|
22
|
+
svw: 100,
|
|
23
|
+
lvw: 100,
|
|
24
|
+
dvw: 100,
|
|
25
|
+
svh: 100,
|
|
26
|
+
lvh: 100,
|
|
27
|
+
dvh: 100,
|
|
28
|
+
vi: 100,
|
|
29
|
+
svi: 100,
|
|
30
|
+
lvi: 100,
|
|
31
|
+
dvi: 100,
|
|
32
|
+
vb: 100,
|
|
33
|
+
svb: 100,
|
|
34
|
+
lvb: 100,
|
|
35
|
+
dvb: 100,
|
|
36
|
+
vmin: 100,
|
|
37
|
+
svmin: 100,
|
|
38
|
+
lvmin: 100,
|
|
39
|
+
dvmin: 100,
|
|
40
|
+
vmax: 100,
|
|
41
|
+
svmax: 100,
|
|
42
|
+
lvmax: 100,
|
|
43
|
+
dvmax: 100
|
|
22
44
|
};
|
|
23
45
|
export default {
|
|
24
46
|
name: 'grid',
|
|
@@ -108,8 +130,8 @@ function GridLayoutMinimumWidthControl({
|
|
|
108
130
|
} else if (['em', 'rem'].includes(unit) && newUnit === 'px') {
|
|
109
131
|
// Convert to pixel value assuming a root size of 16px.
|
|
110
132
|
newValue = Math.round(quantity * 16) + newUnit;
|
|
111
|
-
} else if (['vh', 'vw', '%'].includes(newUnit) && quantity > 100) {
|
|
112
|
-
// When converting to
|
|
133
|
+
} else if (['vh', 'vw', '%', 'svw', 'lvw', 'dvw', 'svh', 'lvh', 'dvh', 'vi', 'svi', 'lvi', 'dvi', 'vb', 'svb', 'lvb', 'dvb', 'vmin', 'svmin', 'lvmin', 'dvmin', 'vmax', 'svmax', 'lvmax', 'dvmax'].includes(newUnit) && quantity > 100) {
|
|
134
|
+
// When converting to `%` or viewport-relative units, cap the new value at 100.
|
|
113
135
|
newValue = 100 + newUnit;
|
|
114
136
|
}
|
|
115
137
|
onChange({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","BaseControl","Flex","FlexItem","RangeControl","__experimentalUnitControl","UnitControl","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","appendSelectors","getBlockGapCSS","getGapCSSValue","shouldSkipSerialization","LAYOUT_DEFINITIONS","RANGE_CONTROL_MAX_VALUES","px","vw","vh","em","rem","name","label","inspectorControls","GridLayoutInspectorControls","layout","onChange","columnCount","createElement","GridLayoutColumnsControl","GridLayoutMinimumWidthControl","toolBarControls","DefaultLayoutToolbarControls","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","minimumColumnWidth","blockGapValue","spacing","blockGap","undefined","output","rules","push","length","join","getOrientation","getAlignments","value","quantity","unit","handleSliderChange","next","handleUnitChange","newUnit","newValue","includes","toFixed","Math","round","VisualLabel","as","gap","isBlock","size","onUnitChange","min","max","withInputField"],"sources":["@wordpress/block-editor/src/layouts/grid.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\tBaseControl,\n\tFlex,\n\tFlexItem,\n\tRangeControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\nconst RANGE_CONTROL_MAX_VALUES = {\n\tpx: 600,\n\t'%': 100,\n\tvw: 100,\n\tvh: 100,\n\tem: 38,\n\trem: 38,\n};\n\nexport default {\n\tname: 'grid',\n\tlabel: __( 'Grid' ),\n\tinspectorControls: function GridLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t} ) {\n\t\treturn layout?.columnCount ? (\n\t\t\t<GridLayoutColumnsControl layout={ layout } onChange={ onChange } />\n\t\t) : (\n\t\t\t<GridLayoutMinimumWidthControl\n\t\t\t\tlayout={ layout }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t);\n\t},\n\ttoolBarControls: function DefaultLayoutToolbarControls() {\n\t\treturn null;\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { minimumColumnWidth = '12rem', columnCount = null } = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( columnCount ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(${ columnCount }, minmax(0, 1fr))`\n\t\t\t);\n\t\t} else if ( minimumColumnWidth ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(auto-fill, minmax(min(${ minimumColumnWidth }, 100%), 1fr))`\n\t\t\t);\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\t// Reason to disable: the extra line breaks added by prettier mess with the unit tests.\n\t\t\t// eslint-disable-next-line prettier/prettier\n\t\t\toutput = `${ appendSelectors( selector ) } { ${ rules.join(\n\t\t\t\t'; '\n\t\t\t) }; }`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'grid',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'horizontal';\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\n// Enables setting minimum width of grid items.\nfunction GridLayoutMinimumWidthControl( { layout, onChange } ) {\n\tconst { minimumColumnWidth: value = '12rem' } = layout;\n\tconst [ quantity, unit ] = parseQuantityAndUnitFromRawValue( value );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: [ next, unit ].join( '' ),\n\t\t} );\n\t};\n\n\t// Mostly copied from HeightControl.\n\tconst handleUnitChange = ( newUnit ) => {\n\t\t// Attempt to smooth over differences between currentUnit and newUnit.\n\t\t// This should slightly improve the experience of switching between unit types.\n\t\tlet newValue;\n\n\t\tif ( [ 'em', 'rem' ].includes( newUnit ) && unit === 'px' ) {\n\t\t\t// Convert pixel value to an approximate of the new unit, assuming a root size of 16px.\n\t\t\tnewValue = ( quantity / 16 ).toFixed( 2 ) + newUnit;\n\t\t} else if ( [ 'em', 'rem' ].includes( unit ) && newUnit === 'px' ) {\n\t\t\t// Convert to pixel value assuming a root size of 16px.\n\t\t\tnewValue = Math.round( quantity * 16 ) + newUnit;\n\t\t} else if (\n\t\t\t[ 'vh', 'vw', '%' ].includes( newUnit ) &&\n\t\t\tquantity > 100\n\t\t) {\n\t\t\t// When converting to `vh`, `vw`, or `%` units, cap the new value at 100.\n\t\t\tnewValue = 100 + newUnit;\n\t\t}\n\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: newValue,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<fieldset>\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Minimum column width' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Flex gap={ 4 }>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\tminimumColumnWidth: newValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonUnitChange={ handleUnitChange }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\tvalue={ quantity }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ RANGE_CONTROL_MAX_VALUES[ unit ] || 600 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</fieldset>\n\t);\n}\n\n// Enables setting number of grid columns\nfunction GridLayoutColumnsControl( { layout, onChange } ) {\n\tconst { columnCount = 3 } = layout;\n\n\treturn (\n\t\t<RangeControl\n\t\t\tlabel={ __( 'Columns' ) }\n\t\t\tvalue={ columnCount }\n\t\t\tonChange={ ( value ) =>\n\t\t\t\tonChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\tcolumnCount: value,\n\t\t\t\t} )\n\t\t\t}\n\t\t\tmin={ 1 }\n\t\t\tmax={ 6 }\n\t\t/>\n\t);\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,CAAE;QACT,GAAGD,MAAM;QACTc,kBAAkB,EAAEmB;MACrB,CAAE,CAAC;IACJ,CAAG;IACHU,YAAY,EAAGZ,gBAAkB;IACjCL,KAAK,EAAGA,KAAO;IACfkB,GAAG,EAAG;EAAG,CACT,CACQ,CAAC,EACXzC,aAAA,CAACxB,QAAQ;IAAC8D,OAAO;EAAA,GAChBtC,aAAA,CAACvB,YAAY;IACZqB,QAAQ,EAAG4B,kBAAoB;IAC/BH,KAAK,EAAGC,QAAU;IAClBiB,GAAG,EAAG,CAAG;IACTC,GAAG,EAAGvD,wBAAwB,CAAEsC,IAAI,CAAE,IAAI,GAAK;IAC/CkB,cAAc,EAAG;EAAO,CACxB,CACQ,CACL,CACG,CAAC;AAEb;;AAEA;AACA,SAAS1C,wBAAwBA,CAAE;EAAEJ,MAAM;EAAEC;AAAS,CAAC,EAAG;EACzD,MAAM;IAAEC,WAAW,GAAG;EAAE,CAAC,GAAGF,MAAM;EAElC,OACCG,aAAA,CAACvB,YAAY;IACZiB,KAAK,EAAGrB,EAAE,CAAE,SAAU,CAAG;IACzBkD,KAAK,EAAGxB,WAAa;IACrBD,QAAQ,EAAKyB,KAAK,IACjBzB,QAAQ,CAAE;MACT,GAAGD,MAAM;MACTE,WAAW,EAAEwB;IACd,CAAE,CACF;IACDkB,GAAG,EAAG,CAAG;IACTC,GAAG,EAAG;EAAG,CACT,CAAC;AAEJ"}
|
|
1
|
+
{"version":3,"names":["__","BaseControl","Flex","FlexItem","RangeControl","__experimentalUnitControl","UnitControl","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","appendSelectors","getBlockGapCSS","getGapCSSValue","shouldSkipSerialization","LAYOUT_DEFINITIONS","RANGE_CONTROL_MAX_VALUES","px","vw","vh","em","rem","svw","lvw","dvw","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","name","label","inspectorControls","GridLayoutInspectorControls","layout","onChange","columnCount","createElement","GridLayoutColumnsControl","GridLayoutMinimumWidthControl","toolBarControls","DefaultLayoutToolbarControls","getLayoutStyle","selector","style","blockName","hasBlockGapSupport","layoutDefinitions","minimumColumnWidth","blockGapValue","spacing","blockGap","undefined","output","rules","push","length","join","getOrientation","getAlignments","value","quantity","unit","handleSliderChange","next","handleUnitChange","newUnit","newValue","includes","toFixed","Math","round","VisualLabel","as","gap","isBlock","size","onUnitChange","min","max","withInputField"],"sources":["@wordpress/block-editor/src/layouts/grid.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nimport {\n\tBaseControl,\n\tFlex,\n\tFlexItem,\n\tRangeControl,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { appendSelectors, getBlockGapCSS } from './utils';\nimport { getGapCSSValue } from '../hooks/gap';\nimport { shouldSkipSerialization } from '../hooks/utils';\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\nconst RANGE_CONTROL_MAX_VALUES = {\n\tpx: 600,\n\t'%': 100,\n\tvw: 100,\n\tvh: 100,\n\tem: 38,\n\trem: 38,\n\tsvw: 100,\n\tlvw: 100,\n\tdvw: 100,\n\tsvh: 100,\n\tlvh: 100,\n\tdvh: 100,\n\tvi: 100,\n\tsvi: 100,\n\tlvi: 100,\n\tdvi: 100,\n\tvb: 100,\n\tsvb: 100,\n\tlvb: 100,\n\tdvb: 100,\n\tvmin: 100,\n\tsvmin: 100,\n\tlvmin: 100,\n\tdvmin: 100,\n\tvmax: 100,\n\tsvmax: 100,\n\tlvmax: 100,\n\tdvmax: 100,\n};\n\nexport default {\n\tname: 'grid',\n\tlabel: __( 'Grid' ),\n\tinspectorControls: function GridLayoutInspectorControls( {\n\t\tlayout = {},\n\t\tonChange,\n\t} ) {\n\t\treturn layout?.columnCount ? (\n\t\t\t<GridLayoutColumnsControl layout={ layout } onChange={ onChange } />\n\t\t) : (\n\t\t\t<GridLayoutMinimumWidthControl\n\t\t\t\tlayout={ layout }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t);\n\t},\n\ttoolBarControls: function DefaultLayoutToolbarControls() {\n\t\treturn null;\n\t},\n\tgetLayoutStyle: function getLayoutStyle( {\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\tblockName,\n\t\thasBlockGapSupport,\n\t\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\t} ) {\n\t\tconst { minimumColumnWidth = '12rem', columnCount = null } = layout;\n\n\t\t// If a block's block.json skips serialization for spacing or spacing.blockGap,\n\t\t// don't apply the user-defined value to the styles.\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap &&\n\t\t\t! shouldSkipSerialization( blockName, 'spacing', 'blockGap' )\n\t\t\t\t? getGapCSSValue( style?.spacing?.blockGap, '0.5em' )\n\t\t\t\t: undefined;\n\n\t\tlet output = '';\n\t\tconst rules = [];\n\n\t\tif ( columnCount ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(${ columnCount }, minmax(0, 1fr))`\n\t\t\t);\n\t\t} else if ( minimumColumnWidth ) {\n\t\t\trules.push(\n\t\t\t\t`grid-template-columns: repeat(auto-fill, minmax(min(${ minimumColumnWidth }, 100%), 1fr))`\n\t\t\t);\n\t\t}\n\n\t\tif ( rules.length ) {\n\t\t\t// Reason to disable: the extra line breaks added by prettier mess with the unit tests.\n\t\t\t// eslint-disable-next-line prettier/prettier\n\t\t\toutput = `${ appendSelectors( selector ) } { ${ rules.join(\n\t\t\t\t'; '\n\t\t\t) }; }`;\n\t\t}\n\n\t\t// Output blockGap styles based on rules contained in layout definitions in theme.json.\n\t\tif ( hasBlockGapSupport && blockGapValue ) {\n\t\t\toutput += getBlockGapCSS(\n\t\t\t\tselector,\n\t\t\t\tlayoutDefinitions,\n\t\t\t\t'grid',\n\t\t\t\tblockGapValue\n\t\t\t);\n\t\t}\n\t\treturn output;\n\t},\n\tgetOrientation() {\n\t\treturn 'horizontal';\n\t},\n\tgetAlignments() {\n\t\treturn [];\n\t},\n};\n\n// Enables setting minimum width of grid items.\nfunction GridLayoutMinimumWidthControl( { layout, onChange } ) {\n\tconst { minimumColumnWidth: value = '12rem' } = layout;\n\tconst [ quantity, unit ] = parseQuantityAndUnitFromRawValue( value );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: [ next, unit ].join( '' ),\n\t\t} );\n\t};\n\n\t// Mostly copied from HeightControl.\n\tconst handleUnitChange = ( newUnit ) => {\n\t\t// Attempt to smooth over differences between currentUnit and newUnit.\n\t\t// This should slightly improve the experience of switching between unit types.\n\t\tlet newValue;\n\n\t\tif ( [ 'em', 'rem' ].includes( newUnit ) && unit === 'px' ) {\n\t\t\t// Convert pixel value to an approximate of the new unit, assuming a root size of 16px.\n\t\t\tnewValue = ( quantity / 16 ).toFixed( 2 ) + newUnit;\n\t\t} else if ( [ 'em', 'rem' ].includes( unit ) && newUnit === 'px' ) {\n\t\t\t// Convert to pixel value assuming a root size of 16px.\n\t\t\tnewValue = Math.round( quantity * 16 ) + newUnit;\n\t\t} else if (\n\t\t\t[\n\t\t\t\t'vh',\n\t\t\t\t'vw',\n\t\t\t\t'%',\n\t\t\t\t'svw',\n\t\t\t\t'lvw',\n\t\t\t\t'dvw',\n\t\t\t\t'svh',\n\t\t\t\t'lvh',\n\t\t\t\t'dvh',\n\t\t\t\t'vi',\n\t\t\t\t'svi',\n\t\t\t\t'lvi',\n\t\t\t\t'dvi',\n\t\t\t\t'vb',\n\t\t\t\t'svb',\n\t\t\t\t'lvb',\n\t\t\t\t'dvb',\n\t\t\t\t'vmin',\n\t\t\t\t'svmin',\n\t\t\t\t'lvmin',\n\t\t\t\t'dvmin',\n\t\t\t\t'vmax',\n\t\t\t\t'svmax',\n\t\t\t\t'lvmax',\n\t\t\t\t'dvmax',\n\t\t\t].includes( newUnit ) &&\n\t\t\tquantity > 100\n\t\t) {\n\t\t\t// When converting to `%` or viewport-relative units, cap the new value at 100.\n\t\t\tnewValue = 100 + newUnit;\n\t\t}\n\n\t\tonChange( {\n\t\t\t...layout,\n\t\t\tminimumColumnWidth: newValue,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<fieldset>\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Minimum column width' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<Flex gap={ 4 }>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<UnitControl\n\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\tminimumColumnWidth: newValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonUnitChange={ handleUnitChange }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem isBlock>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\tvalue={ quantity }\n\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\tmax={ RANGE_CONTROL_MAX_VALUES[ unit ] || 600 }\n\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\t\t</fieldset>\n\t);\n}\n\n// Enables setting number of grid columns\nfunction GridLayoutColumnsControl( { layout, onChange } ) {\n\tconst { columnCount = 3 } = layout;\n\n\treturn (\n\t\t<RangeControl\n\t\t\tlabel={ __( 'Columns' ) }\n\t\t\tvalue={ columnCount }\n\t\t\tonChange={ ( value ) =>\n\t\t\t\tonChange( {\n\t\t\t\t\t...layout,\n\t\t\t\t\t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4D,IAAI,CAAE,IAAI,GAAK;IAC/CkB,cAAc,EAAG;EAAO,CACxB,CACQ,CACL,CACG,CAAC;AAEb;;AAEA;AACA,SAAS1C,wBAAwBA,CAAE;EAAEJ,MAAM;EAAEC;AAAS,CAAC,EAAG;EACzD,MAAM;IAAEC,WAAW,GAAG;EAAE,CAAC,GAAGF,MAAM;EAElC,OACCG,aAAA,CAAC7C,YAAY;IACZuC,KAAK,EAAG3C,EAAE,CAAE,SAAU,CAAG;IACzBwE,KAAK,EAAGxB,WAAa;IACrBD,QAAQ,EAAKyB,KAAK,IACjBzB,QAAQ,CAAE;MACT,GAAGD,MAAM;MACTE,WAAW,EAAEwB;IACd,CAAE,CACF;IACDkB,GAAG,EAAG,CAAG;IACTC,GAAG,EAAG;EAAG,CACT,CAAC;AAEJ"}
|
|
@@ -70,7 +70,7 @@ export function getAlignmentsInfo(layout) {
|
|
|
70
70
|
type = 'default'
|
|
71
71
|
} = layout;
|
|
72
72
|
const alignmentInfo = {};
|
|
73
|
-
const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh
|
|
73
|
+
const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;
|
|
74
74
|
if (sizeRegex.test(contentSize) && type === 'constrained') {
|
|
75
75
|
// translators: %s: container size (i.e. 600px etc)
|
|
76
76
|
alignmentInfo.none = sprintf(__('Max %s wide'), contentSize);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","LAYOUT_DEFINITIONS","appendSelectors","selectors","append","split","map","subselector","join","getBlockGapCSS","selector","layoutDefinitions","layoutType","blockGapValue","output","spacingStyles","length","forEach","gapStyle","trim","Object","entries","rules","cssProperty","value","getAlignmentsInfo","layout","contentSize","wideSize","type","alignmentInfo","sizeRegex","test","none","wide"],"sources":["@wordpress/block-editor/src/layouts/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\n/**\n * Utility to generate the proper CSS selector for layout styles.\n *\n * @param {string} selectors CSS selector, also supports multiple comma-separated selectors.\n * @param {string} append The string to append.\n *\n * @return {string} - CSS selector.\n */\nexport function appendSelectors( selectors, append = '' ) {\n\t// Ideally we shouldn't need the `.editor-styles-wrapper` increased specificity here\n\t// The problem though is that we have a `.editor-styles-wrapper p { margin: reset; }` style\n\t// it's used to reset the default margin added by wp-admin to paragraphs\n\t// so we need this to be higher speficity otherwise, it won't be applied to paragraphs inside containers\n\t// When the post editor is fully iframed, this extra classname could be removed.\n\n\treturn selectors\n\t\t.split( ',' )\n\t\t.map(\n\t\t\t( subselector ) =>\n\t\t\t\t`.editor-styles-wrapper ${ subselector }${\n\t\t\t\t\tappend ? ` ${ append }` : ''\n\t\t\t\t}`\n\t\t)\n\t\t.join( ',' );\n}\n\n/**\n * Get generated blockGap CSS rules based on layout definitions provided in theme.json\n * Falsy values in the layout definition's spacingStyles rules will be swapped out\n * with the provided `blockGapValue`.\n *\n * @param {string} selector The CSS selector to target for the generated rules.\n * @param {Object} layoutDefinitions Layout definitions object.\n * @param {string} layoutType The layout type (e.g. `default` or `flex`).\n * @param {string} blockGapValue The current blockGap value to be applied.\n * @return {string} The generated CSS rules.\n */\nexport function getBlockGapCSS(\n\tselector,\n\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\tlayoutType,\n\tblockGapValue\n) {\n\tlet output = '';\n\tif (\n\t\tlayoutDefinitions?.[ layoutType ]?.spacingStyles?.length &&\n\t\tblockGapValue\n\t) {\n\t\tlayoutDefinitions[ layoutType ].spacingStyles.forEach( ( gapStyle ) => {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\tgapStyle.selector.trim()\n\t\t\t) } { `;\n\t\t\toutput += Object.entries( gapStyle.rules )\n\t\t\t\t.map(\n\t\t\t\t\t( [ cssProperty, value ] ) =>\n\t\t\t\t\t\t`${ cssProperty }: ${ value ? value : blockGapValue }`\n\t\t\t\t)\n\t\t\t\t.join( '; ' );\n\t\t\toutput += '; }';\n\t\t} );\n\t}\n\treturn output;\n}\n\n/**\n * Helper method to assign contextual info to clarify\n * alignment settings.\n *\n * Besides checking if `contentSize` and `wideSize` have a\n * value, we now show this information only if their values\n * are not a `css var`. This needs to change when parsing\n * css variables land.\n *\n * @see https://github.com/WordPress/gutenberg/pull/34710#issuecomment-918000752\n *\n * @param {Object} layout The layout object.\n * @return {Object} An object with contextual info per alignment.\n */\nexport function getAlignmentsInfo( layout ) {\n\tconst { contentSize, wideSize, type = 'default' } = layout;\n\tconst alignmentInfo = {};\n\tconst sizeRegex
|
|
1
|
+
{"version":3,"names":["__","sprintf","LAYOUT_DEFINITIONS","appendSelectors","selectors","append","split","map","subselector","join","getBlockGapCSS","selector","layoutDefinitions","layoutType","blockGapValue","output","spacingStyles","length","forEach","gapStyle","trim","Object","entries","rules","cssProperty","value","getAlignmentsInfo","layout","contentSize","wideSize","type","alignmentInfo","sizeRegex","test","none","wide"],"sources":["@wordpress/block-editor/src/layouts/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { LAYOUT_DEFINITIONS } from './definitions';\n\n/**\n * Utility to generate the proper CSS selector for layout styles.\n *\n * @param {string} selectors CSS selector, also supports multiple comma-separated selectors.\n * @param {string} append The string to append.\n *\n * @return {string} - CSS selector.\n */\nexport function appendSelectors( selectors, append = '' ) {\n\t// Ideally we shouldn't need the `.editor-styles-wrapper` increased specificity here\n\t// The problem though is that we have a `.editor-styles-wrapper p { margin: reset; }` style\n\t// it's used to reset the default margin added by wp-admin to paragraphs\n\t// so we need this to be higher speficity otherwise, it won't be applied to paragraphs inside containers\n\t// When the post editor is fully iframed, this extra classname could be removed.\n\n\treturn selectors\n\t\t.split( ',' )\n\t\t.map(\n\t\t\t( subselector ) =>\n\t\t\t\t`.editor-styles-wrapper ${ subselector }${\n\t\t\t\t\tappend ? ` ${ append }` : ''\n\t\t\t\t}`\n\t\t)\n\t\t.join( ',' );\n}\n\n/**\n * Get generated blockGap CSS rules based on layout definitions provided in theme.json\n * Falsy values in the layout definition's spacingStyles rules will be swapped out\n * with the provided `blockGapValue`.\n *\n * @param {string} selector The CSS selector to target for the generated rules.\n * @param {Object} layoutDefinitions Layout definitions object.\n * @param {string} layoutType The layout type (e.g. `default` or `flex`).\n * @param {string} blockGapValue The current blockGap value to be applied.\n * @return {string} The generated CSS rules.\n */\nexport function getBlockGapCSS(\n\tselector,\n\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\tlayoutType,\n\tblockGapValue\n) {\n\tlet output = '';\n\tif (\n\t\tlayoutDefinitions?.[ layoutType ]?.spacingStyles?.length &&\n\t\tblockGapValue\n\t) {\n\t\tlayoutDefinitions[ layoutType ].spacingStyles.forEach( ( gapStyle ) => {\n\t\t\toutput += `${ appendSelectors(\n\t\t\t\tselector,\n\t\t\t\tgapStyle.selector.trim()\n\t\t\t) } { `;\n\t\t\toutput += Object.entries( gapStyle.rules )\n\t\t\t\t.map(\n\t\t\t\t\t( [ cssProperty, value ] ) =>\n\t\t\t\t\t\t`${ cssProperty }: ${ value ? value : blockGapValue }`\n\t\t\t\t)\n\t\t\t\t.join( '; ' );\n\t\t\toutput += '; }';\n\t\t} );\n\t}\n\treturn output;\n}\n\n/**\n * Helper method to assign contextual info to clarify\n * alignment settings.\n *\n * Besides checking if `contentSize` and `wideSize` have a\n * value, we now show this information only if their values\n * are not a `css var`. This needs to change when parsing\n * css variables land.\n *\n * @see https://github.com/WordPress/gutenberg/pull/34710#issuecomment-918000752\n *\n * @param {Object} layout The layout object.\n * @return {Object} An object with contextual info per alignment.\n */\nexport function getAlignmentsInfo( layout ) {\n\tconst { contentSize, wideSize, type = 'default' } = layout;\n\tconst alignmentInfo = {};\n\tconst sizeRegex =\n\t\t/^(?!0)\\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i;\n\tif ( sizeRegex.test( contentSize ) && type === 'constrained' ) {\n\t\t// translators: %s: container size (i.e. 600px etc)\n\t\talignmentInfo.none = sprintf( __( 'Max %s wide' ), contentSize );\n\t}\n\tif ( sizeRegex.test( wideSize ) ) {\n\t\t// translators: %s: container size (i.e. 600px etc)\n\t\talignmentInfo.wide = sprintf( __( 'Max %s wide' ), wideSize );\n\t}\n\treturn alignmentInfo;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,SAASC,kBAAkB,QAAQ,eAAe;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAAEC,SAAS,EAAEC,MAAM,GAAG,EAAE,EAAG;EACzD;EACA;EACA;EACA;EACA;;EAEA,OAAOD,SAAS,CACdE,KAAK,CAAE,GAAI,CAAC,CACZC,GAAG,CACDC,WAAW,IACX,0BAA0BA,WAAa,GACvCH,MAAM,GAAI,IAAIA,MAAQ,EAAC,GAAG,EAC1B,EACH,CAAC,CACAI,IAAI,CAAE,GAAI,CAAC;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAC7BC,QAAQ,EACRC,iBAAiB,GAAGV,kBAAkB,EACtCW,UAAU,EACVC,aAAa,EACZ;EACD,IAAIC,MAAM,GAAG,EAAE;EACf,IACCH,iBAAiB,GAAIC,UAAU,CAAE,EAAEG,aAAa,EAAEC,MAAM,IACxDH,aAAa,EACZ;IACDF,iBAAiB,CAAEC,UAAU,CAAE,CAACG,aAAa,CAACE,OAAO,CAAIC,QAAQ,IAAM;MACtEJ,MAAM,IAAK,GAAGZ,eAAe,CAC5BQ,QAAQ,EACRQ,QAAQ,CAACR,QAAQ,CAACS,IAAI,CAAC,CACxB,CAAG,KAAI;MACPL,MAAM,IAAIM,MAAM,CAACC,OAAO,CAAEH,QAAQ,CAACI,KAAM,CAAC,CACxChB,GAAG,CACH,CAAE,CAAEiB,WAAW,EAAEC,KAAK,CAAE,KACtB,GAAGD,WAAa,KAAKC,KAAK,GAAGA,KAAK,GAAGX,aAAe,EACvD,CAAC,CACAL,IAAI,CAAE,IAAK,CAAC;MACdM,MAAM,IAAI,KAAK;IAChB,CAAE,CAAC;EACJ;EACA,OAAOA,MAAM;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASW,iBAAiBA,CAAEC,MAAM,EAAG;EAC3C,MAAM;IAAEC,WAAW;IAAEC,QAAQ;IAAEC,IAAI,GAAG;EAAU,CAAC,GAAGH,MAAM;EAC1D,MAAMI,aAAa,GAAG,CAAC,CAAC;EACxB,MAAMC,SAAS,GACd,qIAAqI;EACtI,IAAKA,SAAS,CAACC,IAAI,CAAEL,WAAY,CAAC,IAAIE,IAAI,KAAK,aAAa,EAAG;IAC9D;IACAC,aAAa,CAACG,IAAI,GAAGjC,OAAO,CAAED,EAAE,CAAE,aAAc,CAAC,EAAE4B,WAAY,CAAC;EACjE;EACA,IAAKI,SAAS,CAACC,IAAI,CAAEJ,QAAS,CAAC,EAAG;IACjC;IACAE,aAAa,CAACI,IAAI,GAAGlC,OAAO,CAAED,EAAE,CAAE,aAAc,CAAC,EAAE6B,QAAS,CAAC;EAC9D;EACA,OAAOE,aAAa;AACrB"}
|
|
@@ -5,5 +5,5 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
|
|
|
5
5
|
export const {
|
|
6
6
|
lock,
|
|
7
7
|
unlock
|
|
8
|
-
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my
|
|
8
|
+
} = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.', '@wordpress/block-editor');
|
|
9
9
|
//# sourceMappingURL=lock-unlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/block-editor/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my
|
|
1
|
+
{"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/block-editor/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',\n\t\t'@wordpress/block-editor'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,iHAAiH,EACjH,yBACD,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import { cloneBlock, __experimentalCloneSanitizedBlock, createBlock, doBlocksMatchTemplate, getBlockType, getDefaultBlockName, hasBlockSupport, switchToBlockType, synchronizeBlocksWithTemplate, getBlockSupport } from '@wordpress/blocks';
|
|
5
|
+
import { cloneBlock, __experimentalCloneSanitizedBlock, createBlock, doBlocksMatchTemplate, getBlockType, getDefaultBlockName, hasBlockSupport, switchToBlockType, synchronizeBlocksWithTemplate, getBlockSupport, isUnmodifiedDefaultBlock } from '@wordpress/blocks';
|
|
6
6
|
import { speak } from '@wordpress/a11y';
|
|
7
7
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
8
8
|
import { create, insert, remove, toHTMLString } from '@wordpress/rich-text';
|
|
@@ -849,12 +849,8 @@ export const mergeBlocks = (firstBlockClientId, secondBlockClientId) => ({
|
|
|
849
849
|
const blockA = select.getBlock(clientIdA);
|
|
850
850
|
const blockAType = getBlockType(blockA.name);
|
|
851
851
|
if (!blockAType) return;
|
|
852
|
-
if (!blockAType.merge && !getBlockSupport(blockA.name, '__experimentalOnMerge')) {
|
|
853
|
-
dispatch.selectBlock(blockA.clientId);
|
|
854
|
-
return;
|
|
855
|
-
}
|
|
856
852
|
const blockB = select.getBlock(clientIdB);
|
|
857
|
-
if (!blockAType.merge) {
|
|
853
|
+
if (!blockAType.merge && getBlockSupport(blockA.name, '__experimentalOnMerge')) {
|
|
858
854
|
// If there's no merge function defined, attempt merging inner
|
|
859
855
|
// blocks.
|
|
860
856
|
const blocksWithTheSameType = switchToBlockType(blockB, blockAType.name);
|
|
@@ -891,6 +887,18 @@ export const mergeBlocks = (firstBlockClientId, secondBlockClientId) => ({
|
|
|
891
887
|
});
|
|
892
888
|
return;
|
|
893
889
|
}
|
|
890
|
+
if (isUnmodifiedDefaultBlock(blockA)) {
|
|
891
|
+
dispatch.removeBlock(clientIdA, select.isBlockSelected(clientIdA));
|
|
892
|
+
return;
|
|
893
|
+
}
|
|
894
|
+
if (isUnmodifiedDefaultBlock(blockB)) {
|
|
895
|
+
dispatch.removeBlock(clientIdB, select.isBlockSelected(clientIdB));
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
if (!blockAType.merge) {
|
|
899
|
+
dispatch.selectBlock(blockA.clientId);
|
|
900
|
+
return;
|
|
901
|
+
}
|
|
894
902
|
const blockBType = getBlockType(blockB.name);
|
|
895
903
|
const {
|
|
896
904
|
clientId,
|