@wordpress/block-editor 13.4.0 → 14.0.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 +11 -0
- package/README.md +11 -1
- package/build/components/block-breadcrumb/index.js +3 -1
- package/build/components/block-breadcrumb/index.js.map +1 -1
- package/build/components/block-draggable/index.js +2 -2
- package/build/components/block-draggable/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-block-refs.js +24 -32
- package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build/components/block-mover/index.js +1 -2
- package/build/components/block-mover/index.js.map +1 -1
- package/build/components/block-popover/cover.js +1 -1
- package/build/components/block-popover/cover.js.map +1 -1
- package/build/components/block-popover/inbetween.js +2 -2
- package/build/components/block-popover/inbetween.js.map +1 -1
- package/build/components/block-popover/index.js +2 -2
- package/build/components/block-popover/index.js.map +1 -1
- package/build/components/block-tools/block-selection-button.js +1 -2
- package/build/components/block-tools/block-selection-button.js.map +1 -1
- package/build/components/block-tools/index.js +1 -1
- package/build/components/block-tools/index.js.map +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build/components/block-tools/zoom-out-mode-inserters.js +15 -16
- package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build/components/block-tools/zoom-out-toolbar.js +0 -1
- package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build/components/child-layout-control/index.js +3 -1
- package/build/components/child-layout-control/index.js.map +1 -1
- package/build/components/dimensions-tool/scale-tool.js +1 -0
- package/build/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build/components/font-family/index.js +12 -0
- package/build/components/font-family/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +55 -51
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/image-settings-panel.js +1 -0
- package/build/components/global-styles/image-settings-panel.js.map +1 -1
- package/build/components/global-styles/theme-file-uri-utils.js +0 -59
- package/build/components/global-styles/theme-file-uri-utils.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +0 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +58 -39
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +96 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/grid/grid-item-movers.js +30 -26
- package/build/components/grid/grid-item-movers.js.map +1 -1
- package/build/components/grid/grid-item-resizer.js +14 -15
- package/build/components/grid/grid-item-resizer.js.map +1 -1
- package/build/components/grid/grid-visualizer.js +1 -1
- package/build/components/grid/grid-visualizer.js.map +1 -1
- package/build/components/grid/use-grid-layout-sync.js +56 -20
- package/build/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build/components/iframe/index.js +4 -8
- package/build/components/iframe/index.js.map +1 -1
- package/build/components/inserter/category-tabs/index.js +29 -2
- package/build/components/inserter/category-tabs/index.js.map +1 -1
- package/build/components/inserter/menu.js +2 -2
- package/build/components/inserter/menu.js.map +1 -1
- package/build/components/line-height-control/index.js +0 -15
- package/build/components/line-height-control/index.js.map +1 -1
- package/build/components/link-control/search-input.js +0 -1
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/media-replace-flow/index.js +3 -1
- package/build/components/media-replace-flow/index.js.map +1 -1
- package/build/components/resolution-tool/index.js +1 -0
- package/build/components/resolution-tool/index.js.map +1 -1
- package/build/components/skip-to-selected-block/index.js +4 -2
- package/build/components/skip-to-selected-block/index.js.map +1 -1
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -6
- package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build/components/url-input/button.js +0 -1
- package/build/components/url-input/button.js.map +1 -1
- package/build/components/url-input/index.js +1 -11
- package/build/components/url-input/index.js.map +1 -1
- package/build/components/url-popover/link-editor.js +0 -1
- package/build/components/url-popover/link-editor.js.map +1 -1
- package/build/components/use-block-drop-zone/index.js +30 -4
- package/build/components/use-block-drop-zone/index.js.map +1 -1
- package/build/components/use-on-block-drop/index.js +3 -6
- package/build/components/use-on-block-drop/index.js.map +1 -1
- package/build/components/use-resize-canvas/index.js +1 -3
- package/build/components/use-resize-canvas/index.js.map +1 -1
- package/build/components/use-settings/index.js +2 -1
- package/build/components/use-settings/index.js.map +1 -1
- package/build/hooks/block-bindings.js +248 -36
- package/build/hooks/block-bindings.js.map +1 -1
- package/build/hooks/block-hooks.js +1 -0
- package/build/hooks/block-hooks.js.map +1 -1
- package/build/hooks/block-style-variation.js +2 -2
- package/build/hooks/block-style-variation.js.map +1 -1
- package/build/hooks/contrast-checker.js +6 -6
- package/build/hooks/contrast-checker.js.map +1 -1
- package/build/hooks/duotone.js +3 -3
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/index.js +7 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/line-height.js +0 -1
- package/build/hooks/line-height.js.map +1 -1
- package/build/hooks/spacing-visualizer.js +1 -1
- package/build/hooks/spacing-visualizer.js.map +1 -1
- package/build/hooks/use-bindings-attributes.js +4 -0
- package/build/hooks/use-bindings-attributes.js.map +1 -1
- package/build/hooks/use-zoom-out.js +1 -1
- package/build/hooks/use-zoom-out.js.map +1 -1
- package/build/hooks/utils.js +20 -0
- package/build/hooks/utils.js.map +1 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/private-apis.js +0 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +9 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +4 -4
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-editor-region.js +1 -1
- package/build/utils/get-editor-region.js.map +1 -1
- package/build/utils/get-px-from-css-unit.js +1 -1
- package/build/utils/get-px-from-css-unit.js.map +1 -1
- package/build-module/components/block-breadcrumb/index.js +4 -2
- package/build-module/components/block-breadcrumb/index.js.map +1 -1
- package/build-module/components/block-draggable/index.js +3 -3
- package/build-module/components/block-draggable/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-block-refs.js +24 -34
- package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
- package/build-module/components/block-mover/index.js +1 -2
- package/build-module/components/block-mover/index.js.map +1 -1
- package/build-module/components/block-popover/cover.js +1 -1
- package/build-module/components/block-popover/cover.js.map +1 -1
- package/build-module/components/block-popover/inbetween.js +1 -1
- package/build-module/components/block-popover/inbetween.js.map +1 -1
- package/build-module/components/block-popover/index.js +1 -1
- package/build-module/components/block-popover/index.js.map +1 -1
- package/build-module/components/block-tools/block-selection-button.js +1 -2
- package/build-module/components/block-tools/block-selection-button.js.map +1 -1
- package/build-module/components/block-tools/index.js +1 -1
- package/build-module/components/block-tools/index.js.map +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-mode-inserters.js +16 -17
- package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js +0 -1
- package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +3 -1
- package/build-module/components/child-layout-control/index.js.map +1 -1
- package/build-module/components/dimensions-tool/scale-tool.js +1 -0
- package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
- package/build-module/components/font-family/index.js +11 -0
- package/build-module/components/font-family/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +55 -51
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/image-settings-panel.js +1 -0
- package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
- package/build-module/components/global-styles/theme-file-uri-utils.js +0 -58
- package/build-module/components/global-styles/theme-file-uri-utils.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +0 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +57 -38
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +92 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/grid/grid-item-movers.js +30 -26
- package/build-module/components/grid/grid-item-movers.js.map +1 -1
- package/build-module/components/grid/grid-item-resizer.js +14 -15
- package/build-module/components/grid/grid-item-resizer.js.map +1 -1
- package/build-module/components/grid/grid-visualizer.js +1 -1
- package/build-module/components/grid/grid-visualizer.js.map +1 -1
- package/build-module/components/grid/use-grid-layout-sync.js +56 -20
- package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
- package/build-module/components/iframe/index.js +4 -8
- package/build-module/components/iframe/index.js.map +1 -1
- package/build-module/components/inserter/category-tabs/index.js +30 -3
- package/build-module/components/inserter/category-tabs/index.js.map +1 -1
- package/build-module/components/inserter/menu.js +2 -2
- package/build-module/components/inserter/menu.js.map +1 -1
- package/build-module/components/line-height-control/index.js +0 -14
- package/build-module/components/line-height-control/index.js.map +1 -1
- package/build-module/components/link-control/search-input.js +0 -1
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/media-replace-flow/index.js +3 -1
- package/build-module/components/media-replace-flow/index.js.map +1 -1
- package/build-module/components/resolution-tool/index.js +1 -0
- package/build-module/components/resolution-tool/index.js.map +1 -1
- package/build-module/components/skip-to-selected-block/index.js +5 -3
- package/build-module/components/skip-to-selected-block/index.js.map +1 -1
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -6
- package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
- package/build-module/components/url-input/button.js +0 -1
- package/build-module/components/url-input/button.js.map +1 -1
- package/build-module/components/url-input/index.js +1 -11
- package/build-module/components/url-input/index.js.map +1 -1
- package/build-module/components/url-popover/link-editor.js +0 -1
- package/build-module/components/url-popover/link-editor.js.map +1 -1
- package/build-module/components/use-block-drop-zone/index.js +30 -4
- package/build-module/components/use-block-drop-zone/index.js.map +1 -1
- package/build-module/components/use-on-block-drop/index.js +3 -6
- package/build-module/components/use-on-block-drop/index.js.map +1 -1
- package/build-module/components/use-resize-canvas/index.js +1 -3
- package/build-module/components/use-resize-canvas/index.js.map +1 -1
- package/build-module/components/use-settings/index.js +2 -1
- package/build-module/components/use-settings/index.js.map +1 -1
- package/build-module/hooks/block-bindings.js +253 -40
- package/build-module/hooks/block-bindings.js.map +1 -1
- package/build-module/hooks/block-hooks.js +1 -0
- package/build-module/hooks/block-hooks.js.map +1 -1
- package/build-module/hooks/block-style-variation.js +3 -3
- package/build-module/hooks/block-style-variation.js.map +1 -1
- package/build-module/hooks/contrast-checker.js +7 -7
- package/build-module/hooks/contrast-checker.js.map +1 -1
- package/build-module/hooks/duotone.js +4 -4
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/index.js +2 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/line-height.js +0 -1
- package/build-module/hooks/line-height.js.map +1 -1
- package/build-module/hooks/spacing-visualizer.js +1 -1
- package/build-module/hooks/spacing-visualizer.js.map +1 -1
- package/build-module/hooks/use-bindings-attributes.js +3 -0
- package/build-module/hooks/use-bindings-attributes.js.map +1 -1
- package/build-module/hooks/use-zoom-out.js +1 -1
- package/build-module/hooks/use-zoom-out.js.map +1 -1
- package/build-module/hooks/utils.js +19 -0
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/private-apis.js +1 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +9 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +4 -4
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-editor-region.js +1 -1
- package/build-module/utils/get-editor-region.js.map +1 -1
- package/build-module/utils/get-px-from-css-unit.js +1 -1
- package/build-module/utils/get-px-from-css-unit.js.map +1 -1
- package/build-style/content-rtl.css +5 -12
- package/build-style/content.css +5 -12
- package/build-style/default-editor-styles-rtl.css +3 -0
- package/build-style/default-editor-styles.css +3 -0
- package/build-style/style-rtl.css +88 -46
- package/build-style/style.css +88 -46
- package/package.json +31 -31
- package/src/autocompleters/style.scss +4 -0
- package/src/components/block-breadcrumb/index.js +4 -2
- package/src/components/block-canvas/style.scss +1 -0
- package/src/components/block-draggable/index.js +3 -3
- package/src/components/block-list/use-block-props/use-block-refs.js +27 -43
- package/src/components/block-mover/index.js +5 -2
- package/src/components/block-popover/cover.js +1 -1
- package/src/components/block-popover/inbetween.js +1 -1
- package/src/components/block-popover/index.js +1 -1
- package/src/components/block-tools/block-selection-button.js +1 -2
- package/src/components/block-tools/index.js +5 -6
- package/src/components/block-tools/use-block-toolbar-popover-props.js +1 -1
- package/src/components/block-tools/zoom-out-mode-inserters.js +14 -18
- package/src/components/block-tools/zoom-out-toolbar.js +0 -1
- package/src/components/button-block-appender/content.scss +1 -1
- package/src/components/child-layout-control/index.js +2 -0
- package/src/components/color-palette/test/__snapshots__/control.js.snap +2 -2
- package/src/components/colors-gradients/test/control.js +3 -2
- package/src/components/dimensions-tool/scale-tool.js +1 -0
- package/src/components/font-family/README.md +8 -0
- package/src/components/font-family/index.js +16 -0
- package/src/components/font-family/stories/index.story.js +54 -0
- package/src/components/global-styles/background-panel.js +69 -61
- package/src/components/global-styles/image-settings-panel.js +1 -0
- package/src/components/global-styles/style.scss +0 -10
- package/src/components/global-styles/test/theme-file-uri-utils.js +1 -26
- package/src/components/global-styles/test/use-global-styles-output.js +49 -4
- package/src/components/global-styles/test/utils.js +120 -0
- package/src/components/global-styles/theme-file-uri-utils.js +0 -59
- package/src/components/global-styles/typography-panel.js +0 -1
- package/src/components/global-styles/use-global-styles-output.js +67 -48
- package/src/components/global-styles/utils.js +112 -0
- package/src/components/grid/grid-item-movers.js +46 -44
- package/src/components/grid/grid-item-resizer.js +11 -17
- package/src/components/grid/grid-visualizer.js +1 -1
- package/src/components/grid/style.scss +60 -10
- package/src/components/grid/use-grid-layout-sync.js +68 -14
- package/src/components/iframe/content.scss +2 -2
- package/src/components/iframe/index.js +3 -7
- package/src/components/inserter/category-tabs/index.js +35 -2
- package/src/components/inserter/menu.js +2 -2
- package/src/components/inserter/style.scss +16 -11
- package/src/components/inspector-controls/README.md +5 -0
- package/src/components/line-height-control/README.md +0 -8
- package/src/components/line-height-control/index.js +1 -21
- package/src/components/line-height-control/stories/index.story.js +0 -1
- package/src/components/line-height-control/test/index.js +1 -7
- package/src/components/link-control/search-input.js +0 -1
- package/src/components/media-replace-flow/README.md +7 -0
- package/src/components/media-replace-flow/index.js +3 -1
- package/src/components/resolution-tool/index.js +1 -0
- package/src/components/responsive-block-control/test/index.js +5 -1
- package/src/components/skip-to-selected-block/index.js +5 -3
- package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -6
- package/src/components/tabbed-sidebar/style.scss +1 -19
- package/src/components/url-input/README.md +0 -5
- package/src/components/url-input/button.js +0 -1
- package/src/components/url-input/index.js +1 -15
- package/src/components/url-popover/link-editor.js +0 -1
- package/src/components/use-block-drop-zone/index.js +66 -14
- package/src/components/use-on-block-drop/index.js +1 -9
- package/src/components/use-resize-canvas/index.js +1 -3
- package/src/components/use-settings/index.js +2 -1
- package/src/hooks/block-bindings.js +303 -52
- package/src/hooks/block-bindings.scss +13 -2
- package/src/hooks/block-hooks.js +1 -0
- package/src/hooks/block-hooks.scss +1 -0
- package/src/hooks/block-style-variation.js +3 -3
- package/src/hooks/contrast-checker.js +7 -7
- package/src/hooks/duotone.js +4 -4
- package/src/hooks/index.js +2 -1
- package/src/hooks/line-height.js +0 -1
- package/src/hooks/spacing-visualizer.js +1 -1
- package/src/hooks/use-bindings-attributes.js +4 -0
- package/src/hooks/use-editor-wrapper-styles.native.scss +1 -0
- package/src/hooks/use-zoom-out.js +1 -1
- package/src/hooks/utils.js +14 -1
- package/src/index.js +1 -0
- package/src/private-apis.js +1 -2
- package/src/store/actions.js +13 -5
- package/src/store/selectors.js +4 -4
- package/src/style.scss +1 -1
- package/src/utils/get-editor-region.js +1 -1
- package/src/utils/get-px-from-css-unit.js +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -30
- package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +0 -1
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -23
- package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +0 -1
- package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"description": "Generic block editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -36,35 +36,35 @@
|
|
|
36
36
|
"@emotion/react": "^11.7.1",
|
|
37
37
|
"@emotion/styled": "^11.6.0",
|
|
38
38
|
"@react-spring/web": "^9.4.5",
|
|
39
|
-
"@wordpress/a11y": "^4.
|
|
40
|
-
"@wordpress/api-fetch": "^7.
|
|
41
|
-
"@wordpress/blob": "^4.
|
|
42
|
-
"@wordpress/blocks": "^13.
|
|
43
|
-
"@wordpress/commands": "^1.
|
|
44
|
-
"@wordpress/components": "^28.
|
|
45
|
-
"@wordpress/compose": "^7.
|
|
46
|
-
"@wordpress/data": "^10.
|
|
47
|
-
"@wordpress/date": "^5.
|
|
48
|
-
"@wordpress/deprecated": "^4.
|
|
49
|
-
"@wordpress/dom": "^4.
|
|
50
|
-
"@wordpress/element": "^6.
|
|
51
|
-
"@wordpress/escape-html": "^3.
|
|
52
|
-
"@wordpress/hooks": "^4.
|
|
53
|
-
"@wordpress/html-entities": "^4.
|
|
54
|
-
"@wordpress/i18n": "^5.
|
|
55
|
-
"@wordpress/icons": "^10.
|
|
56
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
57
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
58
|
-
"@wordpress/keycodes": "^4.
|
|
59
|
-
"@wordpress/notices": "^5.
|
|
60
|
-
"@wordpress/preferences": "^4.
|
|
61
|
-
"@wordpress/private-apis": "^1.
|
|
62
|
-
"@wordpress/rich-text": "^7.
|
|
63
|
-
"@wordpress/style-engine": "^2.
|
|
64
|
-
"@wordpress/token-list": "^3.
|
|
65
|
-
"@wordpress/url": "^4.
|
|
66
|
-
"@wordpress/warning": "^3.
|
|
67
|
-
"@wordpress/wordcount": "^4.
|
|
39
|
+
"@wordpress/a11y": "^4.5.0",
|
|
40
|
+
"@wordpress/api-fetch": "^7.5.0",
|
|
41
|
+
"@wordpress/blob": "^4.5.0",
|
|
42
|
+
"@wordpress/blocks": "^13.5.0",
|
|
43
|
+
"@wordpress/commands": "^1.5.0",
|
|
44
|
+
"@wordpress/components": "^28.5.0",
|
|
45
|
+
"@wordpress/compose": "^7.5.0",
|
|
46
|
+
"@wordpress/data": "^10.5.0",
|
|
47
|
+
"@wordpress/date": "^5.5.0",
|
|
48
|
+
"@wordpress/deprecated": "^4.5.0",
|
|
49
|
+
"@wordpress/dom": "^4.5.0",
|
|
50
|
+
"@wordpress/element": "^6.5.0",
|
|
51
|
+
"@wordpress/escape-html": "^3.5.0",
|
|
52
|
+
"@wordpress/hooks": "^4.5.0",
|
|
53
|
+
"@wordpress/html-entities": "^4.5.0",
|
|
54
|
+
"@wordpress/i18n": "^5.5.0",
|
|
55
|
+
"@wordpress/icons": "^10.5.0",
|
|
56
|
+
"@wordpress/is-shallow-equal": "^5.5.0",
|
|
57
|
+
"@wordpress/keyboard-shortcuts": "^5.5.0",
|
|
58
|
+
"@wordpress/keycodes": "^4.5.0",
|
|
59
|
+
"@wordpress/notices": "^5.5.0",
|
|
60
|
+
"@wordpress/preferences": "^4.5.0",
|
|
61
|
+
"@wordpress/private-apis": "^1.5.0",
|
|
62
|
+
"@wordpress/rich-text": "^7.5.0",
|
|
63
|
+
"@wordpress/style-engine": "^2.5.0",
|
|
64
|
+
"@wordpress/token-list": "^3.5.0",
|
|
65
|
+
"@wordpress/url": "^4.5.0",
|
|
66
|
+
"@wordpress/warning": "^3.5.0",
|
|
67
|
+
"@wordpress/wordcount": "^4.5.0",
|
|
68
68
|
"change-case": "^4.1.2",
|
|
69
69
|
"clsx": "^2.1.1",
|
|
70
70
|
"colord": "^2.7.0",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"publishConfig": {
|
|
87
87
|
"access": "public"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "c3101ab024e2bfc85d525c6d247e0d57cafc9fd9"
|
|
90
90
|
}
|
|
@@ -5,6 +5,7 @@ import { Button } from '@wordpress/components';
|
|
|
5
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { chevronRightSmall, Icon } from '@wordpress/icons';
|
|
8
|
+
import { useRef } from '@wordpress/element';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
@@ -12,7 +13,7 @@ import { chevronRightSmall, Icon } from '@wordpress/icons';
|
|
|
12
13
|
import BlockTitle from '../block-title';
|
|
13
14
|
import { store as blockEditorStore } from '../../store';
|
|
14
15
|
import { unlock } from '../../lock-unlock';
|
|
15
|
-
import {
|
|
16
|
+
import { useBlockElementRef } from '../block-list/use-block-props/use-block-refs';
|
|
16
17
|
import getEditorRegion from '../../utils/get-editor-region';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -41,7 +42,8 @@ function BlockBreadcrumb( { rootLabelText } ) {
|
|
|
41
42
|
|
|
42
43
|
// We don't care about this specific ref, but this is a way
|
|
43
44
|
// to get a ref within the editor canvas so we can focus it later.
|
|
44
|
-
const blockRef =
|
|
45
|
+
const blockRef = useRef();
|
|
46
|
+
useBlockElementRef( clientId, blockRef );
|
|
45
47
|
|
|
46
48
|
/*
|
|
47
49
|
* Disable reason: The `list` ARIA role is redundant but
|
|
@@ -13,7 +13,7 @@ import { throttle } from '@wordpress/compose';
|
|
|
13
13
|
import BlockDraggableChip from './draggable-chip';
|
|
14
14
|
import useScrollWhenDragging from './use-scroll-when-dragging';
|
|
15
15
|
import { store as blockEditorStore } from '../../store';
|
|
16
|
-
import {
|
|
16
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
17
17
|
import { isDropTargetValid } from '../use-block-drop-zone';
|
|
18
18
|
|
|
19
19
|
const BlockDraggable = ( {
|
|
@@ -82,8 +82,8 @@ const BlockDraggable = ( {
|
|
|
82
82
|
}, [] );
|
|
83
83
|
|
|
84
84
|
// Find the root of the editor iframe.
|
|
85
|
-
const
|
|
86
|
-
const editorRoot =
|
|
85
|
+
const blockEl = useBlockElement( clientIds[ 0 ] );
|
|
86
|
+
const editorRoot = blockEl?.closest( 'body' );
|
|
87
87
|
|
|
88
88
|
/*
|
|
89
89
|
* Add a dragover event listener to the editor root to track the blocks being dragged over.
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
useContext,
|
|
6
|
-
useMemo,
|
|
7
|
-
useRef,
|
|
8
|
-
useState,
|
|
9
|
-
useLayoutEffect,
|
|
10
|
-
} from '@wordpress/element';
|
|
4
|
+
import { useContext, useState, useLayoutEffect } from '@wordpress/element';
|
|
11
5
|
import { useRefEffect } from '@wordpress/compose';
|
|
12
6
|
|
|
13
7
|
/**
|
|
@@ -16,7 +10,7 @@ import { useRefEffect } from '@wordpress/compose';
|
|
|
16
10
|
import { BlockRefs } from '../../provider/block-refs-provider';
|
|
17
11
|
|
|
18
12
|
/** @typedef {import('@wordpress/element').RefCallback} RefCallback */
|
|
19
|
-
/** @typedef {import('@wordpress/element').
|
|
13
|
+
/** @typedef {import('@wordpress/element').Ref} Ref */
|
|
20
14
|
|
|
21
15
|
/**
|
|
22
16
|
* Provides a ref to the BlockRefs context.
|
|
@@ -36,31 +30,33 @@ export function useBlockRefProvider( clientId ) {
|
|
|
36
30
|
);
|
|
37
31
|
}
|
|
38
32
|
|
|
33
|
+
function assignRef( ref, value ) {
|
|
34
|
+
if ( typeof ref === 'function' ) {
|
|
35
|
+
ref( value );
|
|
36
|
+
} else if ( ref ) {
|
|
37
|
+
ref.current = value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
39
41
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* reactive, i.e., it won't trigger a rerender of the calling component if the
|
|
43
|
-
* ref value changes. For reactive use cases there is the `useBlockElement` hook.
|
|
44
|
-
*
|
|
45
|
-
* @param {string} clientId The client ID to get a ref for.
|
|
42
|
+
* Tracks the DOM element for the block identified by `clientId` and assigns it to the `ref`
|
|
43
|
+
* whenever it changes.
|
|
46
44
|
*
|
|
47
|
-
* @
|
|
45
|
+
* @param {string} clientId The client ID to track.
|
|
46
|
+
* @param {Ref} ref The ref object/callback to assign to.
|
|
48
47
|
*/
|
|
49
|
-
function
|
|
48
|
+
export function useBlockElementRef( clientId, ref ) {
|
|
50
49
|
const { refsMap } = useContext( BlockRefs );
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} ),
|
|
62
|
-
[ refsMap ]
|
|
63
|
-
);
|
|
50
|
+
useLayoutEffect( () => {
|
|
51
|
+
assignRef( ref, refsMap.get( clientId ) );
|
|
52
|
+
const unsubscribe = refsMap.subscribe( clientId, () =>
|
|
53
|
+
assignRef( ref, refsMap.get( clientId ) )
|
|
54
|
+
);
|
|
55
|
+
return () => {
|
|
56
|
+
unsubscribe();
|
|
57
|
+
assignRef( ref, null );
|
|
58
|
+
};
|
|
59
|
+
}, [ refsMap, clientId, ref ] );
|
|
64
60
|
}
|
|
65
61
|
|
|
66
62
|
/**
|
|
@@ -71,20 +67,8 @@ function useBlockRef( clientId ) {
|
|
|
71
67
|
*
|
|
72
68
|
* @return {Element|null} The block's wrapper element.
|
|
73
69
|
*/
|
|
74
|
-
function useBlockElement( clientId ) {
|
|
75
|
-
const { refsMap } = useContext( BlockRefs );
|
|
70
|
+
export function useBlockElement( clientId ) {
|
|
76
71
|
const [ blockElement, setBlockElement ] = useState( null );
|
|
77
|
-
|
|
78
|
-
// changes (i.e., the block is unmounted and re-mounted), this allows enough time
|
|
79
|
-
// for the ref callbacks to clean up the old element and set the new one.
|
|
80
|
-
useLayoutEffect( () => {
|
|
81
|
-
setBlockElement( refsMap.get( clientId ) );
|
|
82
|
-
return refsMap.subscribe( clientId, () =>
|
|
83
|
-
setBlockElement( refsMap.get( clientId ) )
|
|
84
|
-
);
|
|
85
|
-
}, [ refsMap, clientId ] );
|
|
72
|
+
useBlockElementRef( clientId, setBlockElement );
|
|
86
73
|
return blockElement;
|
|
87
74
|
}
|
|
88
|
-
|
|
89
|
-
export { useBlockRef as __unstableUseBlockRef };
|
|
90
|
-
export { useBlockElement as __unstableUseBlockElement };
|
|
@@ -69,7 +69,11 @@ function BlockMover( {
|
|
|
69
69
|
[ clientIds ]
|
|
70
70
|
);
|
|
71
71
|
|
|
72
|
-
if (
|
|
72
|
+
if (
|
|
73
|
+
! canMove ||
|
|
74
|
+
( isFirst && isLast && ! rootClientId ) ||
|
|
75
|
+
( hideDragHandle && isManualGrid )
|
|
76
|
+
) {
|
|
73
77
|
return null;
|
|
74
78
|
}
|
|
75
79
|
|
|
@@ -85,7 +89,6 @@ function BlockMover( {
|
|
|
85
89
|
<Button
|
|
86
90
|
icon={ dragHandle }
|
|
87
91
|
className="block-editor-block-mover__drag-handle"
|
|
88
|
-
aria-hidden="true"
|
|
89
92
|
label={ __( 'Drag' ) }
|
|
90
93
|
// Should not be able to tab to drag handle as this
|
|
91
94
|
// button can only be used with a pointer device.
|
|
@@ -6,7 +6,7 @@ import { useEffect, useState, useMemo, forwardRef } from '@wordpress/element';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
10
10
|
import { PrivateBlockPopover } from '.';
|
|
11
11
|
|
|
12
12
|
function BlockPopoverCover(
|
|
@@ -20,7 +20,7 @@ import { isRTL } from '@wordpress/i18n';
|
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
22
|
import { store as blockEditorStore } from '../../store';
|
|
23
|
-
import {
|
|
23
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
24
24
|
import usePopoverScroll from './use-popover-scroll';
|
|
25
25
|
|
|
26
26
|
const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
/**
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
|
-
import {
|
|
21
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
22
22
|
import usePopoverScroll from './use-popover-scroll';
|
|
23
23
|
|
|
24
24
|
const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
|
|
@@ -37,7 +37,7 @@ import BlockTitle from '../block-title';
|
|
|
37
37
|
import BlockIcon from '../block-icon';
|
|
38
38
|
import { store as blockEditorStore } from '../../store';
|
|
39
39
|
import BlockDraggable from '../block-draggable';
|
|
40
|
-
import {
|
|
40
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Block selection button component, displaying the label of the block. If the block
|
|
@@ -259,7 +259,6 @@ function BlockSelectionButton( { clientId, rootClientId }, ref ) {
|
|
|
259
259
|
<Button
|
|
260
260
|
icon={ dragHandle }
|
|
261
261
|
className="block-selection-button_drag-handle"
|
|
262
|
-
aria-hidden="true"
|
|
263
262
|
label={ dragHandleLabel }
|
|
264
263
|
// Should not be able to tab to drag handle as this
|
|
265
264
|
// button can only be used with a pointer device.
|
|
@@ -251,12 +251,11 @@ export default function BlockTools( {
|
|
|
251
251
|
name="__unstable-block-tools-after"
|
|
252
252
|
ref={ blockToolbarAfterRef }
|
|
253
253
|
/>
|
|
254
|
-
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
) }
|
|
254
|
+
{ isZoomOutMode && (
|
|
255
|
+
<ZoomOutModeInserters
|
|
256
|
+
__unstableContentRef={ __unstableContentRef }
|
|
257
|
+
/>
|
|
258
|
+
) }
|
|
260
259
|
</InsertionPointOpenRef.Provider>
|
|
261
260
|
</div>
|
|
262
261
|
);
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
import { store as blockEditorStore } from '../../store';
|
|
18
|
-
import {
|
|
18
|
+
import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
|
|
19
19
|
import { hasStickyOrFixedPositionValue } from '../../hooks/position';
|
|
20
20
|
|
|
21
21
|
const COMMON_PROPS = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
4
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
5
|
import { useEffect, useState } from '@wordpress/element';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -16,8 +16,9 @@ function ZoomOutModeInserters() {
|
|
|
16
16
|
const [ isReady, setIsReady ] = useState( false );
|
|
17
17
|
const {
|
|
18
18
|
hasSelection,
|
|
19
|
+
blockInsertionPoint,
|
|
19
20
|
blockOrder,
|
|
20
|
-
|
|
21
|
+
blockInsertionPointVisible,
|
|
21
22
|
setInserterIsOpened,
|
|
22
23
|
sectionRootClientId,
|
|
23
24
|
selectedBlockClientId,
|
|
@@ -25,23 +26,19 @@ function ZoomOutModeInserters() {
|
|
|
25
26
|
} = useSelect( ( select ) => {
|
|
26
27
|
const {
|
|
27
28
|
getSettings,
|
|
29
|
+
getBlockInsertionPoint,
|
|
28
30
|
getBlockOrder,
|
|
29
31
|
getSelectionStart,
|
|
30
32
|
getSelectedBlockClientId,
|
|
31
33
|
getHoveredBlockClientId,
|
|
34
|
+
isBlockInsertionPointVisible,
|
|
32
35
|
} = select( blockEditorStore );
|
|
33
36
|
const { sectionRootClientId: root } = unlock( getSettings() );
|
|
34
|
-
// To do: move ZoomOutModeInserters to core/editor.
|
|
35
|
-
// Or we perhaps we should move the insertion point state to the
|
|
36
|
-
// block-editor store. I'm not sure what it was ever moved to the editor
|
|
37
|
-
// store, because all the inserter components all live in the
|
|
38
|
-
// block-editor package.
|
|
39
|
-
// eslint-disable-next-line @wordpress/data-no-store-string-literals
|
|
40
|
-
const editor = select( 'core/editor' );
|
|
41
37
|
return {
|
|
42
38
|
hasSelection: !! getSelectionStart().clientId,
|
|
39
|
+
blockInsertionPoint: getBlockInsertionPoint(),
|
|
43
40
|
blockOrder: getBlockOrder( root ),
|
|
44
|
-
|
|
41
|
+
blockInsertionPointVisible: isBlockInsertionPointVisible(),
|
|
45
42
|
sectionRootClientId: root,
|
|
46
43
|
setInserterIsOpened:
|
|
47
44
|
getSettings().__experimentalSetIsInserterOpened,
|
|
@@ -50,6 +47,8 @@ function ZoomOutModeInserters() {
|
|
|
50
47
|
};
|
|
51
48
|
}, [] );
|
|
52
49
|
|
|
50
|
+
const { showInsertionPoint } = useDispatch( blockEditorStore );
|
|
51
|
+
|
|
53
52
|
// Defer the initial rendering to avoid the jumps due to the animation.
|
|
54
53
|
useEffect( () => {
|
|
55
54
|
const timeout = setTimeout( () => {
|
|
@@ -65,14 +64,8 @@ function ZoomOutModeInserters() {
|
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
return [ undefined, ...blockOrder ].map( ( clientId, index ) => {
|
|
68
|
-
const shouldRenderInserter = insertionPoint.insertionIndex !== index;
|
|
69
|
-
|
|
70
67
|
const shouldRenderInsertionPoint =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if ( ! shouldRenderInserter && ! shouldRenderInsertionPoint ) {
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
68
|
+
blockInsertionPointVisible && blockInsertionPoint.index === index;
|
|
76
69
|
|
|
77
70
|
const previousClientId = clientId;
|
|
78
71
|
const nextClientId = blockOrder[ index ];
|
|
@@ -104,7 +97,7 @@ function ZoomOutModeInserters() {
|
|
|
104
97
|
className="block-editor-block-list__insertion-point-indicator"
|
|
105
98
|
/>
|
|
106
99
|
) }
|
|
107
|
-
{
|
|
100
|
+
{ ! shouldRenderInsertionPoint && (
|
|
108
101
|
<ZoomOutModeInserterButton
|
|
109
102
|
isVisible={ isSelected || isHovered }
|
|
110
103
|
onClick={ () => {
|
|
@@ -114,6 +107,9 @@ function ZoomOutModeInserters() {
|
|
|
114
107
|
tab: 'patterns',
|
|
115
108
|
category: 'all',
|
|
116
109
|
} );
|
|
110
|
+
showInsertionPoint( sectionRootClientId, index, {
|
|
111
|
+
operation: 'insert',
|
|
112
|
+
} );
|
|
117
113
|
} }
|
|
118
114
|
/>
|
|
119
115
|
) }
|
|
@@ -100,7 +100,6 @@ export default function ZoomOutToolbar( { clientId, rootClientId } ) {
|
|
|
100
100
|
<Button
|
|
101
101
|
icon={ dragHandle }
|
|
102
102
|
className="block-selection-button_drag-handle zoom-out-toolbar-button"
|
|
103
|
-
aria-hidden="true"
|
|
104
103
|
label={ __( 'Drag' ) }
|
|
105
104
|
iconSize={ 24 }
|
|
106
105
|
size="compact"
|
|
@@ -45,7 +45,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
45
45
|
font-weight: 500;
|
|
46
46
|
line-height: 1.4;
|
|
47
47
|
text-transform: uppercase;
|
|
48
|
-
display:
|
|
48
|
+
display: block;
|
|
49
49
|
margin-bottom: calc(4px * 2);
|
|
50
50
|
padding: 0;
|
|
51
51
|
}
|
|
@@ -220,7 +220,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
|
|
|
220
220
|
aria-label="Color: red"
|
|
221
221
|
aria-selected="true"
|
|
222
222
|
class="components-button components-circular-option-picker__option"
|
|
223
|
-
data-active-item=""
|
|
223
|
+
data-active-item="true"
|
|
224
224
|
id="components-circular-option-picker-0-0"
|
|
225
225
|
role="option"
|
|
226
226
|
style="background-color: rgb(255, 0, 0); color: rgb(255, 0, 0);"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { screen } from '@testing-library/react';
|
|
5
|
+
import { render } from '@ariakit/test/react';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -12,7 +13,7 @@ const noop = () => {};
|
|
|
12
13
|
|
|
13
14
|
describe( 'ColorPaletteControl', () => {
|
|
14
15
|
it( 'renders tabs if it is possible to select a color and a gradient rendering a color picker at the start', async () => {
|
|
15
|
-
render(
|
|
16
|
+
await render(
|
|
16
17
|
<ColorGradientControl
|
|
17
18
|
label="Test Color Gradient"
|
|
18
19
|
colorValue="#f00"
|
|
@@ -24,6 +24,7 @@ const MyFontFamilyControl = () => {
|
|
|
24
24
|
onChange={ ( newFontFamily ) => {
|
|
25
25
|
setFontFamily( newFontFamily );
|
|
26
26
|
} }
|
|
27
|
+
__nextHasNoMarginBottom
|
|
27
28
|
/>
|
|
28
29
|
);
|
|
29
30
|
};
|
|
@@ -69,3 +70,10 @@ The current font family value.
|
|
|
69
70
|
- Default: ''
|
|
70
71
|
|
|
71
72
|
The rest of the props are passed down to the underlying `<SelectControl />` instance.
|
|
73
|
+
|
|
74
|
+
#### `__nextHasNoMarginBottom`
|
|
75
|
+
|
|
76
|
+
- **Type:** `boolean`
|
|
77
|
+
- **Default:** `false`
|
|
78
|
+
|
|
79
|
+
Start opting into the new margin-free styles that will become the default in a future version.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { SelectControl } from '@wordpress/components';
|
|
5
|
+
import deprecated from '@wordpress/deprecated';
|
|
5
6
|
import { __ } from '@wordpress/i18n';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -10,6 +11,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
10
11
|
import { useSettings } from '../use-settings';
|
|
11
12
|
|
|
12
13
|
export default function FontFamilyControl( {
|
|
14
|
+
/** Start opting into the new margin-free styles that will become the default in a future version. */
|
|
15
|
+
__nextHasNoMarginBottom = false,
|
|
13
16
|
value = '',
|
|
14
17
|
onChange,
|
|
15
18
|
fontFamilies,
|
|
@@ -33,8 +36,21 @@ export default function FontFamilyControl( {
|
|
|
33
36
|
};
|
|
34
37
|
} ),
|
|
35
38
|
];
|
|
39
|
+
|
|
40
|
+
if ( ! __nextHasNoMarginBottom ) {
|
|
41
|
+
deprecated(
|
|
42
|
+
'Bottom margin styles for wp.blockEditor.FontFamilyControl',
|
|
43
|
+
{
|
|
44
|
+
since: '6.7',
|
|
45
|
+
version: '7.0',
|
|
46
|
+
hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version',
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
36
51
|
return (
|
|
37
52
|
<SelectControl
|
|
53
|
+
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
|
|
38
54
|
label={ __( 'Font' ) }
|
|
39
55
|
options={ options }
|
|
40
56
|
value={ value }
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { useState } from '@wordpress/element';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import FontFamilyControl from '..';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
component: FontFamilyControl,
|
|
13
|
+
title: 'BlockEditor/FontFamilyControl',
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Default = {
|
|
17
|
+
render: function Template( props ) {
|
|
18
|
+
const [ value, setValue ] = useState();
|
|
19
|
+
return (
|
|
20
|
+
<FontFamilyControl
|
|
21
|
+
onChange={ setValue }
|
|
22
|
+
value={ value }
|
|
23
|
+
{ ...props }
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
fontFamilies: [
|
|
29
|
+
{
|
|
30
|
+
fontFace: [
|
|
31
|
+
{
|
|
32
|
+
fontFamily: 'Inter',
|
|
33
|
+
fontStretch: 'normal',
|
|
34
|
+
fontStyle: 'normal',
|
|
35
|
+
fontWeight: '200 900',
|
|
36
|
+
src: [
|
|
37
|
+
'file:./assets/fonts/inter/Inter-VariableFont_slnt,wght.ttf',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
fontFamily: '"Inter", sans-serif',
|
|
42
|
+
name: 'Inter',
|
|
43
|
+
slug: 'inter',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
fontFamily:
|
|
47
|
+
'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif',
|
|
48
|
+
name: 'System Font',
|
|
49
|
+
slug: 'system-font',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
__nextHasNoMarginBottom: true,
|
|
53
|
+
},
|
|
54
|
+
};
|