Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function renderContainer( container, context ) {
const node = document.querySelector( `.container-${ container.id }` );
const Component = getContainerType( container.type, context );
if ( node ) {
render(
,
node,
() => {
node.dataset.mounted = true;
}
);
} else {
// eslint-disable-next-line no-console
console.error( sprintf( __( 'Could not find DOM element for container "%1$s".', 'carbon-fields-ui' ), container.id ) );
}
}
domReady( () => {
// Don't do this for old browsers.
if ( ! Element.prototype.closest ) {
return
}
const helpContainer = document.createElement( 'DIV' )
document.querySelector( 'body' ).appendChild( helpContainer )
render( , helpContainer )
} )
function renderComponent( Component ) {
const element = document.createElement( "div" );
element.setAttribute( "id", "yoast-helpscout-beacon" );
render( , element );
document.body.appendChild( element );
}
export default function initializeMonitors( context ) {
const { pagenow } = window.cf.config;
render(
{ ! isGutenberg() && (
) }
{ ( pagenow === PAGE_NOW_WIDGETS || pagenow === PAGE_NOW_CUSTOMIZE ) && (
) }
,
document.createElement( 'div' )
);
const postStuffNode = document.querySelector( '#poststuff' );
export function initialize( id, settings ) {
registerCoreBlocks();
render(
,
document.getElementById( id )
);
}
const storyControls = document.createElement( 'div' );
storyControls.id = 'amp-story-controls';
ampStoryWrapper.appendChild( storyControls );
render(
,
storyControls,
);
}
ampStoryWrapper.appendChild( editorBlockList );
ampStoryWrapper.appendChild( blockNavigation );
render(
,
blockNavigation,
);
if ( ! document.getElementById( 'amp-story-editor-carousel' ) ) {
const editorCarousel = document.createElement( 'div' );
editorCarousel.id = 'amp-story-editor-carousel';
ampStoryWrapper.appendChild( editorCarousel );
render(
,
editorCarousel,
);
}
}
)
);
}
}
HandoffBanner.defaultProps = {
primaryButtonText: __( 'Back to Newspack' ),
dismissButtonText: __( 'Dismiss' ),
primaryButtonURL: '/wp-admin/admin.php?page=newspack',
bodyText: __( 'Click to return to Newspack after completing configuration' ),
};
const el = document.getElementById( 'newspack-handoff-banner' );
const { primary_button_url: primaryButtonURL } = el.dataset;
render(
createElement( HandoffBanner, {
primaryButtonURL,
} ),
el
);
export function initialize( id, settings ) {
registerCoreBlocks();
if ( process.env.GUTENBERG_PHASE === 2 ) {
__experimentalRegisterExperimentalCoreBlocks( settings );
}
render( , document.getElementById( id ) );
}
export function renderClassicEditorMetabox( store ) {
const localizedData = getL10nObject();
containerRef = createRef();
const theme = {
isRtl: localizedData.isRtl,
};
render(
(
),
document.getElementById( "wpseo-metabox-root" )
);
registeredComponents.forEach( ( registered ) => {
containerRef.current.registerComponent( registered.key, registered.Component );
} );
) }
{ ( pagenow === PAGE_NOW_WIDGETS || pagenow === PAGE_NOW_CUSTOMIZE ) && (
) }
,
document.createElement( 'div' )
);
const postStuffNode = document.querySelector( '#poststuff' );
if ( postStuffNode ) {
render( , postStuffNode.appendChild( document.createElement( 'div' ) ) );
}
}