From 18f2596908d1280626158b5b4e2a9e253e22098e Mon Sep 17 00:00:00 2001 From: Piotr Delawski Date: Tue, 18 May 2021 22:10:03 +0200 Subject: [PATCH] Update coreDeviceTypes docs --- packages/block-editor/README.md | 16 +++++++++++- .../src/components/preview-options/index.js | 25 +++++++++++-------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index a4f0b1d566f522..2427de60c45771 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -272,7 +272,21 @@ Undocumented declaration. # **coreDeviceTypes** -Undocumented declaration. +An array of strings that represent `deviceType` values that belong to the +block editor core system. + +When the `deviceType` returned by `__experimentalGetPreviewDeviceType()`, is +one of these values, the built-in `VisualEditor` is responsible for rendering +a preview of that type. + +When the `deviceType` is something other than one of the `coreDeviceTypes`, +we are rendering a custom preview registered by the +`` and `` components, and defer to +a `` filled by the plugin to draw the preview. + +_Type_ + +- `Array` # **createCustomColorsHOC** diff --git a/packages/block-editor/src/components/preview-options/index.js b/packages/block-editor/src/components/preview-options/index.js index 70d96652c72270..ef5491690e2ba3 100644 --- a/packages/block-editor/src/components/preview-options/index.js +++ b/packages/block-editor/src/components/preview-options/index.js @@ -24,17 +24,20 @@ const { export { PluginPreviewMenuFill }; -/* - * coreDeviceTypes: An array of strings. The strings returned represent - * deviceType values that belong to the core system. When the deviceType, - * returned by `__experimentalGetPreviewDeviceType()`, is one of these values, - * the built in VisualEditor is responsible for rendering a preview of that - * type. - - * When the deviceType is something other than one of the coreDeviceTypes, we are - * rendering a custom deviceType registered by the and - * components, and defer to a filled by the plugin to - * draw the preview. +/** + * An array of strings that represent `deviceType` values that belong to the + * block editor core system. + * + * When the `deviceType` returned by `__experimentalGetPreviewDeviceType()`, is + * one of these values, the built-in `VisualEditor` is responsible for rendering + * a preview of that type. + * + * When the `deviceType` is something other than one of the `coreDeviceTypes`, + * we are rendering a custom preview registered by the + * `` and `` components, and defer to + * a `` filled by the plugin to draw the preview. + * + * @type {Array} */ export const coreDeviceTypes = [ 'Desktop', 'Tablet', 'Mobile' ];