From b137820f7fa9c3dfe5c9758299c128262bd928f5 Mon Sep 17 00:00:00 2001 From: Gary Date: Fri, 15 Oct 2021 16:19:56 +1100 Subject: [PATCH 1/2] Add Wolfram embeds support. --- packages/block-library/src/embed/icons.js | 6 ++++++ packages/block-library/src/embed/variations.js | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/packages/block-library/src/embed/icons.js b/packages/block-library/src/embed/icons.js index 2f39a61dbcea6..650b7c0bd3a90 100644 --- a/packages/block-library/src/embed/icons.js +++ b/packages/block-library/src/embed/icons.js @@ -147,3 +147,9 @@ export const embedPinterestIcon = ( ); + +export const embedWolframIcon = ( + + + +); diff --git a/packages/block-library/src/embed/variations.js b/packages/block-library/src/embed/variations.js index 681c687874cfa..13385a060e74f 100644 --- a/packages/block-library/src/embed/variations.js +++ b/packages/block-library/src/embed/variations.js @@ -25,6 +25,7 @@ import { embedAnimotoIcon, embedDailymotionIcon, embedPinterestIcon, + embedWolframIcon, } from './icons'; /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ @@ -341,6 +342,14 @@ const variations = [ ], attributes: { providerNameSlug: 'pinterest' }, }, + { + name: 'wolfram-cloud', + title: 'Wolfram Cloud', + icon: embedWolframIcon, + description: __( 'Embed Wolfram Cloud notebook content.' ), + patterns: [ /^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i ], + attributes: { providerNameSlug: 'wolfram-cloud' }, + }, ]; /** From 69d0545fb71e3137c93816952ada6bbe4a2cb348 Mon Sep 17 00:00:00 2001 From: Gary Date: Mon, 1 Nov 2021 11:54:58 +1100 Subject: [PATCH 2/2] Mark the embeds as responsive. --- packages/block-library/src/embed/variations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/embed/variations.js b/packages/block-library/src/embed/variations.js index 13385a060e74f..0700e0177cdcf 100644 --- a/packages/block-library/src/embed/variations.js +++ b/packages/block-library/src/embed/variations.js @@ -348,7 +348,7 @@ const variations = [ icon: embedWolframIcon, description: __( 'Embed Wolfram Cloud notebook content.' ), patterns: [ /^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i ], - attributes: { providerNameSlug: 'wolfram-cloud' }, + attributes: { providerNameSlug: 'wolfram-cloud', responsive: true }, }, ];