refac: built-in tools ui component support
This commit is contained in:
@@ -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