refac: built-in tools ui component support
This commit is contained in:
@@ -107,6 +107,7 @@
|
||||
<div class="my-2" id={`${collapsibleId}-tool-calls-${attributes?.id}-embed-${idx}`}>
|
||||
<FullHeightIframe
|
||||
src={embed}
|
||||
{args}
|
||||
allowScripts={true}
|
||||
allowForms={true}
|
||||
allowSameOrigin={true}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
export let title = 'Embedded Content';
|
||||
export let initialHeight: number | null = null; // initial height in px, null = auto
|
||||
|
||||
export let args = null;
|
||||
|
||||
export let allowScripts = true;
|
||||
export let allowForms = false;
|
||||
|
||||
@@ -63,6 +65,11 @@
|
||||
const onLoad = async () => {
|
||||
requestAnimationFrame(resizeSameOrigin);
|
||||
|
||||
// if arguments are provided, inject them into the iframe window
|
||||
if (args && iframe?.contentWindow) {
|
||||
(iframe.contentWindow as any).args = args;
|
||||
}
|
||||
|
||||
// If we're injecting Alpine into srcdoc iframe and sameOrigin allowed
|
||||
if (iframeDoc && allowSameOrigin && iframe?.contentWindow) {
|
||||
const alpineDirectives = [
|
||||
|
||||
Reference in New Issue
Block a user