From 5f74cfaa5189612fe05ba0340c5d20bc4397e3f0 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 6 Oct 2024 11:26:02 -0700 Subject: [PATCH] enh: artifacts fullscreen --- src/lib/components/chat/Artifacts.svelte | 25 +++++++++++++++++-- .../components/icons/ArrowsPointingOut.svelte | 19 ++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 src/lib/components/icons/ArrowsPointingOut.svelte diff --git a/src/lib/components/chat/Artifacts.svelte b/src/lib/components/chat/Artifacts.svelte index 97fe5c5af..c6b702210 100644 --- a/src/lib/components/chat/Artifacts.svelte +++ b/src/lib/components/chat/Artifacts.svelte @@ -4,9 +4,11 @@ const i18n = getContext('i18n'); const dispatch = createEventDispatcher(); - import { showArtifacts, showControls } from '$lib/stores'; + import { chatId, showArtifacts, showControls } from '$lib/stores'; import XMark from '../icons/XMark.svelte'; import { copyToClipboard, createMessagesList } from '$lib/utils'; + import ArrowsPointingOut from '../icons/ArrowsPointingOut.svelte'; + import Tooltip from '../common/Tooltip.svelte'; export let overlay = false; export let history; @@ -146,6 +148,16 @@ }); }; + const showFullScreen = () => { + if (iframeElement.requestFullscreen) { + iframeElement.requestFullscreen(); + } else if (iframeElement.webkitRequestFullscreen) { + iframeElement.webkitRequestFullscreen(); + } else if (iframeElement.msRequestFullscreen) { + iframeElement.msRequestFullscreen(); + } + }; + onMount(() => {}); @@ -241,7 +253,7 @@ -
+
+ + + +
{/if} diff --git a/src/lib/components/icons/ArrowsPointingOut.svelte b/src/lib/components/icons/ArrowsPointingOut.svelte new file mode 100644 index 000000000..efc7f98b6 --- /dev/null +++ b/src/lib/components/icons/ArrowsPointingOut.svelte @@ -0,0 +1,19 @@ + + + + +