diff --git a/js/load.js b/js/load.js index d761fd17ad6..533fa95cbe9 100644 --- a/js/load.js +++ b/js/load.js @@ -314,6 +314,17 @@ function pkpCreateVueApp(createAppArgs) { return vueApp; } +// Need to add this before the export of sciflow editor com +async function loadSciflowEditor() { + if (!window.sciflowEditorLoaded) { + const sciflowBase = '/lib/ui-library/node_modules/@sciflow/component-demo'; + await import(/* @vite-ignore */ `${sciflowBase}/polyfills.js`); + await import(/* @vite-ignore */ `${sciflowBase}/main.js`); + window.sciflowEditorLoaded = true; + } + return window.sciflowEditorLoaded; +} + export default { Vue: pkpCreateVueApp({}), // making vue functions available via pkp.modules.vue for plugins @@ -358,4 +369,5 @@ export default { vueMixins: { dialog, }, + loadSciflowEditor, };