( {
} }
>
{ showMedia && renderedMediaField && (
- { renderedMediaField }
+
+ { renderedMediaField }
+
) }
{ showMedia && renderedMediaField && (
( {
justify="space-between"
className="dataviews-view-grid__title-actions"
>
- { renderedTitleField }
+
+ { renderedTitleField }
+
diff --git a/packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts b/packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts
index f0a7db5ad966ff..21bf56b578b57d 100644
--- a/packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts
+++ b/packages/e2e-test-utils-playwright/src/admin/visit-site-editor.ts
@@ -54,7 +54,7 @@ export async function visitSiteEditor(
// Wait for the canvas loader to appear first, so that the locator that
// waits for the hidden state doesn't resolve prematurely.
- await canvasLoader.waitFor( { state: 'visible' } );
+ await canvasLoader.waitFor( { state: 'visible', timeout: 60_000 } );
await canvasLoader.waitFor( {
state: 'hidden',
// Bigger timeout is needed for larger entities, like the Large Post
diff --git a/packages/edit-site/src/components/post-edit/index.js b/packages/edit-site/src/components/post-edit/index.js
index d32666bcf3aa1b..97484c89ed670b 100644
--- a/packages/edit-site/src/components/post-edit/index.js
+++ b/packages/edit-site/src/components/post-edit/index.js
@@ -34,17 +34,22 @@ const fieldsWithBulkEditSupport = [
function PostEditForm( { postType, postId } ) {
const ids = useMemo( () => postId.split( ',' ), [ postId ] );
- const { record } = useSelect(
+ const { record, hasFinishedResolution } = useSelect(
( select ) => {
+ const args = [ 'postType', postType, ids[ 0 ] ];
+
+ const {
+ getEditedEntityRecord,
+ hasFinishedResolution: hasFinished,
+ } = select( coreDataStore );
+
return {
record:
- ids.length === 1
- ? select( coreDataStore ).getEditedEntityRecord(
- 'postType',
- postType,
- ids[ 0 ]
- )
- : null,
+ ids.length === 1 ? getEditedEntityRecord( ...args ) : null,
+ hasFinishedResolution: hasFinished(
+ 'getEditedEntityRecord',
+ args
+ ),
};
},
[ postType, ids ]
@@ -159,12 +164,14 @@ function PostEditForm( { postType, postId } ) {
return (
-
+ { hasFinishedResolution && (
+
+ ) }
);
}
diff --git a/storybook/components/figma-embed/index.js b/storybook/components/figma-embed/index.js
new file mode 100644
index 00000000000000..8d8ac6488a9334
--- /dev/null
+++ b/storybook/components/figma-embed/index.js
@@ -0,0 +1,47 @@
+/**
+ * Internal dependencies
+ */
+import './style.scss';
+
+// See https://www.figma.com/developers/embed#embed-a-figma-file
+const CONFIG = {
+ 'embed-host': 'wordpress-storybook',
+ footer: false,
+ 'page-selector': false,
+ 'viewport-controls': true,
+};
+
+/**
+ * Embed Figma links in the Storybook.
+ *
+ * @param {Object} props
+ * @param {string} props.url - Figma URL to embed.
+ * @param {string} props.title - Accessible title for the iframe.
+ */
+function FigmaEmbed( { url, title, ...props } ) {
+ const urlObj = new URL( url );
+
+ const queryParams = new URLSearchParams( urlObj.search );
+ Object.entries( CONFIG ).forEach( ( [ key, value ] ) => {
+ queryParams.set( key, value );
+ } );
+ urlObj.search = queryParams.toString();
+
+ urlObj.hostname = urlObj.hostname.replace(
+ 'www.figma.com',
+ 'embed.figma.com'
+ );
+
+ const normalizedUrl = urlObj.toString();
+
+ return (
+
+ );
+}
+
+export default FigmaEmbed;
diff --git a/storybook/components/figma-embed/style.scss b/storybook/components/figma-embed/style.scss
new file mode 100644
index 00000000000000..8311642b9b0974
--- /dev/null
+++ b/storybook/components/figma-embed/style.scss
@@ -0,0 +1,4 @@
+.wp-storybook-figma-embed {
+ width: 100%;
+ border: none;
+}
diff --git a/storybook/main.js b/storybook/main.js
index 66aed2f00a2fb9..5261fbbf4726ab 100644
--- a/storybook/main.js
+++ b/storybook/main.js
@@ -31,7 +31,8 @@ const stories = [
process.env.NODE_ENV !== 'test' && './stories/**/*.story.@(js|tsx)',
process.env.NODE_ENV !== 'test' && './stories/**/*.mdx',
'../packages/block-editor/src/**/stories/*.story.@(js|tsx|mdx)',
- '../packages/components/src/**/stories/*.story.@(js|tsx|mdx)',
+ '../packages/components/src/**/stories/*.story.@(js|tsx)',
+ '../packages/components/src/**/stories/*.mdx',
'../packages/icons/src/**/stories/*.story.@(js|tsx|mdx)',
'../packages/edit-site/src/**/stories/*.story.@(js|tsx|mdx)',
'../packages/dataviews/src/**/stories/*.story.@(js|tsx|mdx)',