From b28756009c4829031689c5bb5e2f065c6cda0d5c Mon Sep 17 00:00:00 2001 From: madhusudhand Date: Fri, 25 Nov 2022 16:36:25 +0530 Subject: [PATCH] revert defaultPadding and alignment APIs --- .../block-api/block-registration.md | 11 ----------- .../src/components/block-preview/auto.js | 19 +------------------ .../src/components/block-preview/index.js | 2 +- packages/block-library/src/buttons/index.js | 1 - packages/block-library/src/image/index.js | 1 - .../block-library/src/media-text/index.js | 1 - packages/block-library/src/pullquote/index.js | 1 - packages/block-library/src/table/index.js | 1 - packages/block-library/src/video/index.js | 1 - .../global-styles/block-preview-panel.js | 4 ---- 10 files changed, 2 insertions(+), 40 deletions(-) diff --git a/docs/reference-guides/block-api/block-registration.md b/docs/reference-guides/block-api/block-registration.md index b312f81dc9669..97077cb7efdfa 100644 --- a/docs/reference-guides/block-api/block-registration.md +++ b/docs/reference-guides/block-api/block-registration.md @@ -227,17 +227,6 @@ example: { }, ``` -It's possible to set padding for the block in the preview container via `defaultPadding`. For example: - -```js -example: { - attributes: { - cover: 'https://example.com/image.jpg', - }, - defaultPadding: '8px 16px' -}, -``` - #### variations (optional) - **Type:** `Object[]` diff --git a/packages/block-editor/src/components/block-preview/auto.js b/packages/block-editor/src/components/block-preview/auto.js index 665c172047367..587a264f407ca 100644 --- a/packages/block-editor/src/components/block-preview/auto.js +++ b/packages/block-editor/src/components/block-preview/auto.js @@ -66,12 +66,6 @@ function ScaledBlockPreview( { MemoizedBlockList = MemoizedBlockList || pure( BlockList ); const scale = containerWidth / viewportWidth; - - const padding = - typeof __experimentalPadding === 'string' - ? __experimentalPadding - : `${ __experimentalPadding }px`; - return ( { containerResizeListener, { width: containerWidth, height: containerHeight }, ] = useResizeObserver(); - const padding = blockExample?.defaultPadding || 0; const viewportWidth = blockExample?.viewportWidth || containerWidth; return ! blockExample ? null : ( @@ -20,10 +19,7 @@ const BlockPreviewPanel = ( { name } ) => {