@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
|
@@ -19,29 +19,43 @@ export default function useAvailableAlignments( controls = DEFAULT_CONTROLS ) {
|
|
|
19
19
|
if ( ! controls.includes( 'none' ) ) {
|
|
20
20
|
controls = [ 'none', ...controls ];
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
const isNoneOnly = controls.length === 1 && controls[ 0 ] === 'none';
|
|
23
|
+
|
|
24
|
+
const [ wideControlsEnabled, themeSupportsLayout, isBlockBasedTheme ] =
|
|
25
|
+
useSelect(
|
|
26
|
+
( select ) => {
|
|
27
|
+
// If `isNoneOnly` is true, we'll be returning early because there is
|
|
28
|
+
// nothing to filter on an empty array. We won't need the info from
|
|
29
|
+
// the `useSelect` but we must call it anyway because Rules of Hooks.
|
|
30
|
+
// So the callback returns early to avoid block editor subscription.
|
|
31
|
+
if ( isNoneOnly ) {
|
|
32
|
+
return [ false, false, false ];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const settings = select( blockEditorStore ).getSettings();
|
|
36
|
+
return [
|
|
37
|
+
settings.alignWide ?? false,
|
|
38
|
+
settings.supportsLayout,
|
|
39
|
+
settings.__unstableIsBlockBasedTheme,
|
|
40
|
+
];
|
|
41
|
+
},
|
|
42
|
+
[ isNoneOnly ]
|
|
43
|
+
);
|
|
35
44
|
const layout = useLayout();
|
|
45
|
+
|
|
46
|
+
if ( isNoneOnly ) {
|
|
47
|
+
return EMPTY_ARRAY;
|
|
48
|
+
}
|
|
49
|
+
|
|
36
50
|
const layoutType = getLayoutType( layout?.type );
|
|
37
|
-
const layoutAlignments = layoutType.getAlignments(
|
|
38
|
-
layout,
|
|
39
|
-
isBlockBasedTheme
|
|
40
|
-
);
|
|
41
51
|
|
|
42
52
|
if ( themeSupportsLayout ) {
|
|
43
|
-
const
|
|
44
|
-
|
|
53
|
+
const layoutAlignments = layoutType.getAlignments(
|
|
54
|
+
layout,
|
|
55
|
+
isBlockBasedTheme
|
|
56
|
+
);
|
|
57
|
+
const alignments = layoutAlignments.filter( ( alignment ) =>
|
|
58
|
+
controls.includes( alignment.name )
|
|
45
59
|
);
|
|
46
60
|
// While we treat `none` as an alignment, we shouldn't return it if no
|
|
47
61
|
// other alignments exist.
|
|
@@ -55,25 +69,26 @@ export default function useAvailableAlignments( controls = DEFAULT_CONTROLS ) {
|
|
|
55
69
|
if ( layoutType.name !== 'default' && layoutType.name !== 'constrained' ) {
|
|
56
70
|
return EMPTY_ARRAY;
|
|
57
71
|
}
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
.filter(
|
|
61
|
-
(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
|
|
73
|
+
const alignments = controls
|
|
74
|
+
.filter( ( control ) => {
|
|
75
|
+
if ( layout.alignments ) {
|
|
76
|
+
return layout.alignments.includes( control );
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if ( ! wideControlsEnabled && WIDE_CONTROLS.includes( control ) ) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return DEFAULT_CONTROLS.includes( control );
|
|
84
|
+
} )
|
|
85
|
+
.map( ( name ) => ( { name } ) );
|
|
68
86
|
|
|
69
87
|
// While we treat `none` as an alignment, we shouldn't return it if no
|
|
70
88
|
// other alignments exist.
|
|
71
|
-
if (
|
|
72
|
-
enabledControls.length === 1 &&
|
|
73
|
-
enabledControls[ 0 ].name === 'none'
|
|
74
|
-
) {
|
|
89
|
+
if ( alignments.length === 1 && alignments[ 0 ].name === 'none' ) {
|
|
75
90
|
return EMPTY_ARRAY;
|
|
76
91
|
}
|
|
77
92
|
|
|
78
|
-
return
|
|
93
|
+
return alignments;
|
|
79
94
|
}
|
|
@@ -17,17 +17,20 @@ export default function useBlockControlsFill( group, shareWithChildBlocks ) {
|
|
|
17
17
|
const { clientId } = useBlockEditContext();
|
|
18
18
|
const isParentDisplayed = useSelect(
|
|
19
19
|
( select ) => {
|
|
20
|
+
if ( ! shareWithChildBlocks ) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
const { getBlockName, hasSelectedInnerBlock } =
|
|
21
25
|
select( blockEditorStore );
|
|
22
26
|
const { hasBlockSupport } = select( blocksStore );
|
|
27
|
+
|
|
23
28
|
return (
|
|
24
|
-
shareWithChildBlocks &&
|
|
25
29
|
hasBlockSupport(
|
|
26
30
|
getBlockName( clientId ),
|
|
27
31
|
'__experimentalExposeControlsToChildren',
|
|
28
32
|
false
|
|
29
|
-
) &&
|
|
30
|
-
hasSelectedInnerBlock( clientId )
|
|
33
|
+
) && hasSelectedInnerBlock( clientId )
|
|
31
34
|
);
|
|
32
35
|
},
|
|
33
36
|
[ shareWithChildBlocks, clientId ]
|
|
@@ -13,7 +13,7 @@ import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
|
13
13
|
*/
|
|
14
14
|
import styles from './block.scss';
|
|
15
15
|
|
|
16
|
-
const TEXT_BLOCKS_WITH_OUTLINE = [ 'core/missing' ];
|
|
16
|
+
const TEXT_BLOCKS_WITH_OUTLINE = [ 'core/missing', 'core/freeform' ];
|
|
17
17
|
|
|
18
18
|
function BlockOutline( {
|
|
19
19
|
blockCategory,
|
|
@@ -38,9 +38,9 @@ import BlockInvalidWarning from './block-invalid-warning';
|
|
|
38
38
|
import BlockOutline from './block-outline';
|
|
39
39
|
import { store as blockEditorStore } from '../../store';
|
|
40
40
|
import { useLayout } from './layout';
|
|
41
|
-
import
|
|
41
|
+
import { useSettings } from '../use-settings';
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const EMPTY_ARRAY = [];
|
|
44
44
|
|
|
45
45
|
// Helper function to memoize the wrapperProps since getEditWrapperProps always returns a new reference.
|
|
46
46
|
const wrapperPropsCache = new WeakMap();
|
|
@@ -215,7 +215,7 @@ function BlockListBlock( {
|
|
|
215
215
|
const parentLayout = useLayout() || {};
|
|
216
216
|
const defaultColors = useMobileGlobalStylesColors();
|
|
217
217
|
const globalStyle = useGlobalStyles();
|
|
218
|
-
const fontSizes =
|
|
218
|
+
const [ fontSizes ] = useSettings( 'typography.fontSizes' );
|
|
219
219
|
|
|
220
220
|
const onRemove = useCallback(
|
|
221
221
|
() => removeBlock( clientId ),
|
|
@@ -257,7 +257,7 @@ function BlockListBlock( {
|
|
|
257
257
|
attributes,
|
|
258
258
|
defaultColors,
|
|
259
259
|
name,
|
|
260
|
-
fontSizes
|
|
260
|
+
fontSizes || EMPTY_ARRAY
|
|
261
261
|
);
|
|
262
262
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
263
263
|
}, [
|
|
@@ -7,7 +7,7 @@ import { createContext, useContext } from '@wordpress/element';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { getLayoutType } from '../../layouts';
|
|
10
|
-
import
|
|
10
|
+
import { useSettings } from '../use-settings';
|
|
11
11
|
|
|
12
12
|
export const defaultLayout = { type: 'default' };
|
|
13
13
|
|
|
@@ -27,7 +27,7 @@ export function useLayout() {
|
|
|
27
27
|
|
|
28
28
|
export function LayoutStyle( { layout = {}, css, ...props } ) {
|
|
29
29
|
const layoutType = getLayoutType( layout.type );
|
|
30
|
-
const blockGapSupport =
|
|
30
|
+
const [ blockGapSupport ] = useSettings( 'spacing.blockGap' );
|
|
31
31
|
const hasBlockGapSupport = blockGapSupport !== null;
|
|
32
32
|
|
|
33
33
|
if ( layoutType ) {
|
|
@@ -16,6 +16,7 @@ import deprecated from '@wordpress/deprecated';
|
|
|
16
16
|
*/
|
|
17
17
|
import { ExperimentalBlockEditorProvider } from '../provider';
|
|
18
18
|
import AutoHeightBlockPreview from './auto';
|
|
19
|
+
import EditorStyles from '../editor-styles';
|
|
19
20
|
import { store as blockEditorStore } from '../../store';
|
|
20
21
|
import { BlockListItems } from '../block-list';
|
|
21
22
|
|
|
@@ -113,7 +114,11 @@ export function useBlockPreview( { blocks, props = {}, layout } ) {
|
|
|
113
114
|
[]
|
|
114
115
|
);
|
|
115
116
|
const settings = useMemo(
|
|
116
|
-
() => ( {
|
|
117
|
+
() => ( {
|
|
118
|
+
...originalSettings,
|
|
119
|
+
styles: undefined, // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.
|
|
120
|
+
__unstableIsPreviewMode: true,
|
|
121
|
+
} ),
|
|
117
122
|
[ originalSettings ]
|
|
118
123
|
);
|
|
119
124
|
const disabledRef = useDisabled();
|
|
@@ -128,6 +133,7 @@ export function useBlockPreview( { blocks, props = {}, layout } ) {
|
|
|
128
133
|
value={ renderedBlocks }
|
|
129
134
|
settings={ settings }
|
|
130
135
|
>
|
|
136
|
+
<EditorStyles />
|
|
131
137
|
<BlockListItems renderAppender={ false } layout={ layout } />
|
|
132
138
|
</ExperimentalBlockEditorProvider>
|
|
133
139
|
);
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
Popover,
|
|
15
15
|
} from '@wordpress/components';
|
|
16
16
|
import deprecated from '@wordpress/deprecated';
|
|
17
|
-
import { __ } from '@wordpress/i18n';
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* Internal dependencies
|
|
@@ -65,9 +64,7 @@ function BlockStyles( { clientId, onSwitch = noop, onHoverClassName = noop } ) {
|
|
|
65
64
|
<div className="block-editor-block-styles">
|
|
66
65
|
<div className="block-editor-block-styles__variants">
|
|
67
66
|
{ stylesToRender.map( ( style ) => {
|
|
68
|
-
const buttonText = style.
|
|
69
|
-
? __( 'Default' )
|
|
70
|
-
: style.label || style.name;
|
|
67
|
+
const buttonText = style.label || style.name;
|
|
71
68
|
|
|
72
69
|
return (
|
|
73
70
|
<Button
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
&:focus,
|
|
60
60
|
&.is-active:focus {
|
|
61
|
-
|
|
61
|
+
@include block-toolbar-button-style__focus();
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -60,10 +60,7 @@ function PreviewPatternsPopover( { patterns, onSelect } ) {
|
|
|
60
60
|
className="block-editor-block-switcher__preview__popover"
|
|
61
61
|
position="bottom right"
|
|
62
62
|
>
|
|
63
|
-
<div className="block-editor-block-switcher__preview">
|
|
64
|
-
<div className="block-editor-block-switcher__preview-title">
|
|
65
|
-
{ __( 'Preview' ) }
|
|
66
|
-
</div>
|
|
63
|
+
<div className="block-editor-block-switcher__preview is-pattern-list-preview">
|
|
67
64
|
<BlockPatternsList
|
|
68
65
|
patterns={ patterns }
|
|
69
66
|
onSelect={ onSelect }
|
|
@@ -98,6 +98,7 @@
|
|
|
98
98
|
|
|
99
99
|
.block-editor-block-switcher__preview__popover {
|
|
100
100
|
display: none;
|
|
101
|
+
overflow: hidden;
|
|
101
102
|
|
|
102
103
|
// Position correctly. Needs specificity.
|
|
103
104
|
&.components-popover {
|
|
@@ -115,6 +116,7 @@
|
|
|
115
116
|
border-radius: $radius-block-ui;
|
|
116
117
|
outline: none;
|
|
117
118
|
box-shadow: none;
|
|
119
|
+
overflow: auto;
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
.block-editor-block-switcher__preview {
|
|
@@ -124,6 +126,10 @@
|
|
|
124
126
|
// Use padding to prevent the pattern previews focus style from being cut-off.
|
|
125
127
|
padding: 0 $grid-unit-20;
|
|
126
128
|
overflow: hidden;
|
|
129
|
+
|
|
130
|
+
&.is-pattern-list-preview {
|
|
131
|
+
overflow: unset;
|
|
132
|
+
}
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
135
|
|
|
@@ -188,6 +188,7 @@ function BlockContextualToolbar( { focusOnMount, isFixed, ...props } ) {
|
|
|
188
188
|
className={ classes }
|
|
189
189
|
/* translators: accessibility text for the block toolbar */
|
|
190
190
|
aria-label={ __( 'Block tools' ) }
|
|
191
|
+
variant={ isFixed ? 'unstyled' : undefined }
|
|
191
192
|
{ ...props }
|
|
192
193
|
>
|
|
193
194
|
{ ! isCollapsed && <BlockToolbar hideDragHandle={ isFixed } /> }
|
|
@@ -16,7 +16,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
16
16
|
import AllInputControl from './all-input-control';
|
|
17
17
|
import InputControls from './input-controls';
|
|
18
18
|
import LinkedButton from './linked-button';
|
|
19
|
-
import
|
|
19
|
+
import { useSettings } from '../use-settings';
|
|
20
20
|
import {
|
|
21
21
|
getAllValue,
|
|
22
22
|
getAllUnit,
|
|
@@ -67,8 +67,9 @@ export default function BorderRadiusControl( { onChange, values } ) {
|
|
|
67
67
|
)[ 1 ],
|
|
68
68
|
} );
|
|
69
69
|
|
|
70
|
+
const [ availableUnits ] = useSettings( 'spacing.units' );
|
|
70
71
|
const units = useCustomUnits( {
|
|
71
|
-
availableUnits:
|
|
72
|
+
availableUnits: availableUnits || [ 'px', 'em', 'rem' ],
|
|
72
73
|
} );
|
|
73
74
|
|
|
74
75
|
const unit = getAllUnit( selectedUnits );
|
|
@@ -175,6 +175,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
175
175
|
aria-label="Custom color picker. The currently selected color is called "red" and has a value of "#f00"."
|
|
176
176
|
class="components-color-palette__custom-color-button"
|
|
177
177
|
style="background: rgb(255, 0, 0);"
|
|
178
|
+
type="button"
|
|
178
179
|
/>
|
|
179
180
|
<div
|
|
180
181
|
class="components-flex components-h-stack components-v-stack components-color-palette__custom-color-text-wrapper emotion-12 emotion-5"
|
|
@@ -219,10 +220,11 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
219
220
|
aria-label="Color: red"
|
|
220
221
|
aria-selected="true"
|
|
221
222
|
class="components-button components-circular-option-picker__option"
|
|
223
|
+
data-active-item=""
|
|
224
|
+
data-command=""
|
|
222
225
|
id="components-circular-option-picker-0-0"
|
|
223
226
|
role="option"
|
|
224
227
|
style="background-color: rgb(255, 0, 0); color: rgb(255, 0, 0);"
|
|
225
|
-
tabindex="0"
|
|
226
228
|
type="button"
|
|
227
229
|
/>
|
|
228
230
|
<svg
|
|
@@ -6,18 +6,18 @@ import { createHigherOrderComponent } from '@wordpress/compose';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import { useSettings } from '../use-settings';
|
|
10
10
|
|
|
11
11
|
export default createHigherOrderComponent( ( WrappedComponent ) => {
|
|
12
12
|
return ( props ) => {
|
|
13
|
-
const colorsFeature =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
const [ colorsFeature, enableCustomColors ] = useSettings(
|
|
14
|
+
'color.palette',
|
|
15
|
+
'color.custom'
|
|
16
|
+
);
|
|
17
|
+
const {
|
|
18
|
+
colors = colorsFeature,
|
|
19
|
+
disableCustomColors = ! enableCustomColors,
|
|
20
|
+
} = props;
|
|
21
21
|
const hasColorsToChoose =
|
|
22
22
|
( colors && colors.length > 0 ) || ! disableCustomColors;
|
|
23
23
|
return (
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
getColorObjectByAttributeValues,
|
|
14
14
|
getMostReadableColor,
|
|
15
15
|
} from './utils';
|
|
16
|
-
import
|
|
16
|
+
import { useSettings } from '../use-settings';
|
|
17
17
|
import { kebabCase } from '../../utils/object';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -51,12 +51,11 @@ const withCustomColorPalette = ( colorsArray ) =>
|
|
|
51
51
|
const withEditorColorPalette = () =>
|
|
52
52
|
createHigherOrderComponent(
|
|
53
53
|
( WrappedComponent ) => ( props ) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const defaultPalette = useSetting( 'color.palette.default' );
|
|
54
|
+
const [ userPalette, themePalette, defaultPalette ] = useSettings(
|
|
55
|
+
'color.palette.custom',
|
|
56
|
+
'color.palette.theme',
|
|
57
|
+
'color.palette.default'
|
|
58
|
+
);
|
|
60
59
|
const allColors = useMemo(
|
|
61
60
|
() => [
|
|
62
61
|
...( userPalette || [] ),
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
/**
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
|
-
import
|
|
21
|
+
import { useSettings } from '../use-settings';
|
|
22
22
|
|
|
23
23
|
const colorsAndGradientKeys = [
|
|
24
24
|
'colors',
|
|
@@ -160,17 +160,20 @@ function ColorGradientControlInner( {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
function ColorGradientControlSelect( props ) {
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
colorGradientSettings.disableCustomGradients = ! useSetting(
|
|
163
|
+
const [ colors, gradients, customColors, customGradients ] = useSettings(
|
|
164
|
+
'color.palette',
|
|
165
|
+
'color.gradients',
|
|
166
|
+
'color.custom',
|
|
168
167
|
'color.customGradient'
|
|
169
168
|
);
|
|
170
169
|
|
|
171
170
|
return (
|
|
172
171
|
<ColorGradientControlInner
|
|
173
|
-
{
|
|
172
|
+
colors={ colors }
|
|
173
|
+
gradients={ gradients }
|
|
174
|
+
disableCustomColors={ ! customColors }
|
|
175
|
+
disableCustomGradients={ ! customGradients }
|
|
176
|
+
{ ...props }
|
|
174
177
|
/>
|
|
175
178
|
);
|
|
176
179
|
}
|
|
@@ -77,14 +77,16 @@ $swatch-gap: 12px;
|
|
|
77
77
|
border-right: 1px solid $gray-300;
|
|
78
78
|
border-bottom: 1px solid $gray-300;
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
// Identify the first visible instance as placeholder items will not have this class.
|
|
81
|
+
&:nth-child(1 of &) {
|
|
81
82
|
margin-top: $grid-unit-30;
|
|
82
83
|
border-top-left-radius: $radius-block-ui;
|
|
83
84
|
border-top-right-radius: $radius-block-ui;
|
|
84
85
|
border-top: 1px solid $gray-300;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
// Identify the last visible instance as placeholder items will not have this class.
|
|
89
|
+
&:nth-last-child(1 of &) {
|
|
88
90
|
border-bottom-left-radius: $radius-block-ui;
|
|
89
91
|
border-bottom-right-radius: $radius-block-ui;
|
|
90
92
|
}
|
|
@@ -7,7 +7,7 @@ import { _x } from '@wordpress/i18n';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import
|
|
10
|
+
import { useSettings } from '../use-settings';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Retrieves color and gradient related settings.
|
|
@@ -18,14 +18,34 @@ import useSetting from '../use-setting';
|
|
|
18
18
|
* @return {Object} Color and gradient related settings.
|
|
19
19
|
*/
|
|
20
20
|
export default function useMultipleOriginColorsAndGradients() {
|
|
21
|
+
const [
|
|
22
|
+
enableCustomColors,
|
|
23
|
+
customColors,
|
|
24
|
+
themeColors,
|
|
25
|
+
defaultColors,
|
|
26
|
+
shouldDisplayDefaultColors,
|
|
27
|
+
enableCustomGradients,
|
|
28
|
+
customGradients,
|
|
29
|
+
themeGradients,
|
|
30
|
+
defaultGradients,
|
|
31
|
+
shouldDisplayDefaultGradients,
|
|
32
|
+
] = useSettings(
|
|
33
|
+
'color.custom',
|
|
34
|
+
'color.palette.custom',
|
|
35
|
+
'color.palette.theme',
|
|
36
|
+
'color.palette.default',
|
|
37
|
+
'color.defaultPalette',
|
|
38
|
+
'color.customGradient',
|
|
39
|
+
'color.gradients.custom',
|
|
40
|
+
'color.gradients.theme',
|
|
41
|
+
'color.gradients.default',
|
|
42
|
+
'color.defaultGradients'
|
|
43
|
+
);
|
|
44
|
+
|
|
21
45
|
const colorGradientSettings = {
|
|
22
|
-
disableCustomColors: !
|
|
23
|
-
disableCustomGradients: !
|
|
46
|
+
disableCustomColors: ! enableCustomColors,
|
|
47
|
+
disableCustomGradients: ! enableCustomGradients,
|
|
24
48
|
};
|
|
25
|
-
const customColors = useSetting( 'color.palette.custom' );
|
|
26
|
-
const themeColors = useSetting( 'color.palette.theme' );
|
|
27
|
-
const defaultColors = useSetting( 'color.palette.default' );
|
|
28
|
-
const shouldDisplayDefaultColors = useSetting( 'color.defaultPalette' );
|
|
29
49
|
|
|
30
50
|
colorGradientSettings.colors = useMemo( () => {
|
|
31
51
|
const result = [];
|
|
@@ -62,18 +82,12 @@ export default function useMultipleOriginColorsAndGradients() {
|
|
|
62
82
|
}
|
|
63
83
|
return result;
|
|
64
84
|
}, [
|
|
65
|
-
defaultColors,
|
|
66
|
-
themeColors,
|
|
67
85
|
customColors,
|
|
86
|
+
themeColors,
|
|
87
|
+
defaultColors,
|
|
68
88
|
shouldDisplayDefaultColors,
|
|
69
89
|
] );
|
|
70
90
|
|
|
71
|
-
const customGradients = useSetting( 'color.gradients.custom' );
|
|
72
|
-
const themeGradients = useSetting( 'color.gradients.theme' );
|
|
73
|
-
const defaultGradients = useSetting( 'color.gradients.default' );
|
|
74
|
-
const shouldDisplayDefaultGradients = useSetting(
|
|
75
|
-
'color.defaultGradients'
|
|
76
|
-
);
|
|
77
91
|
colorGradientSettings.gradients = useMemo( () => {
|
|
78
92
|
const result = [];
|
|
79
93
|
if ( themeGradients && themeGradients.length ) {
|
|
@@ -131,31 +131,6 @@ function DimensionsTool( {
|
|
|
131
131
|
onChange( nextValue );
|
|
132
132
|
} }
|
|
133
133
|
/>
|
|
134
|
-
{ showScaleControl && (
|
|
135
|
-
<ScaleTool
|
|
136
|
-
panelId={ panelId }
|
|
137
|
-
options={ scaleOptions }
|
|
138
|
-
defaultValue={ defaultScale }
|
|
139
|
-
value={ lastScale }
|
|
140
|
-
onChange={ ( nextScale ) => {
|
|
141
|
-
const nextValue = { ...value };
|
|
142
|
-
|
|
143
|
-
// 'fill' is CSS default, so it gets treated as null.
|
|
144
|
-
nextScale = nextScale === 'fill' ? null : nextScale;
|
|
145
|
-
|
|
146
|
-
setLastScale( nextScale );
|
|
147
|
-
|
|
148
|
-
// Update scale.
|
|
149
|
-
if ( ! nextScale ) {
|
|
150
|
-
delete nextValue.scale;
|
|
151
|
-
} else {
|
|
152
|
-
nextValue.scale = nextScale;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
onChange( nextValue );
|
|
156
|
-
} }
|
|
157
|
-
/>
|
|
158
|
-
) }
|
|
159
134
|
<WidthHeightTool
|
|
160
135
|
panelId={ panelId }
|
|
161
136
|
units={ unitsOptions }
|
|
@@ -205,6 +180,31 @@ function DimensionsTool( {
|
|
|
205
180
|
onChange( nextValue );
|
|
206
181
|
} }
|
|
207
182
|
/>
|
|
183
|
+
{ showScaleControl && (
|
|
184
|
+
<ScaleTool
|
|
185
|
+
panelId={ panelId }
|
|
186
|
+
options={ scaleOptions }
|
|
187
|
+
defaultValue={ defaultScale }
|
|
188
|
+
value={ lastScale }
|
|
189
|
+
onChange={ ( nextScale ) => {
|
|
190
|
+
const nextValue = { ...value };
|
|
191
|
+
|
|
192
|
+
// 'fill' is CSS default, so it gets treated as null.
|
|
193
|
+
nextScale = nextScale === 'fill' ? null : nextScale;
|
|
194
|
+
|
|
195
|
+
setLastScale( nextScale );
|
|
196
|
+
|
|
197
|
+
// Update scale.
|
|
198
|
+
if ( ! nextScale ) {
|
|
199
|
+
delete nextValue.scale;
|
|
200
|
+
} else {
|
|
201
|
+
nextValue.scale = nextScale;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
onChange( nextValue );
|
|
205
|
+
} }
|
|
206
|
+
/>
|
|
207
|
+
) }
|
|
208
208
|
</>
|
|
209
209
|
);
|
|
210
210
|
}
|
|
@@ -110,7 +110,7 @@ export default function ScaleTool( {
|
|
|
110
110
|
help={ scaleHelp[ displayValue ] }
|
|
111
111
|
value={ displayValue }
|
|
112
112
|
onChange={ onChange }
|
|
113
|
-
|
|
113
|
+
size={ '__unstable-large' }
|
|
114
114
|
>
|
|
115
115
|
{ options.map( ( option ) => (
|
|
116
116
|
<ToggleGroupControlOption
|
|
@@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import
|
|
10
|
+
import { useSettings } from '../use-settings';
|
|
11
11
|
|
|
12
12
|
export default function FontFamilyControl( {
|
|
13
13
|
value = '',
|
|
@@ -15,7 +15,7 @@ export default function FontFamilyControl( {
|
|
|
15
15
|
fontFamilies,
|
|
16
16
|
...props
|
|
17
17
|
} ) {
|
|
18
|
-
const blockLevelFontFamilies =
|
|
18
|
+
const [ blockLevelFontFamilies ] = useSettings( 'typography.fontFamilies' );
|
|
19
19
|
if ( ! fontFamilies ) {
|
|
20
20
|
fontFamilies = blockLevelFontFamilies;
|
|
21
21
|
}
|
|
@@ -6,17 +6,19 @@ import { FontSizePicker as BaseFontSizePicker } from '@wordpress/components';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
9
|
+
import { useSettings } from '../use-settings';
|
|
10
10
|
|
|
11
11
|
function FontSizePicker( props ) {
|
|
12
|
-
const fontSizes =
|
|
13
|
-
|
|
12
|
+
const [ fontSizes, customFontSize ] = useSettings(
|
|
13
|
+
'typography.fontSizes',
|
|
14
|
+
'typography.customFontSize'
|
|
15
|
+
);
|
|
14
16
|
|
|
15
17
|
return (
|
|
16
18
|
<BaseFontSizePicker
|
|
17
19
|
{ ...props }
|
|
18
20
|
fontSizes={ fontSizes }
|
|
19
|
-
disableCustomFontSizes={
|
|
21
|
+
disableCustomFontSizes={ ! customFontSize }
|
|
20
22
|
/>
|
|
21
23
|
);
|
|
22
24
|
}
|