This is an automated email from the ASF dual-hosted git repository.

robin0716 pushed a commit to branch feat/1.3.5/embed
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 03caf84581bfd4f2aea0a91690ab67e74b1fc1e4
Author: robin <[email protected]>
AuthorDate: Mon May 27 12:24:04 2024 +0800

    refactor(plugin/embed): Update iframe dimensions for embeds
---
 ui/src/plugins/builtin/EditorEmbed/hooks.ts | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ui/src/plugins/builtin/EditorEmbed/hooks.ts 
b/ui/src/plugins/builtin/EditorEmbed/hooks.ts
index 2e2b05a1..c7adbf4a 100644
--- a/ui/src/plugins/builtin/EditorEmbed/hooks.ts
+++ b/ui/src/plugins/builtin/EditorEmbed/hooks.ts
@@ -16,7 +16,7 @@ const useRenderEmbed = (element: HTMLElement) => {
         /https:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/,
       ],
       embed: (videoId: string) => {
-        return `<iframe width="560" height="315" 
src="https://www.youtube.com/embed/${videoId}"; title="YouTube video player" 
frameborder="0" allow="accelerometer; autoplay; clipboard-write; 
encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`;
+        return `<iframe width="100%" height="380" 
src="https://www.youtube.com/embed/${videoId}"; title="YouTube video player" 
frameborder="0" allow="accelerometer; autoplay; clipboard-write; 
encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>`;
       },
     },
     {
@@ -56,7 +56,7 @@ const useRenderEmbed = (element: HTMLElement) => {
         /https:\/\/codepen\.io\/[a-zA-Z0-9_]+\/full\/([a-zA-Z0-9_]+)/,
       ],
       embed: (penId) => {
-        return `<iframe height="265" style="width: 100%;" scrolling="no" 
title="CodePen Embed" 
src="https://codepen.io/${penId}/embed/preview/${penId}?height=265&theme-id=0&default-tab=result";
 frameborder="no" allowtransparency="true" allowfullscreen="true"></iframe>`;
+        return `<iframe width="100%" height="380" scrolling="no" 
title="CodePen Embed" 
src="https://codepen.io/${penId}/embed/preview/${penId}?height=265&theme-id=0&default-tab=result";
 frameborder="no" allowtransparency="true" allowfullscreen="true"></iframe>`;
       },
     },
     {
@@ -66,7 +66,7 @@ const useRenderEmbed = (element: HTMLElement) => {
         /https:\/\/jsfiddle\.net\/[a-zA-Z0-9_]+\/([a-zA-Z0-9_]+)\/embed/,
       ],
       embed: (fiddleId: string) => {
-        return `<iframe width="100%" height="300" 
src="https://jsfiddle.net/${fiddleId}/embedded/"; 
allowfullscreen="allowfullscreen" allowpaymentrequest 
frameborder="0"></iframe>`;
+        return `<iframe width="100%" height="380" 
src="https://jsfiddle.net/${fiddleId}/embedded/"; 
allowfullscreen="allowfullscreen" allowpaymentrequest 
frameborder="0"></iframe>`;
       },
     },
     {
@@ -105,7 +105,7 @@ const useRenderEmbed = (element: HTMLElement) => {
         /https:\/\/excalidraw\.com\/([a-zA-Z0-9_,-]+)/,
       ],
       embed: (excalidrawId: string) => {
-        return `<iframe width="100%" height="300" 
src="https://excalidraw.com/${excalidrawId}/embed"; frameborder="0"></iframe>`;
+        return `<iframe width="100%" height="380" 
src="https://excalidraw.com/${excalidrawId}/embed"; frameborder="0"></iframe>`;
       },
     },
     {
@@ -115,7 +115,7 @@ const useRenderEmbed = (element: HTMLElement) => {
         /https:\/\/www\.loom\.com\/share\/([a-zA-Z0-9_]+)/,
       ],
       embed: (loomId: string) => {
-        return `<iframe width="100%" height="300" 
src="https://www.loom.com/embed/${loomId}"; frameborder="0"></iframe>`;
+        return `<iframe width="100%" height="380" 
src="https://www.loom.com/embed/${loomId}"; frameborder="0"></iframe>`;
       },
     },
     {
@@ -124,7 +124,7 @@ const useRenderEmbed = (element: HTMLElement) => {
         /https:\/\/www\.dropbox\.com\/s\/([a-zA-Z0-9_]+)\/[a-zA-Z0-9_]+/,
       ],
       embed: (dropboxId: string) => {
-        return `<iframe width="100%" height="300" 
src="https://www.dropbox.com/s/${dropboxId}?raw=1"; frameborder="0"></iframe>`;
+        return `<iframe width="100%" height="380" 
src="https://www.dropbox.com/s/${dropboxId}?raw=1"; frameborder="0"></iframe>`;
       },
     },
   ];

Reply via email to