HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/ilikadirect/public_html/wp-content/plugins/ml-slider/extendify-sdk/src/app.js
import { rawHandler } from '@wordpress/blocks'
import { render } from '@wordpress/element'
import ExtendifyLibrary from '@extendify/ExtendifyLibrary'
import '@extendify/blocks/blocks'
import '@extendify/buttons'
import '@extendify/listeners'
import { useWantedTemplateStore } from '@extendify/state/Importing'
import { injectTemplateBlocks } from '@extendify/util/templateInjection'

window._wpLoadBlockEditor &&
    window.wp.domReady(() => {
        // Insert into the editor (note: Modal opens in a portal)
        const extendify = Object.assign(document.createElement('div'), {
            id: 'extendify-root',
        })
        document.body.append(extendify)
        render(<ExtendifyLibrary />, extendify)

        // Add an extra div to use for utility modals, etc
        extendify.parentNode.insertBefore(
            Object.assign(document.createElement('div'), {
                id: 'extendify-util',
            }),
            extendify.nextSibling,
        )

        // Insert a template on page load if it exists in localstorage
        // Note 6/28/21 - this was moved to after the render to possibly
        // fix a bug where imports would go from 3->0.
        if (useWantedTemplateStore.getState().importOnLoad) {
            const template = useWantedTemplateStore.getState().wantedTemplate
            setTimeout(() => {
                injectTemplateBlocks(
                    rawHandler({ HTML: template.fields.code }),
                    template,
                )
            }, 0)
        }

        // Reset template state after checking if we need an import
        useWantedTemplateStore.setState({
            importOnLoad: false,
            wantedTemplate: {},
        })
    })