@@ -11,26 +11,19 @@ import {
1111 STANDALONE ,
1212} from 'shared/config'
1313import { PostHogProvider } from 'posthog-js/react'
14- import { initLogger , getLogger } from 'shared/core'
1514
1615import plugins from './plugins'
1716import { AppConfig } from '@magickml/providers'
1817
1918// We want to add this back in eventually, but it's causing some visual bugs
2019//import './globals.css'
21-
22- initLogger ( { name : 'AIDE' } )
23-
24- const logger = getLogger ( )
25-
26- logger . info ( 'loaded with plugins %o' , plugins )
20+ console . info ( 'loaded with plugins %o' , plugins )
2721/**
2822 * Initialize and render the MagickIDE component when running as a standalone editor (not inside an iframe)
2923 */
3024if ( window === window . parent ) {
31- logger . info ( 'not in iframe' )
3225 if ( STANDALONE ) {
33- logger . info ( 'standalone' )
26+ console . info ( 'standalone' )
3427 const container = document . getElementById ( 'root' ) as Element
3528 const root = createRoot ( container ) // createRoot(container!) if you use TypeScript
3629 ; ( window as any ) . root = root
@@ -57,7 +50,6 @@ if (window === window.parent) {
5750 root . render ( < Root /> )
5851 }
5952} else {
60- logger . info ( 'iframe: In iframe' )
6153 /**
6254 * If the editor is loaded in an iframe, listen for messages from the parent to initialize and render the MagickIDE component
6355 */
@@ -77,10 +69,10 @@ if (window === window.parent) {
7769 event . origin !== window . location . origin &&
7870 ! TRUSTED_PARENT_URLS . includes ( event . origin )
7971 ) {
80- logger . error ( 'Untrusted origin %s' , event . origin ) ;
72+ console . error ( 'Untrusted origin %s' , event . origin ) ;
8173 // Log the trusted origins for debugging purposes
8274 TRUSTED_PARENT_URLS . forEach ( trustedUrl => {
83- logger . error ( 'Trusted origin is %s' , trustedUrl ) ;
75+ console . error ( 'Trusted origin is %s' , trustedUrl ) ;
8476 } ) ;
8577
8678 return ;
@@ -110,15 +102,13 @@ if (window === window.parent) {
110102 </ PostHogProvider >
111103 )
112104 } else {
113- logger . info ( 'iframe: rendering without posthog' )
114105 return < MagickIDE config = { config } />
115106 }
116107 }
117108 const container = document . getElementById ( 'root' ) as Element
118109 const root = createRoot ( container ) // createRoot(container!) if you use TypeScript
119110 ; ( window as any ) . root = root
120111
121- logger . info ( 'iframe: rendering root' )
122112 root . render ( < Root /> )
123113 }
124114 } ,
0 commit comments